Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
c196cbee
Commit
c196cbee
authored
May 01, 2018
by
Grégoire Paris
Committed by
Jonathan H. Wage
May 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add page about upgrading
Fixes #3121 Conflicts: docs/en/index.rst
parent
b37f898d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
0 deletions
+52
-0
upgrading.rst
docs/en/reference/upgrading.rst
+51
-0
sidebar.rst
docs/en/sidebar.rst
+1
-0
No files found.
docs/en/reference/upgrading.rst
0 → 100644
View file @
c196cbee
Upgrading
=========
New versions of Doctrine come with an upgrade guide named UPGRADE.md.
This guide documents BC-breaks and deprecations.
Deprecations
------------
Deprecations are signaled by emitting a silenced ``E_USER_DEPRECATED``
error, like this:
.. code-block:: php
<?php
@trigger_error(
'QuantumDefraculator::__invoke() is deprecated.',
E_USER_DEPRECATED
);
Since this error is silenced, it will not produce any effect unless you
opt-in by setting up an error handler designed to ignore the silence
operator in that case. Such an error handler could look like this:
.. code-block:: php
<?php
set_error_handler(function (
int $errno,
string $errstr,
string $errfile,
int $errline,
array $errcontext
) : void {
if (error_reporting() === 0) {
/* "normal" error handlers would return in this case, but
this one will not */
}
echo "Hey there was a deprecation, here is what it says: $errstr";
}, E_USER_DEPRECATED);
This is of course overly simplified, and if you are looking for such an
error handler, consider the ``symfony/debug``, error handler that will
log deprecations. You may also be interested by the
``symfony/phpunit-bridge`` error handler that will catch deprecations
and nicely display them after running your test suites, and can even
make your build fail in that kind of case if you want to be strict about
that.
docs/en/sidebar.rst
View file @
c196cbee
...
...
@@ -19,3 +19,4 @@
reference/portability
reference/caching
reference/known-vendor-issues
reference/upgrading
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment