Skip to content

Recommend including the package name in messages #11522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions contributing/code/conventions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ A feature is marked as deprecated by adding a ``@deprecated`` phpdoc to
relevant classes, methods, properties, ...::

/**
* @deprecated since version 2.8, to be removed in 3.0. Use XXX instead.
* @deprecated since foo-org/bar-lib 2.8, to be removed in 3.0. Use XXX instead.
*/

The deprecation message should indicate the version when the class/method was
Expand All @@ -103,7 +103,7 @@ A PHP ``E_USER_DEPRECATED`` error must also be triggered to help people with
the migration starting one or two minor versions before the version where the
feature will be removed (depending on the criticality of the removal)::

@trigger_error('XXX() is deprecated since version 2.8 and will be removed in 3.0. Use XXX instead.', E_USER_DEPRECATED);
@trigger_error('XXX() is deprecated since foo-org/bar-lib 2.8 and will be removed in 3.0. Use XXX instead.', E_USER_DEPRECATED);

Without the `@-silencing operator`_, users would need to opt-out from deprecation
notices. Silencing swaps this behavior and allows users to opt-in when they are
Expand Down
2 changes: 1 addition & 1 deletion contributing/code/standards.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ short example containing most features described below::
*/
public function someDeprecatedMethod()
{
@trigger_error(sprintf('The %s() method is deprecated since version 2.8 and will be removed in 3.0. Use Acme\Baz::someMethod() instead.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The %s() method is deprecated since foo-org/bar-lib 2.8 and will be removed in 3.0. Use Acme\Baz::someMethod() instead.', __METHOD__), E_USER_DEPRECATED);

return Baz::someMethod();
}
Expand Down
6 changes: 3 additions & 3 deletions service_container/alias_private.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ or you decided not to maintain it anymore), you can deprecate its definition:
.. code-block:: yaml

AppBundle\Service\OldService:
deprecated: The "%service_id%" service is deprecated since 2.8 and will be removed in 3.0.
deprecated: The "%service_id%" service is deprecated since foo-org/bar-bundle 2.8 and will be removed in 3.0.

.. code-block:: xml

Expand All @@ -252,7 +252,7 @@ or you decided not to maintain it anymore), you can deprecate its definition:

<services>
<service id="AppBundle\Service\OldService">
<deprecated>The "%service_id%" service is deprecated since 2.8 and will be removed in 3.0.</deprecated>
<deprecated>The "%service_id%" service is deprecated since foo-org/bar-bundle 2.8 and will be removed in 3.0.</deprecated>
</service>
</services>
</container>
Expand All @@ -265,7 +265,7 @@ or you decided not to maintain it anymore), you can deprecate its definition:
->register(OldService::class)
->setDeprecated(
true,
'The "%service_id%" service is deprecated since 2.8 and will be removed in 3.0.'
'The "%service_id%" service is deprecated since foo-org/bar-bundle 2.8 and will be removed in 3.0.'
)
;

Expand Down