Browse Source

Merge pull request #4108 from OskarStark/deprecation-messages

Detailed deprecation messages
Christian Gripp 8 years ago
parent
commit
00b8c78bea

+ 5 - 1
Datagrid/ListMapper.php

@@ -77,7 +77,11 @@ class ListMapper extends BaseMapper
         // Change deprecated inline action "view" to "show"
         if ($name == '_action' && $type == 'actions') {
             if (isset($fieldDescriptionOptions['actions']['view'])) {
-                @trigger_error('Inline action "view" is deprecated since version 2.2.4 and will be removed in 4.0. Use inline action "show" instead.', E_USER_DEPRECATED);
+                @trigger_error(
+                    'Inline action "view" is deprecated since version 2.2.4 and will be removed in 4.0. '
+                    .'Use inline action "show" instead.',
+                    E_USER_DEPRECATED
+                );
 
                 $fieldDescriptionOptions['actions']['show'] = $fieldDescriptionOptions['actions']['view'];
 

+ 2 - 1
Twig/Extension/SonataAdminExtension.php

@@ -321,7 +321,8 @@ EOT;
 
             if ($method) {
                 @trigger_error(
-                    'Option "associated_tostring" is deprecated since version 2.3. Use "associated_property" instead.',
+                    'Option "associated_tostring" is deprecated since version 2.3 and will be removed in 4.0. '
+                    .'Use "associated_property" instead.',
                     E_USER_DEPRECATED
                 );
             } else {

+ 11 - 3
Util/AdminObjectAclData.php

@@ -176,7 +176,11 @@ class AdminObjectAclData
      */
     public function setForm(Form $form)
     {
-        @trigger_error('setForm() is deprecated since version 3.0. Use setAclUsersForm() instead.', E_USER_DEPRECATED);
+        @trigger_error(
+            'setForm() is deprecated since version 3.0 and will be removed in 4.0. '
+            .'Use setAclUsersForm() instead.',
+            E_USER_DEPRECATED
+        );
 
         return $this->setAclUsersForm($form);
     }
@@ -190,7 +194,11 @@ class AdminObjectAclData
      */
     public function getForm()
     {
-        @trigger_error('getForm() is deprecated since version 3.0. Use getAclUsersForm() instead.', E_USER_DEPRECATED);
+        @trigger_error(
+            'getForm() is deprecated since version 3.0 and will be removed in 4.0. '
+            .'Use getAclUsersForm() instead.',
+            E_USER_DEPRECATED
+        );
 
         return $this->getAclUsersForm();
     }
@@ -275,7 +283,7 @@ class AdminObjectAclData
     }
 
     /**
-     * Tests if the current user as the OWNER right.
+     * Tests if the current user has the OWNER right.
      *
      * @return bool
      */

+ 10 - 2
Util/AdminObjectAclManipulator.php

@@ -72,7 +72,11 @@ class AdminObjectAclManipulator
      */
     public function createForm(AdminObjectAclData $data)
     {
-        @trigger_error('createForm() is deprecated since version 3.0. Use createAclUsersForm() instead.', E_USER_DEPRECATED);
+        @trigger_error(
+            'createForm() is deprecated since version 3.0 and will be removed in 4.0. '
+            .'Use createAclUsersForm() instead.',
+            E_USER_DEPRECATED
+        );
 
         return $this->createAclUsersForm($data);
     }
@@ -146,7 +150,11 @@ class AdminObjectAclManipulator
      */
     public function updateAcl(AdminObjectAclData $data)
     {
-        @trigger_error('updateAcl() is deprecated since version 3.0. Use updateAclUsers() instead.', E_USER_DEPRECATED);
+        @trigger_error(
+            'updateAcl() is deprecated since version 3.0 and will be removed in 4.0.'
+            .'Use updateAclUsers() instead.',
+            E_USER_DEPRECATED
+        );
 
         $this->updateAclUsers($data);
     }