Skip to content

Commit 7368d78

Browse files
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 | symfony/symfony#22743 (review) | License | MIT | Doc PR | N/A See symfony/symfony#22743 (review) discussion for the motivations. Commits ------- b973b30 [Security][Serializer][DI] Add new arguments typehints in preparation for 4.0
2 parents ae8dcab + 4311190 commit 7368d78

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

Compiler/Compiler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ public function getLoggingFormatter()
7777
* @param string $type The type of the pass
7878
* @param int $priority Used to sort the passes
7979
*/
80-
public function addPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION/*, $priority = 0*/)
80+
public function addPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION/*, int $priority = 0*/)
8181
{
8282
if (func_num_args() >= 3) {
8383
$priority = func_get_arg(2);
8484
} else {
8585
if (__CLASS__ !== get_class($this)) {
8686
$r = new \ReflectionMethod($this, __FUNCTION__);
8787
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
88-
@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);
88+
@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);
8989
}
9090
}
9191

Compiler/PassConfig.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ public function getPasses()
108108
*
109109
* @throws InvalidArgumentException when a pass type doesn't exist
110110
*/
111-
public function addPass(CompilerPassInterface $pass, $type = self::TYPE_BEFORE_OPTIMIZATION/*, $priority = 0*/)
111+
public function addPass(CompilerPassInterface $pass, $type = self::TYPE_BEFORE_OPTIMIZATION/*, int $priority = 0*/)
112112
{
113113
if (func_num_args() >= 3) {
114114
$priority = func_get_arg(2);
115115
} else {
116116
if (__CLASS__ !== get_class($this)) {
117117
$r = new \ReflectionMethod($this, __FUNCTION__);
118118
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
119-
@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);
119+
@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);
120120
}
121121
}
122122

Compiler/ServiceReferenceGraph.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ public function clear()
8686
* @param string $reference
8787
* @param bool $lazy
8888
*/
89-
public function connect($sourceId, $sourceValue, $destId, $destValue = null, $reference = null/*, $lazy = false*/)
89+
public function connect($sourceId, $sourceValue, $destId, $destValue = null, $reference = null/*, bool $lazy = false*/)
9090
{
9191
if (func_num_args() >= 6) {
9292
$lazy = func_get_arg(5);
9393
} else {
9494
if (__CLASS__ !== get_class($this)) {
9595
$r = new \ReflectionMethod($this, __FUNCTION__);
9696
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
97-
@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);
97+
@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);
9898
}
9999
}
100100
$lazy = false;

ContainerBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,15 +448,15 @@ public function loadFromExtension($extension, array $values = array())
448448
*
449449
* @return $this
450450
*/
451-
public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION/*, $priority = 0*/)
451+
public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION/*, int $priority = 0*/)
452452
{
453453
if (func_num_args() >= 3) {
454454
$priority = func_get_arg(2);
455455
} else {
456456
if (__CLASS__ !== get_class($this)) {
457457
$r = new \ReflectionMethod($this, __FUNCTION__);
458458
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
459-
@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);
459+
@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);
460460
}
461461
}
462462

0 commit comments

Comments
 (0)