Skip to content

Commit bf9d0d4

Browse files
derrabusnicolas-grekas
authored andcommitted
[FrameworkBundle] Add types to private properties
1 parent f712fce commit bf9d0d4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+149
-135
lines changed

CacheWarmer/AbstractPhpFileCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
abstract class AbstractPhpFileCacheWarmer implements CacheWarmerInterface
2121
{
22-
private $phpArrayFile;
22+
private string $phpArrayFile;
2323

2424
/**
2525
* @param string $phpArrayFile The PHP file where metadata are cached

CacheWarmer/AnnotationsCacheWarmer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
*/
2626
class AnnotationsCacheWarmer extends AbstractPhpFileCacheWarmer
2727
{
28-
private $annotationReader;
29-
private $excludeRegexp;
30-
private $debug;
28+
private Reader $annotationReader;
29+
private ?string $excludeRegexp;
30+
private bool $debug;
3131

3232
/**
3333
* @param string $phpArrayFile The PHP file where annotations are cached

CacheWarmer/CachePoolClearerCacheWarmer.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@
2525
*/
2626
final class CachePoolClearerCacheWarmer implements CacheWarmerInterface
2727
{
28-
private $poolClearer;
29-
private $pools;
28+
private Psr6CacheClearer $poolClearer;
29+
private array $pools;
3030

31+
/**
32+
* @param string[] $pools
33+
*/
3134
public function __construct(Psr6CacheClearer $poolClearer, array $pools = [])
3235
{
3336
$this->poolClearer = $poolClearer;

CacheWarmer/ConfigBuilderCacheWarmer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
*/
2929
class ConfigBuilderCacheWarmer implements CacheWarmerInterface
3030
{
31-
private $kernel;
32-
private $logger;
31+
private KernelInterface $kernel;
32+
private ?LoggerInterface $logger;
3333

3434
public function __construct(KernelInterface $kernel, LoggerInterface $logger = null)
3535
{

CacheWarmer/RouterCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*/
2727
class RouterCacheWarmer implements CacheWarmerInterface, ServiceSubscriberInterface
2828
{
29-
private $container;
29+
private ContainerInterface $container;
3030

3131
public function __construct(ContainerInterface $container)
3232
{

CacheWarmer/SerializerCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*/
2828
class SerializerCacheWarmer extends AbstractPhpFileCacheWarmer
2929
{
30-
private $loaders;
30+
private array $loaders;
3131

3232
/**
3333
* @param LoaderInterface[] $loaders The serializer metadata loaders

CacheWarmer/TranslationsCacheWarmer.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
*/
2525
class TranslationsCacheWarmer implements CacheWarmerInterface, ServiceSubscriberInterface
2626
{
27-
private $container;
28-
private $translator;
27+
private ContainerInterface $container;
28+
private TranslatorInterface $translator;
2929

3030
public function __construct(ContainerInterface $container)
3131
{
@@ -40,9 +40,7 @@ public function __construct(ContainerInterface $container)
4040
*/
4141
public function warmUp(string $cacheDir): array
4242
{
43-
if (null === $this->translator) {
44-
$this->translator = $this->container->get('translator');
45-
}
43+
$this->translator ??= $this->container->get('translator');
4644

4745
if ($this->translator instanceof WarmableInterface) {
4846
return (array) $this->translator->warmUp($cacheDir);

CacheWarmer/ValidatorCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*/
2929
class ValidatorCacheWarmer extends AbstractPhpFileCacheWarmer
3030
{
31-
private $validatorBuilder;
31+
private ValidatorBuilder $validatorBuilder;
3232

3333
/**
3434
* @param string $phpArrayFile The PHP file where metadata are cached

Command/AssetsInstallCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ class AssetsInstallCommand extends Command
4141
public const METHOD_ABSOLUTE_SYMLINK = 'absolute symlink';
4242
public const METHOD_RELATIVE_SYMLINK = 'relative symlink';
4343

44-
private $filesystem;
45-
private $projectDir;
44+
private Filesystem $filesystem;
45+
private string $projectDir;
4646

4747
public function __construct(Filesystem $filesystem, string $projectDir)
4848
{

Command/CacheClearCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
#[AsCommand(name: 'cache:clear', description: 'Clear the cache')]
3838
class CacheClearCommand extends Command
3939
{
40-
private $cacheClearer;
41-
private $filesystem;
40+
private CacheClearerInterface $cacheClearer;
41+
private Filesystem $filesystem;
4242

4343
public function __construct(CacheClearerInterface $cacheClearer, Filesystem $filesystem = null)
4444
{

0 commit comments

Comments
 (0)