minor #32866 Sync "not implementing the method" deprecations messages (fancyweb)
This PR was merged into the 4.3 branch.
Discussion
----------
Sync "not implementing the method" deprecations messages
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Suggested in https://github.com/symfony/symfony/pull/32747#discussion_r309307289
Useful for consistency and for future reference for similar messages.
Commits
-------
f6fae1c361
Sync "not implementing the method" deprecations messages
This commit is contained in:
commit
8ea304da41
@ -364,7 +364,7 @@ abstract class NodeDefinition implements NodeParentInterface
|
|||||||
$child->setPathSeparator($separator);
|
$child->setPathSeparator($separator);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@trigger_error('Passing a ParentNodeDefinitionInterface without getChildNodeDefinitions() is deprecated since Symfony 4.1.', E_USER_DEPRECATED);
|
@trigger_error(sprintf('Not implementing the "%s::getChildNodeDefinitions()" method in "%s" is deprecated since Symfony 4.1.', ParentNodeDefinitionInterface::class, \get_class($this)), E_USER_DEPRECATED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ abstract class AbstractExtension implements FormExtensionInterface
|
|||||||
$extendedTypes[] = $extendedType;
|
$extendedTypes[] = $extendedType;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@trigger_error(sprintf('Not implementing the static getExtendedTypes() method in %s when implementing the %s is deprecated since Symfony 4.2. The method will be added to the interface in 5.0.', \get_class($extension), FormTypeExtensionInterface::class), E_USER_DEPRECATED);
|
@trigger_error(sprintf('Not implementing the "%s::getExtendedTypes()" method in "%s" is deprecated since Symfony 4.2.', FormTypeExtensionInterface::class, \get_class($extension)), E_USER_DEPRECATED);
|
||||||
|
|
||||||
$extendedTypes = [$extension->getExtendedType()];
|
$extendedTypes = [$extension->getExtendedType()];
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ class FormPass implements CompilerPassInterface
|
|||||||
|
|
||||||
if (isset($tag[0]['extended_type'])) {
|
if (isset($tag[0]['extended_type'])) {
|
||||||
if (!method_exists($typeExtensionClass, 'getExtendedTypes')) {
|
if (!method_exists($typeExtensionClass, 'getExtendedTypes')) {
|
||||||
@trigger_error(sprintf('Not implementing the static getExtendedTypes() method in %s when implementing the %s is deprecated since Symfony 4.2. The method will be added to the interface in 5.0.', $typeExtensionClass, FormTypeExtensionInterface::class), E_USER_DEPRECATED);
|
@trigger_error(sprintf('Not implementing the "%s::getExtendedTypes()" method in "%s" is deprecated since Symfony 4.2.', FormTypeExtensionInterface::class, $typeExtensionClass), E_USER_DEPRECATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
$typeExtensions[$tag[0]['extended_type']][] = new Reference($serviceId);
|
$typeExtensions[$tag[0]['extended_type']][] = new Reference($serviceId);
|
||||||
|
@ -36,7 +36,7 @@ class PreloadedExtension implements FormExtensionInterface
|
|||||||
foreach ($typeExtensions as $extensions) {
|
foreach ($typeExtensions as $extensions) {
|
||||||
foreach ($extensions as $typeExtension) {
|
foreach ($extensions as $typeExtension) {
|
||||||
if (!method_exists($typeExtension, 'getExtendedTypes')) {
|
if (!method_exists($typeExtension, 'getExtendedTypes')) {
|
||||||
@trigger_error(sprintf('Not implementing the static getExtendedTypes() method in %s when implementing the %s is deprecated since Symfony 4.2. The method will be added to the interface in 5.0.', \get_class($typeExtension), FormTypeExtensionInterface::class), E_USER_DEPRECATED);
|
@trigger_error(sprintf('Not implementing the "%s::getExtendedTypes()" method in "%s" is deprecated since Symfony 4.2.', FormTypeExtensionInterface::class, \get_class($typeExtension)), E_USER_DEPRECATED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ class TokenStorage implements TokenStorageInterface, ResetInterface
|
|||||||
public function setToken(TokenInterface $token = null)
|
public function setToken(TokenInterface $token = null)
|
||||||
{
|
{
|
||||||
if (null !== $token && !method_exists($token, 'getRoleNames')) {
|
if (null !== $token && !method_exists($token, 'getRoleNames')) {
|
||||||
@trigger_error(sprintf('Not implementing the getRoleNames() method in %s which implements %s is deprecated since Symfony 4.3.', \get_class($token), TokenInterface::class), E_USER_DEPRECATED);
|
@trigger_error(sprintf('Not implementing the "%s::getRoleNames()" method in "%s" is deprecated since Symfony 4.3.', TokenInterface::class, \get_class($token)), E_USER_DEPRECATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->token = $token;
|
$this->token = $token;
|
||||||
|
@ -44,7 +44,7 @@ class ExpressionVoter implements VoterInterface
|
|||||||
$authChecker = null;
|
$authChecker = null;
|
||||||
|
|
||||||
if (!method_exists($roleHierarchy, 'getReachableRoleNames')) {
|
if (!method_exists($roleHierarchy, 'getReachableRoleNames')) {
|
||||||
@trigger_error(sprintf('Not implementing the getReachableRoleNames() method in %s which implements %s is deprecated since Symfony 4.3.', \get_class($this->roleHierarchy), RoleHierarchyInterface::class), E_USER_DEPRECATED);
|
@trigger_error(sprintf('Not implementing the "%s::getReachableRoleNames()" method in "%s" is deprecated since Symfony 4.3.', RoleHierarchyInterface::class, \get_class($this->roleHierarchy)), E_USER_DEPRECATED);
|
||||||
}
|
}
|
||||||
} elseif (null === $authChecker) {
|
} elseif (null === $authChecker) {
|
||||||
@trigger_error(sprintf('Argument 3 passed to "%s()" should be an instance of AuthorizationCheckerInterface, not passing it is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
|
@trigger_error(sprintf('Argument 3 passed to "%s()" should be an instance of AuthorizationCheckerInterface, not passing it is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
|
||||||
@ -99,7 +99,7 @@ class ExpressionVoter implements VoterInterface
|
|||||||
$roleNames = $token->getRoleNames();
|
$roleNames = $token->getRoleNames();
|
||||||
$roles = array_map(function (string $role) { return new Role($role, false); }, $roleNames);
|
$roles = array_map(function (string $role) { return new Role($role, false); }, $roleNames);
|
||||||
} else {
|
} else {
|
||||||
@trigger_error(sprintf('Not implementing the getRoleNames() method in %s which implements %s is deprecated since Symfony 4.3.', \get_class($token), TokenInterface::class), E_USER_DEPRECATED);
|
@trigger_error(sprintf('Not implementing the "%s::getRoleNames()" method in "%s" is deprecated since Symfony 4.3.', TokenInterface::class, \get_class($token)), E_USER_DEPRECATED);
|
||||||
|
|
||||||
$roles = $token->getRoles(false);
|
$roles = $token->getRoles(false);
|
||||||
$roleNames = array_map(function (Role $role) { return $role->getRole(); }, $roles);
|
$roleNames = array_map(function (Role $role) { return $role->getRole(); }, $roles);
|
||||||
|
@ -29,7 +29,7 @@ class RoleHierarchyVoter extends RoleVoter
|
|||||||
public function __construct(RoleHierarchyInterface $roleHierarchy, string $prefix = 'ROLE_')
|
public function __construct(RoleHierarchyInterface $roleHierarchy, string $prefix = 'ROLE_')
|
||||||
{
|
{
|
||||||
if (!method_exists($roleHierarchy, 'getReachableRoleNames')) {
|
if (!method_exists($roleHierarchy, 'getReachableRoleNames')) {
|
||||||
@trigger_error(sprintf('Not implementing the getReachableRoleNames() method in %s which implements %s is deprecated since Symfony 4.3.', \get_class($roleHierarchy), RoleHierarchyInterface::class), E_USER_DEPRECATED);
|
@trigger_error(sprintf('Not implementing the "%s::getReachableRoleNames()" method in "%s" is deprecated since Symfony 4.3.', RoleHierarchyInterface::class, \get_class($roleHierarchy)), E_USER_DEPRECATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->roleHierarchy = $roleHierarchy;
|
$this->roleHierarchy = $roleHierarchy;
|
||||||
@ -46,7 +46,7 @@ class RoleHierarchyVoter extends RoleVoter
|
|||||||
if (method_exists($token, 'getRoleNames')) {
|
if (method_exists($token, 'getRoleNames')) {
|
||||||
$roles = $token->getRoleNames();
|
$roles = $token->getRoleNames();
|
||||||
} else {
|
} else {
|
||||||
@trigger_error(sprintf('Not implementing the getRoleNames() method in %s which implements %s is deprecated since Symfony 4.3.', \get_class($token), TokenInterface::class), E_USER_DEPRECATED);
|
@trigger_error(sprintf('Not implementing the "%s::getRoleNames()" method in "%s" is deprecated since Symfony 4.3.', TokenInterface::class, \get_class($token)), E_USER_DEPRECATED);
|
||||||
|
|
||||||
$roles = array_map(function (Role $role) { return $role->getRole(); }, $token->getRoles(false));
|
$roles = array_map(function (Role $role) { return $role->getRole(); }, $token->getRoles(false));
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ class RoleVoter implements VoterInterface
|
|||||||
return $token->getRoleNames();
|
return $token->getRoleNames();
|
||||||
}
|
}
|
||||||
|
|
||||||
@trigger_error(sprintf('Not implementing the getRoleNames() method in %s which implements %s is deprecated since Symfony 4.3.', \get_class($token), TokenInterface::class), E_USER_DEPRECATED);
|
@trigger_error(sprintf('Not implementing the "%s::getRoleNames()" method in "%s" is deprecated since Symfony 4.3.', TokenInterface::class, \get_class($token)), E_USER_DEPRECATED);
|
||||||
|
|
||||||
return array_map(function (Role $role) { return $role->getRole(); }, $token->getRoles(false));
|
return array_map(function (Role $role) { return $role->getRole(); }, $token->getRoles(false));
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ class GuardListener
|
|||||||
public function __construct(array $configuration, ExpressionLanguage $expressionLanguage, TokenStorageInterface $tokenStorage, AuthorizationCheckerInterface $authorizationChecker, AuthenticationTrustResolverInterface $trustResolver, RoleHierarchyInterface $roleHierarchy = null, ValidatorInterface $validator = null)
|
public function __construct(array $configuration, ExpressionLanguage $expressionLanguage, TokenStorageInterface $tokenStorage, AuthorizationCheckerInterface $authorizationChecker, AuthenticationTrustResolverInterface $trustResolver, RoleHierarchyInterface $roleHierarchy = null, ValidatorInterface $validator = null)
|
||||||
{
|
{
|
||||||
if (null !== $roleHierarchy && !method_exists($roleHierarchy, 'getReachableRoleNames')) {
|
if (null !== $roleHierarchy && !method_exists($roleHierarchy, 'getReachableRoleNames')) {
|
||||||
@trigger_error(sprintf('Not implementing the getReachableRoleNames() method in %s which implements %s is deprecated since Symfony 4.3.', \get_class($roleHierarchy), RoleHierarchyInterface::class), E_USER_DEPRECATED);
|
@trigger_error(sprintf('Not implementing the "%s::getReachableRoleNames()" method in "%s" is deprecated since Symfony 4.3.', RoleHierarchyInterface::class, \get_class($roleHierarchy)), E_USER_DEPRECATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->configuration = $configuration;
|
$this->configuration = $configuration;
|
||||||
@ -90,7 +90,7 @@ class GuardListener
|
|||||||
$roleNames = $token->getRoleNames();
|
$roleNames = $token->getRoleNames();
|
||||||
$roles = array_map(function (string $role) { return new Role($role, false); }, $roleNames);
|
$roles = array_map(function (string $role) { return new Role($role, false); }, $roleNames);
|
||||||
} else {
|
} else {
|
||||||
@trigger_error(sprintf('Not implementing the getRoleNames() method in %s which implements %s is deprecated since Symfony 4.3.', \get_class($token), TokenInterface::class), E_USER_DEPRECATED);
|
@trigger_error(sprintf('Not implementing the "%s::getRoleNames()" method in "%s" is deprecated since Symfony 4.3.', TokenInterface::class, \get_class($token)), E_USER_DEPRECATED);
|
||||||
|
|
||||||
$roles = $token->getRoles(false);
|
$roles = $token->getRoles(false);
|
||||||
$roleNames = array_map(function (Role $role) { return $role->getRole(); }, $roles);
|
$roleNames = array_map(function (Role $role) { return $role->getRole(); }, $roles);
|
||||||
|
Reference in New Issue
Block a user