[TYPO3-core] Proper usage of @deprecated
Markus Klein
klein.t3 at mfc-linz.at
Tue Jul 9 21:49:22 CEST 2013
Hi!
I just fixed two other occurrences in Core two days ago.
In one place the method ::deprecationLog("...") was used, where logDeprecatedFunction() should have been used.
This led to the result that the deprecation log file only listed a date and the text, but no references, where this deprecation occurred.
What is even more important: It does NOT suffice to write
GeneralUtility::logDeprecatedFunction();
There has to be a phpdoc entry as well:
@deprecated since 6.x, will be removed two versions later - Use Class::method() instead
Kind regards
Markus
------------------------------------------------------------
Markus Klein
TYPO3 CMS Active Contributors Team Member
> -----Original Message-----
> From: typo3-team-core-bounces at lists.typo3.org [mailto:typo3-team-core-
> bounces at lists.typo3.org] On Behalf Of François Suter
> Sent: Tuesday, July 09, 2013 8:49 PM
> To: typo3-team-core at lists.typo3.org
> Subject: [TYPO3-core] Proper usage of @deprecated
>
> Hi all,
>
> I recently stumbled over 2 wrong usages of @deprecated in the Core (one I
> can't remember, the other is
> \TYPO3\CMS\Extbase\Object\ObjectManager::create()). In these 2 cases,
> the method is marked as deprecated but the message does not indicate by
> what other method it is replaced. This is extremely frustrating when one
> does not know the context and thus has little chance of guessing the
> replacement.
>
> It must be said - however - that the coding guidelines are not explicit in this
> regard, and even outright wrong in the example usage of
> \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction(). [1]
>
> If I can spare a minute I'll patch the CGL. If anyone feels like doing before me,
> don't hesitate ;-)
>
> In the meantime, please make sure to always include the replacement
> method when deprecating a function. This will definitely improve the
> smoothness of the transition to 6.2.
>
> Cheers
>
> --
>
> Francois Suter
>
> Work: Cobweb Development Sarl - http://www.cobweb.ch
>
> TYPO3: Help the project! - http://typo3.org/contribute/
>
> Appreciate my work? Support me -
> http://www.monpetitcoin.com/en/francois/support-me/
>
> [1]
> http://docs.typo3.org/typo3cms/CodingGuidelinesReference/CodingBestPra
> ctices/HandlingDeprecation/Index.html
> _______________________________________________
> Before posting to this list, please have a look to the posting rules on the
> following websites:
>
> http://typo3.org/teams/core/core-mailinglist-rules/
> http://typo3.org/development/bug-fixing/diff-and-patch/
> _______________________________________________
> TYPO3-team-core mailing list
> TYPO3-team-core at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-team-core
More information about the TYPO3-team-core
mailing list