Skip to content

Commit

Permalink
Streamline deprecation messages
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarStark authored and core23 committed Jan 9, 2020
1 parent 44b8206 commit 51b8c2e
Show file tree
Hide file tree
Showing 34 changed files with 62 additions and 62 deletions.
28 changes: 14 additions & 14 deletions src/Admin/AbstractAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ abstract class AbstractAdmin implements AdminInterface, DomainObjectInterface, A
*
* @var bool
*
* @deprecated since 3.34, to be removed in 4.0.
* @deprecated since sonata-project/admin-bundle 3.34, to be removed in 4.0.
*/
protected $persistFilters = false;

Expand Down Expand Up @@ -240,7 +240,7 @@ abstract class AbstractAdmin implements AdminInterface, DomainObjectInterface, A
*
* NEXT_MAJOR: remove this attribute.
*
* @deprecated This attribute is deprecated since 3.24 and will be removed in 4.0
* @deprecated This attribute is deprecated since sonata-project/admin-bundle 3.24 and will be removed in 4.0
*
* @var string
*/
Expand Down Expand Up @@ -297,7 +297,7 @@ abstract class AbstractAdmin implements AdminInterface, DomainObjectInterface, A
*
* @var \Symfony\Component\Translation\TranslatorInterface
*
* @deprecated since 3.9, to be removed with 4.0
* @deprecated since sonata-project/admin-bundle 3.9, to be removed with 4.0
*/
protected $translator;

Expand Down Expand Up @@ -407,7 +407,7 @@ abstract class AbstractAdmin implements AdminInterface, DomainObjectInterface, A
/**
* @var array<string, string>
*
* @deprecated since 3.34, will be dropped in 4.0. Use TemplateRegistry services instead
* @deprecated since sonata-project/admin-bundle 3.34, will be dropped in 4.0. Use TemplateRegistry services instead
*/
protected $templates = [];

Expand Down Expand Up @@ -1044,7 +1044,7 @@ public function getSubClasses()
public function addSubClass($subClass)
{
@trigger_error(sprintf(
'Method "%s" is deprecated since 3.30 and will be removed in 4.0.',
'Method "%s" is deprecated since sonata-project/admin-bundle 3.30 and will be removed in 4.0.',
__METHOD__
), E_USER_DEPRECATED);

Expand Down Expand Up @@ -1272,7 +1272,7 @@ public function setTemplate($name, $template)
}

/**
* @deprecated since 3.34, will be dropped in 4.0. Use TemplateRegistry services instead
* @deprecated since sonata-project/admin-bundle 3.34, will be dropped in 4.0. Use TemplateRegistry services instead
*
* @return array<string, string>
*/
Expand All @@ -1282,7 +1282,7 @@ public function getTemplates()
}

/**
* @deprecated since 3.34, will be dropped in 4.0. Use TemplateRegistry services instead
* @deprecated since sonata-project/admin-bundle 3.34, will be dropped in 4.0. Use TemplateRegistry services instead
*
* @param string $name
*
Expand Down Expand Up @@ -1508,7 +1508,7 @@ public function getLabel()
*
* NEXT_MAJOR: remove this method
*
* @deprecated since 3.34, to be removed in 4.0.
* @deprecated since sonata-project/admin-bundle 3.34, to be removed in 4.0.
*/
public function setPersistFilters($persist)
{
Expand Down Expand Up @@ -1839,8 +1839,8 @@ public function addChild(AdminInterface $child)
$child->addParentAssociationMapping($this->getCode(), $args[1]);
} else {
@trigger_error(
'Calling "addChild" without second argument is deprecated since 3.35'
.' and will not be allowed in 4.0.',
'Calling "addChild" without second argument is deprecated since'
.' sonata-project/admin-bundle 3.35 and will not be allowed in 4.0.',
E_USER_DEPRECATED
);
}
Expand Down Expand Up @@ -2099,7 +2099,7 @@ public function trans($id, array $parameters = [], $domain = null, $locale = nul
*
* @return string the translated string
*
* @deprecated since 3.9, to be removed with 4.0
* @deprecated since sonata-project/admin-bundle 3.9, to be removed with 4.0
*/
public function transChoice($id, $count, array $parameters = [], $domain = null, $locale = null)
{
Expand Down Expand Up @@ -2128,7 +2128,7 @@ public function getTranslationDomain()
*
* NEXT_MAJOR: remove this method
*
* @deprecated since 3.9, to be removed with 4.0
* @deprecated since sonata-project/admin-bundle 3.9, to be removed with 4.0
*/
public function setTranslator(TranslatorInterface $translator)
{
Expand All @@ -2148,7 +2148,7 @@ public function setTranslator(TranslatorInterface $translator)
*
* NEXT_MAJOR: remove this method
*
* @deprecated since 3.9, to be removed with 4.0
* @deprecated since sonata-project/admin-bundle 3.9, to be removed with 4.0
*/
public function getTranslator()
{
Expand Down Expand Up @@ -2268,7 +2268,7 @@ public function getCode()
/**
* NEXT_MAJOR: Remove this function.
*
* @deprecated This method is deprecated since 3.24 and will be removed in 4.0
* @deprecated This method is deprecated since sonata-project/admin-bundle 3.24 and will be removed in 4.0
*
* @param string $baseCodeRoute
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/**
* NEXT_MAJOR: remove this class.
*
* @deprecated since version 3.1, to be removed in 4.0. Use Sonata\AdminBundle\AbstractAdmin instead
* @deprecated since sonata-project/admin-bundle 3.1, to be removed in 4.0. Use Sonata\AdminBundle\AbstractAdmin instead
*
* @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/AdminExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/**
* NEXT_MAJOR: remove this class.
*
* @deprecated since version 3.1, to be removed in 4.0. Use Sonata\AdminBundle\AbstractAdminExtension instead
* @deprecated since sonata-project/admin-bundle 3.1, to be removed in 4.0. Use Sonata\AdminBundle\AbstractAdminExtension instead
*
* @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/AdminHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public function addNewInstance($object, FieldDescriptionInterface $fieldDescript
*
* @return string
*
* @deprecated Deprecated since version 3.1. Use \Doctrine\Common\Inflector\Inflector::classify() instead
* @deprecated since sonata-project/admin-bundle 3.1. Use \Doctrine\Common\Inflector\Inflector::classify() instead
*/
public function camelize($property)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Admin/AdminInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public function hasParentFieldDescription();
*
* @return string the translated string
*
* @deprecated since 3.9, to be removed in 4.0
* @deprecated since sonata-project/admin-bundle 3.9, to be removed in 4.0
*/
public function trans($id, array $parameters = [], $domain = null, $locale = null);

Expand Down Expand Up @@ -459,7 +459,7 @@ public function isChild();
/**
* Returns template.
*
* @deprecated since 3.35. To be removed in 4.0. Use TemplateRegistry services instead
* @deprecated since sonata-project/admin-bundle 3.35. To be removed in 4.0. Use TemplateRegistry services instead
*
* @param string $name
*
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/BaseFieldDescription.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ public function getMappingType()
*
* @return string
*
* @deprecated Deprecated since version 3.1. Use \Doctrine\Common\Inflector\Inflector::classify() instead
* @deprecated since sonata-project/admin-bundle 3.1. Use \Doctrine\Common\Inflector\Inflector::classify() instead
*/
public static function camelize($property)
{
Expand Down
8 changes: 4 additions & 4 deletions src/Admin/Pool.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Pool
protected $adminClasses = [];

/**
* @deprecated since 3.34, will be dropped in 4.0. Use TemplateRegistry "sonata.admin.global_template_registry" instead
* @deprecated since sonata-project/admin-bundle 3.34, will be dropped in 4.0. Use TemplateRegistry "sonata.admin.global_template_registry" instead
*
* @var array
*/
Expand Down Expand Up @@ -412,7 +412,7 @@ final public function setTemplateRegistry(MutableTemplateRegistryInterface $temp
}

/**
* @deprecated since 3.34, will be dropped in 4.0. Use TemplateRegistry "sonata.admin.global_template_registry" instead
* @deprecated since sonata-project/admin-bundle 3.34, will be dropped in 4.0. Use TemplateRegistry "sonata.admin.global_template_registry" instead
*/
public function setTemplates(array $templates)
{
Expand All @@ -423,7 +423,7 @@ public function setTemplates(array $templates)
}

/**
* @deprecated since 3.34, will be dropped in 4.0. Use TemplateRegistry "sonata.admin.global_template_registry" instead
* @deprecated since sonata-project/admin-bundle 3.34, will be dropped in 4.0. Use TemplateRegistry "sonata.admin.global_template_registry" instead
*
* @return array
*/
Expand All @@ -433,7 +433,7 @@ public function getTemplates()
}

/**
* @deprecated since 3.34, will be dropped in 4.0. Use TemplateRegistry "sonata.admin.global_template_registry" instead
* @deprecated since sonata-project/admin-bundle 3.34, will be dropped in 4.0. Use TemplateRegistry "sonata.admin.global_template_registry" instead
*
* @param string $name
*
Expand Down
8 changes: 4 additions & 4 deletions src/Controller/CRUDController.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function setContainer(ContainerInterface $container = null)
*
* @return Response A Response instance
*
* @deprecated since version 3.27, to be removed in 4.0. Use Sonata\AdminBundle\Controller\CRUDController::renderWithExtraParams() instead.
* @deprecated since sonata-project/admin-bundle 3.27, to be removed in 4.0. Use Sonata\AdminBundle\Controller\CRUDController::renderWithExtraParams() instead.
*/
public function render($view, array $parameters = [], Response $response = null)
{
Expand Down Expand Up @@ -701,7 +701,7 @@ public function showAction($id = null)
if (!\is_array($fields->getElements()) || 0 === $fields->count()) {
@trigger_error(
'Calling this method without implementing "configureShowFields"'
.' is not supported since 3.40.0'
.' is not supported since sonata-project/admin-bundle 3.40.0'
.' and will no longer be possible in 4.0',
E_USER_DEPRECATED
);
Expand Down Expand Up @@ -1549,8 +1549,8 @@ private function checkParentChildAssociation(Request $request, $object): void

if ($parentAdmin->getObject($parentId) !== $propertyAccessor->getValue($object, $propertyPath)) {
// NEXT_MAJOR: make this exception
@trigger_error("Accessing a child that isn't connected to a given parent is deprecated since 3.34"
." and won't be allowed in 4.0.",
@trigger_error("Accessing a child that isn't connected to a given parent is"
." deprecated since sonata-project/admin-bundle 3.34 and won't be allowed in 4.0.",
E_USER_DEPRECATED
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/CoreController.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function searchAction(Request $request)
*
* NEXT_MAJOR: remove this method.
*
* @deprecated since 3.0, to be removed in 4.0 and action methods will be adjusted.
* @deprecated since sonata-project/admin-bundle 3.0, to be removed in 4.0 and action methods will be adjusted.
* Use Symfony\Component\HttpFoundation\Request as an action argument
*
* @return Request
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/HelperController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
/**
* NEXT_MAJOR: remove this class.
*
* @deprecated since version 3.38.0, to be removed in 4.0. Use actions inside Sonata\AdminBundle\Action instead.
* @deprecated since sonata-project/admin-bundle 3.38.0, to be removed in 4.0. Use actions inside Sonata\AdminBundle\Action instead.
*
* @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Datagrid/Pager.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public function getFirstIndex()
/**
* NEXT_MAJOR: remove this method.
*
* @deprecated since 3.11, will be removed in 4.0
* @deprecated since sonata-project/admin-bundle 3.11, will be removed in 4.0
*/
public function getFirstIndice()
{
Expand Down Expand Up @@ -294,7 +294,7 @@ public function getLastIndex()
/**
* NEXT_MAJOR: remove this method.
*
* @deprecated since 3.11, will be removed in 4.0
* @deprecated since sonata-project/admin-bundle 3.11, will be removed in 4.0
*/
public function getLastIndice()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Form/ChoiceList/ModelChoiceList.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
/**
* NEXT_MAJOR: Remove this class.
*
* @deprecated Since 3.24, to be removed in 4.0. Use Sonata\AdminBundle\ModelChoiceLoader instead
* @deprecated since sonata-project/admin-bundle 3.24, to be removed in 4.0. Use Sonata\AdminBundle\ModelChoiceLoader instead
*
* @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
* This class should be used with Symfony <2.7 only and will be deprecated with 3.0.
*
* @deprecated Since 3.11, to be removed in 4.0. Use Sonata\AdminBundle\Form\DataTransformer\ModelsToArrayTransformer instead.
* @deprecated since sonata-project/admin-bundle 3.11, to be removed in 4.0. Use Sonata\AdminBundle\Form\DataTransformer\ModelsToArrayTransformer instead.
*
* @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Form/DataTransformer/ModelsToArrayTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ModelsToArrayTransformer implements DataTransformerInterface
/**
* @var ModelChoiceList
*
* @deprecated since 3.12, to be removed in 4.0
* @deprecated since sonata-project/admin-bundle 3.12, to be removed in 4.0
* NEXT_MAJOR: remove this property
*/
protected $choiceList;
Expand Down
2 changes: 1 addition & 1 deletion src/Form/Type/Filter/ChoiceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ChoiceType extends AbstractType
/**
* NEXT_MAJOR: remove this property.
*
* @deprecated since 3.5, to be removed with 4.0
* @deprecated since sonata-project/admin-bundle 3.5, to be removed with 4.0
*
* @var TranslatorInterface
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Form/Type/Filter/DateRangeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class DateRangeType extends AbstractType
/**
* NEXT_MAJOR: remove this property.
*
* @deprecated since 3.5, to be removed with 4.0
* @deprecated since sonata-project/admin-bundle 3.5, to be removed with 4.0
*
* @var TranslatorInterface
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Form/Type/Filter/DateTimeRangeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class DateTimeRangeType extends AbstractType
/**
* NEXT_MAJOR: remove this property.
*
* @deprecated since 3.5, to be removed with 4.0
* @deprecated since sonata-project/admin-bundle 3.5, to be removed with 4.0
*
* @var TranslatorInterface
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Form/Type/Filter/DateTimeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class DateTimeType extends AbstractType
/**
* NEXT_MAJOR: remove this property.
*
* @deprecated since 3.5, to be removed with 4.0
* @deprecated since sonata-project/admin-bundle 3.5, to be removed with 4.0
*
* @var TranslatorInterface
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Form/Type/Filter/DateType.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class DateType extends AbstractType
/**
* NEXT_MAJOR: remove this property.
*
* @deprecated since 3.5, to be removed with 4.0
* @deprecated since sonata-project/admin-bundle 3.5, to be removed with 4.0
*
* @var TranslatorInterface
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Form/Type/Filter/NumberType.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class NumberType extends AbstractType
/**
* NEXT_MAJOR: remove this property.
*
* @deprecated since 3.5, to be removed with 4.0
* @deprecated since sonata-project/admin-bundle 3.5, to be removed with 4.0
*
* @var TranslatorInterface
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Form/Type/ModelTypeList.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*
* NEXT_MAJOR: remove this class.
*
* @deprecated since version 3.5, to be removed in 4.0. Use ModelListType instead
* @deprecated since sonata-project/admin-bundle 3.5, to be removed in 4.0. Use ModelListType instead
*/
class ModelTypeList extends ModelListType
{
Expand Down
2 changes: 1 addition & 1 deletion src/Generator/AdminGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* @final since sonata-project/admin-bundle 3.52
*
* @deprecated Since 3.56, to be removed when dropping Symfony < 4.2 support. Use Maker Bundle instead.
* @deprecated since sonata-project/admin-bundle 3.56, to be removed when dropping Symfony < 4.2 support. Use Maker Bundle instead.
*
* @author Marek Stipek <mario.dweller@seznam.cz>
* @author Simon Cosandey <simon.cosandey@simseo.ch>
Expand Down
2 changes: 1 addition & 1 deletion src/Generator/ControllerGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* @final since sonata-project/admin-bundle 3.52
*
* @deprecated Since 3.56, to be removed when dropping Symfony < 4.2 support. Use Maker Bundle instead.
* @deprecated since sonata-project/admin-bundle 3.56, to be removed when dropping Symfony < 4.2 support. Use Maker Bundle instead.
*
* @author Marek Stipek <mario.dweller@seznam.cz>
* @author Simon Cosandey <simon.cosandey@simseo.ch>
Expand Down
2 changes: 1 addition & 1 deletion src/Menu/Matcher/Voter/AdminVoter.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct(RequestStack $requestStack = null)
}

/**
* @deprecated since version 3.31. Pass a RequestStack to the constructor instead.
* @deprecated since sonata-project/admin-bundle 3.31. Pass a RequestStack to the constructor instead.
*
* @return $this
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Menu/Matcher/Voter/ChildrenVoter.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*
* @author Samusev Andrey <andrey.simfi@ya.ru>
*
* @deprecated since 3.28, will be removed in 4.0.
* @deprecated since sonata-project/admin-bundle 3.28, will be removed in 4.0.
*/
class ChildrenVoter implements VoterInterface
{
Expand Down
Loading

0 comments on commit 51b8c2e

Please sign in to comment.