[TASK] Let deprecation notices contain class and method/property names 56/57956/2
authorAlexander Schnitzler <git@alexanderschnitzler.de>
Sat, 18 Aug 2018 17:10:22 +0000 (19:10 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 18 Aug 2018 18:56:25 +0000 (20:56 +0200)
Instead of using generic deprecation messages like "Tagging methods with
@ignorevalidation is deprecated and will be removed...", deprecation
messages should contain the affected class and method/property name.

Releases: master
Resolves: #83255
Change-Id: I0ec1a5739c7b9eaa39e8447d19c410de27d2d3c8
Reviewed-on: https://review.typo3.org/57956
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/extbase/Classes/Reflection/ClassSchema.php

index 460e91b..801e065 100644 (file)
@@ -216,7 +216,11 @@ class ClassSchema
 
             if ($docCommentParser->isTaggedWith('validate')) {
                 trigger_error(
-                    'Tagging properties with @validate is deprecated and will be removed in TYPO3 v10.0.',
+                    sprintf(
+                        'Property %s::%s is tagged with @validate which is deprecated and will be removed in TYPO3 v10.0.',
+                        $reflectionClass->getName(),
+                        $reflectionProperty->getName()
+                    ),
                     E_USER_DEPRECATED
                 );
 
@@ -245,7 +249,11 @@ class ClassSchema
             if ($docCommentParser->isTaggedWith('lazy')) {
                 $this->properties[$propertyName]['annotations']['lazy'] = true;
                 trigger_error(
-                    'Tagging properties with @lazy is deprecated and will be removed in TYPO3 v10.0.',
+                    sprintf(
+                        'Property %s::%s is tagged with @lazy which is deprecated and will be removed in TYPO3 v10.0.',
+                        $reflectionClass->getName(),
+                        $reflectionProperty->getName()
+                    ),
                     E_USER_DEPRECATED
                 );
             }
@@ -257,7 +265,11 @@ class ClassSchema
             if ($docCommentParser->isTaggedWith('transient')) {
                 $this->properties[$propertyName]['annotations']['transient'] = true;
                 trigger_error(
-                    'Tagging properties with @transient is deprecated and will be removed in TYPO3 v10.0.',
+                    sprintf(
+                        'Property %s::%s is tagged with @transient which is deprecated and will be removed in TYPO3 v10.0.',
+                        $reflectionClass->getName(),
+                        $reflectionProperty->getName()
+                    ),
                     E_USER_DEPRECATED
                 );
             }
@@ -278,7 +290,11 @@ class ClassSchema
 
             if ($propertyName !== 'settings' && $docCommentParser->isTaggedWith('inject')) {
                 trigger_error(
-                    'Tagging properties with @inject is deprecated and will be removed in TYPO3 v10.0.',
+                    sprintf(
+                        'Property %s::%s is tagged with @inject which is deprecated and will be removed in TYPO3 v10.0.',
+                        $reflectionClass->getName(),
+                        $reflectionProperty->getName()
+                    ),
                     E_USER_DEPRECATED
                 );
                 try {
@@ -289,7 +305,11 @@ class ClassSchema
 
                     if (!$reflectionProperty->isPublic()) {
                         trigger_error(
-                            'Using @inject with non-public properties is deprecated since TYPO3 v9.0 and will stop working in TYPO3 v10.0.',
+                            sprintf(
+                                'Property %s::%s is not public and tagged with @inject which is deprecated and will stop working in TYPO3 v10.0.',
+                                $reflectionClass->getName(),
+                                $reflectionProperty->getName()
+                            ),
                             E_USER_DEPRECATED
                         );
                     }
@@ -308,7 +328,11 @@ class ClassSchema
 
                 if ($this->properties[$propertyName]['annotations']['cascade'] !== null) {
                     trigger_error(
-                        'Tagging properties with @cascade is deprecated and will be removed in TYPO3 v10.0.',
+                        sprintf(
+                            'Property %s::%s is tagged with @cascade which is deprecated and will be removed in TYPO3 v10.0.',
+                            $reflectionClass->getName(),
+                            $reflectionProperty->getName()
+                        ),
                         E_USER_DEPRECATED
                     );
                 }
@@ -392,13 +416,21 @@ class ClassSchema
             foreach ($docCommentParser->getTagsValues() as $tag => $values) {
                 if ($tag === 'ignorevalidation') {
                     trigger_error(
-                        'Tagging methods with @ignorevalidation is deprecated and will be removed in TYPO3 v10.0.',
+                        sprintf(
+                            'Method %s::%s is tagged with @ignorevalidation which is deprecated and will be removed in TYPO3 v10.0.',
+                            $reflectionClass->getName(),
+                            $reflectionMethod->getName()
+                        ),
                         E_USER_DEPRECATED
                     );
                 }
                 if ($tag === 'validate' && $this->isController && $this->methods[$methodName]['isAction']) {
                     trigger_error(
-                        'Tagging methods with @validate is deprecated and will be removed in TYPO3 v10.0.',
+                        sprintf(
+                            'Method %s::%s is tagged with @validate which is deprecated and will be removed in TYPO3 v10.0.',
+                            $reflectionClass->getName(),
+                            $reflectionMethod->getName()
+                        ),
                         E_USER_DEPRECATED
                     );