Skip to content

Commit 9d2b089

Browse files
Add type to final/internal public/protected properties
1 parent 6313164 commit 9d2b089

File tree

5 files changed

+7
-17
lines changed

5 files changed

+7
-17
lines changed

Attribute/Target.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@
2121
#[\Attribute(\Attribute::TARGET_PARAMETER)]
2222
final class Target
2323
{
24-
/**
25-
* @var string
26-
*/
27-
public $name;
24+
public string $name;
2825

2926
public function __construct(string $name)
3027
{

Definition.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ class Definition
5252
*
5353
* Used to store the name of the inner id when using service decoration together with autowiring
5454
*/
55-
public $innerServiceId;
55+
public ?string $innerServiceId = null;
5656

5757
/**
5858
* @internal
5959
*
6060
* Used to store the behavior to follow when using service decoration and the decorated service is invalid
6161
*/
62-
public $decorationOnInvalid;
62+
public ?int $decorationOnInvalid = null;
6363

6464
public function __construct(string $class = null, array $arguments = [])
6565
{

Loader/Configurator/AbstractConfigurator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
1313

1414
use Symfony\Component\Config\Loader\ParamConfigurator;
15+
use Symfony\Component\DependencyInjection\Alias;
1516
use Symfony\Component\DependencyInjection\Argument\AbstractArgument;
1617
use Symfony\Component\DependencyInjection\Argument\ArgumentInterface;
1718
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
@@ -31,7 +32,7 @@ abstract class AbstractConfigurator
3132
public static $valuePreProcessor;
3233

3334
/** @internal */
34-
protected $definition;
35+
protected Definition|Alias|null $definition = null;
3536

3637
public function __call(string $method, array $args)
3738
{

Loader/Configurator/ReferenceConfigurator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
class ReferenceConfigurator extends AbstractConfigurator
2020
{
2121
/** @internal */
22-
protected $id;
22+
protected string $id;
2323

2424
/** @internal */
25-
protected $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE;
25+
protected int $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE;
2626

2727
public function __construct(string $id)
2828
{

Tests/Fixtures/php/services_new_in_initializer.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,6 @@ public function isCompiled(): bool
3636
return true;
3737
}
3838

39-
public function getRemovedIds(): array
40-
{
41-
return [
42-
'Psr\\Container\\ContainerInterface' => true,
43-
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
44-
];
45-
}
46-
4739
/**
4840
* Gets the public 'foo' shared autowired service.
4941
*

0 commit comments

Comments
 (0)