minor #22757 [Security][Serializer][DI] Add new arguments typehints in preparation for 4.0 (ogizanagi)
This PR was merged into the 3.3 branch.
Discussion
----------
[Security][Serializer][DI] Add new arguments typehints in preparation for 4.0
| Q | A
| ------------- | ---
| Branch? | 3.3
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/22743#pullrequestreview-38950305
| License | MIT
| Doc PR | N/A
See https://github.com/symfony/symfony/pull/22743#pullrequestreview-38950305 discussion for the motivations.
Commits
-------
b973b30
[Security][Serializer][DI] Add new arguments typehints in preparation for 4.0
This commit is contained in:
commit
a0364bc3eb
@ -303,7 +303,7 @@ Security
|
||||
* The `RoleInterface` has been deprecated. Extend the `Symfony\Component\Security\Core\Role\Role`
|
||||
class in your custom role implementations instead.
|
||||
|
||||
* The `LogoutUrlGenerator::registerListener()` method will expect a 6th `$context = null` argument in 4.0.
|
||||
* The `LogoutUrlGenerator::registerListener()` method will expect a 6th `string $context = null` argument in 4.0.
|
||||
Define the argument when overriding this method.
|
||||
|
||||
* The `AccessDecisionManager::setVoters()` method has been deprecated. Pass
|
||||
|
@ -426,7 +426,7 @@ Security
|
||||
* The `RoleInterface` has been removed. Extend the `Symfony\Component\Security\Core\Role\Role`
|
||||
class instead.
|
||||
|
||||
* The `LogoutUrlGenerator::registerListener()` method expects a 6th `$context = null` argument.
|
||||
* The `LogoutUrlGenerator::registerListener()` method expects a 6th `string $context = null` argument.
|
||||
|
||||
* The `AccessDecisionManager::setVoters()` method has been removed. Pass the
|
||||
voters to the constructor instead.
|
||||
|
@ -77,7 +77,7 @@ class Compiler
|
||||
* @param string $type The type of the pass
|
||||
* @param int $priority Used to sort the passes
|
||||
*/
|
||||
public function addPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION/*, $priority = 0*/)
|
||||
public function addPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION/*, int $priority = 0*/)
|
||||
{
|
||||
if (func_num_args() >= 3) {
|
||||
$priority = func_get_arg(2);
|
||||
@ -85,7 +85,7 @@ class Compiler
|
||||
if (__CLASS__ !== get_class($this)) {
|
||||
$r = new \ReflectionMethod($this, __FUNCTION__);
|
||||
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
|
||||
@trigger_error(sprintf('Method %s() will have a third `$priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', __METHOD__), E_USER_DEPRECATED);
|
||||
@trigger_error(sprintf('Method %s() will have a third `int $priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', __METHOD__), E_USER_DEPRECATED);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ class PassConfig
|
||||
*
|
||||
* @throws InvalidArgumentException when a pass type doesn't exist
|
||||
*/
|
||||
public function addPass(CompilerPassInterface $pass, $type = self::TYPE_BEFORE_OPTIMIZATION/*, $priority = 0*/)
|
||||
public function addPass(CompilerPassInterface $pass, $type = self::TYPE_BEFORE_OPTIMIZATION/*, int $priority = 0*/)
|
||||
{
|
||||
if (func_num_args() >= 3) {
|
||||
$priority = func_get_arg(2);
|
||||
@ -116,7 +116,7 @@ class PassConfig
|
||||
if (__CLASS__ !== get_class($this)) {
|
||||
$r = new \ReflectionMethod($this, __FUNCTION__);
|
||||
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
|
||||
@trigger_error(sprintf('Method %s() will have a third `$priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', __METHOD__), E_USER_DEPRECATED);
|
||||
@trigger_error(sprintf('Method %s() will have a third `int $priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', __METHOD__), E_USER_DEPRECATED);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ class ServiceReferenceGraph
|
||||
* @param string $reference
|
||||
* @param bool $lazy
|
||||
*/
|
||||
public function connect($sourceId, $sourceValue, $destId, $destValue = null, $reference = null/*, $lazy = false*/)
|
||||
public function connect($sourceId, $sourceValue, $destId, $destValue = null, $reference = null/*, bool $lazy = false*/)
|
||||
{
|
||||
if (func_num_args() >= 6) {
|
||||
$lazy = func_get_arg(5);
|
||||
@ -94,7 +94,7 @@ class ServiceReferenceGraph
|
||||
if (__CLASS__ !== get_class($this)) {
|
||||
$r = new \ReflectionMethod($this, __FUNCTION__);
|
||||
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
|
||||
@trigger_error(sprintf('Method %s() will have a 6th `$lazy = false` argument in version 4.0. Not defining it is deprecated since 3.3.', __METHOD__), E_USER_DEPRECATED);
|
||||
@trigger_error(sprintf('Method %s() will have a 6th `bool $lazy = false` argument in version 4.0. Not defining it is deprecated since 3.3.', __METHOD__), E_USER_DEPRECATED);
|
||||
}
|
||||
}
|
||||
$lazy = false;
|
||||
|
@ -448,7 +448,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION/*, $priority = 0*/)
|
||||
public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION/*, int $priority = 0*/)
|
||||
{
|
||||
if (func_num_args() >= 3) {
|
||||
$priority = func_get_arg(2);
|
||||
@ -456,7 +456,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
if (__CLASS__ !== get_class($this)) {
|
||||
$r = new \ReflectionMethod($this, __FUNCTION__);
|
||||
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
|
||||
@trigger_error(sprintf('Method %s() will have a third `$priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', __METHOD__), E_USER_DEPRECATED);
|
||||
@trigger_error(sprintf('Method %s() will have a third `int $priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', __METHOD__), E_USER_DEPRECATED);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ class LogoutUrlGenerator
|
||||
* @param CsrfTokenManagerInterface|null $csrfTokenManager A CsrfTokenManagerInterface instance
|
||||
* @param string|null $context The listener context
|
||||
*/
|
||||
public function registerListener($key, $logoutPath, $csrfTokenId, $csrfParameter, CsrfTokenManagerInterface $csrfTokenManager = null/*, $context = null*/)
|
||||
public function registerListener($key, $logoutPath, $csrfTokenId, $csrfParameter, CsrfTokenManagerInterface $csrfTokenManager = null/*, string $context = null*/)
|
||||
{
|
||||
if (func_num_args() >= 6) {
|
||||
$context = func_get_arg(5);
|
||||
@ -56,7 +56,7 @@ class LogoutUrlGenerator
|
||||
if (__CLASS__ !== get_class($this)) {
|
||||
$r = new \ReflectionMethod($this, __FUNCTION__);
|
||||
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
|
||||
@trigger_error(sprintf('Method %s() will have a sixth `$context = null` argument in version 4.0. Not defining it is deprecated since 3.3.', __METHOD__), E_USER_DEPRECATED);
|
||||
@trigger_error(sprintf('Method %s() will have a sixth `string $context = null` argument in version 4.0. Not defining it is deprecated since 3.3.', __METHOD__), E_USER_DEPRECATED);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -302,7 +302,7 @@ abstract class AbstractNormalizer extends SerializerAwareNormalizer implements N
|
||||
*
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
protected function instantiateObject(array &$data, $class, array &$context, \ReflectionClass $reflectionClass, $allowedAttributes/*, $format = null*/)
|
||||
protected function instantiateObject(array &$data, $class, array &$context, \ReflectionClass $reflectionClass, $allowedAttributes/*, string $format = null*/)
|
||||
{
|
||||
if (func_num_args() >= 6) {
|
||||
$format = func_get_arg(5);
|
||||
@ -310,7 +310,7 @@ abstract class AbstractNormalizer extends SerializerAwareNormalizer implements N
|
||||
if (__CLASS__ !== get_class($this)) {
|
||||
$r = new \ReflectionMethod($this, __FUNCTION__);
|
||||
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
|
||||
@trigger_error(sprintf('Method %s::%s() will have a 6th `$format = null` argument in version 4.0. Not defining it is deprecated since 3.2.', get_class($this), __FUNCTION__), E_USER_DEPRECATED);
|
||||
@trigger_error(sprintf('Method %s::%s() will have a 6th `string $format = null` argument in version 4.0. Not defining it is deprecated since 3.2.', get_class($this), __FUNCTION__), E_USER_DEPRECATED);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user