@@ -1260,7 +1260,7 @@ Example of parent class, with which calling constructor later would fail:
1260
1260
/**
1261
1261
* @var int[] $params
1262
1262
*/
1263
- protected array $params;
1263
+ private array $params;
1264
1264
public function __construct(int $arg1)
1265
1265
{
1266
1266
$this->params = [$arg1];
@@ -1613,7 +1613,7 @@ Instead of:
1613
1613
<?php
1614
1614
class BadExample
1615
1615
{
1616
- protected string $name;
1616
+ private string $name;
1617
1617
public function setManagerName(string $name): self
1618
1618
{
1619
1619
$this->name = $name;
@@ -1878,7 +1878,7 @@ class Manager
1878
1878
/**
1879
1879
* @var ProviderInterface[]
1880
1880
*/
1881
- protected $providers = [];
1881
+ private $providers = [];
1882
1882
1883
1883
public function addProvider(ProviderInterface $provider, string $providerKey): self
1884
1884
{
@@ -2566,8 +2566,8 @@ use Doctrine\ORM\EntityManagerInterface;
2566
2566
2567
2567
class FooProcessor
2568
2568
{
2569
- protected EntityManagerInterface $entityManager;
2570
- protected RemoteServiceClient $remoteServiceClient;
2569
+ private EntityManagerInterface $entityManager;
2570
+ private RemoteServiceClient $remoteServiceClient;
2571
2571
2572
2572
public function __construct(EntityManagerInterface $entityManager, RemoteServiceClient $remoteServiceClient)
2573
2573
{
@@ -3131,22 +3131,22 @@ declare(strict_types=1);
3131
3131
3132
3132
class MainEntity
3133
3133
{
3134
- protected int $id;
3135
- protected string $type;
3134
+ private int $id;
3135
+ private string $type;
3136
3136
}
3137
3137
3138
3138
class SubEntity
3139
3139
{
3140
- protected int $id;
3141
- protected MainEntity $mainEntity;
3142
- protected string $subValue;
3140
+ private int $id;
3141
+ private MainEntity $mainEntity;
3142
+ private string $subValue;
3143
3143
}
3144
3144
3145
3145
class AnotherSubEntity
3146
3146
{
3147
- protected int $id;
3148
- protected MainEntity $mainEntity;
3149
- protected string $anotherSubValue;
3147
+ private int $id;
3148
+ private MainEntity $mainEntity;
3149
+ private string $anotherSubValue;
3150
3150
}
3151
3151
` ` `
3152
3152
@@ -3159,10 +3159,10 @@ declare(strict_types=1);
3159
3159
3160
3160
class Entity
3161
3161
{
3162
- protected int $id;
3163
- protected string $type;
3164
- protected string $subValue;
3165
- protected string $anotherSubValue;
3162
+ private int $id;
3163
+ private string $type;
3164
+ private string $subValue;
3165
+ private string $anotherSubValue;
3166
3166
}
3167
3167
` ` `
3168
3168
@@ -3179,11 +3179,11 @@ class Entity
3179
3179
}
3180
3180
class SubEntity extends Entity
3181
3181
{
3182
- protected string $subValue;
3182
+ private string $subValue;
3183
3183
}
3184
3184
class AnotherSubEntity extends Entity
3185
3185
{
3186
- protected string $anotherSubValue;
3186
+ private string $anotherSubValue;
3187
3187
}
3188
3188
` ` `
3189
3189
0 commit comments