Skip to content

Commit 377f5ed

Browse files
committed
[FrameworkBundle] Added type declarations where possible.
1 parent 5d8580b commit 377f5ed

File tree

7 files changed

+10
-22
lines changed

7 files changed

+10
-22
lines changed

src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AbstractPhpFileCacheWarmer.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,7 @@ protected function warmUpPhpArrayAdapter(PhpArrayAdapter $phpArrayAdapter, array
6969
}
7070

7171
/**
72-
* @param string $cacheDir
73-
* @param ArrayAdapter $arrayAdapter
74-
*
7572
* @return bool false if there is nothing to warm-up
7673
*/
77-
abstract protected function doWarmUp($cacheDir, ArrayAdapter $arrayAdapter);
74+
abstract protected function doWarmUp(string $cacheDir, ArrayAdapter $arrayAdapter);
7875
}

src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AnnotationsCacheWarmer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(Reader $annotationReader, string $phpArrayFile, stri
4343
/**
4444
* {@inheritdoc}
4545
*/
46-
protected function doWarmUp($cacheDir, ArrayAdapter $arrayAdapter)
46+
protected function doWarmUp(string $cacheDir, ArrayAdapter $arrayAdapter)
4747
{
4848
$annotatedClassPatterns = $cacheDir.'/annotations.map';
4949

@@ -77,7 +77,7 @@ protected function doWarmUp($cacheDir, ArrayAdapter $arrayAdapter)
7777
return true;
7878
}
7979

80-
private function readAllComponents(Reader $reader, $class)
80+
private function readAllComponents(Reader $reader, string $class)
8181
{
8282
$reflectionClass = new \ReflectionClass($class);
8383
$reader->getClassAnnotations($reflectionClass);

src/Symfony/Bundle/FrameworkBundle/CacheWarmer/SerializerCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct(array $loaders, string $phpArrayFile)
4242
/**
4343
* {@inheritdoc}
4444
*/
45-
protected function doWarmUp($cacheDir, ArrayAdapter $arrayAdapter)
45+
protected function doWarmUp(string $cacheDir, ArrayAdapter $arrayAdapter)
4646
{
4747
if (!class_exists(CacheClassMetadataFactory::class) || !method_exists(XmlFileLoader::class, 'getMappedClasses') || !method_exists(YamlFileLoader::class, 'getMappedClasses')) {
4848
return false;

src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ValidatorCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(ValidatorBuilder $validatorBuilder, string $phpArray
4343
/**
4444
* {@inheritdoc}
4545
*/
46-
protected function doWarmUp($cacheDir, ArrayAdapter $arrayAdapter)
46+
protected function doWarmUp(string $cacheDir, ArrayAdapter $arrayAdapter)
4747
{
4848
if (!method_exists($this->validatorBuilder, 'getLoaders')) {
4949
return false;

src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected function listBundles($output)
5555
/**
5656
* @return ExtensionInterface
5757
*/
58-
protected function findExtension($name)
58+
protected function findExtension(string $name)
5959
{
6060
$bundles = $this->initializeBundles();
6161
$minScore = INF;

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,8 @@ protected function getOutput()
9696

9797
/**
9898
* Writes content to output.
99-
*
100-
* @param string $content
101-
* @param bool $decorated
10299
*/
103-
protected function write($content, $decorated = false)
100+
protected function write(string $content, bool $decorated = false)
104101
{
105102
$this->output->write($content, false, $decorated ? OutputInterface::OUTPUT_NORMAL : OutputInterface::OUTPUT_RAW);
106103
}
@@ -224,12 +221,9 @@ protected function formatParameter($value)
224221
}
225222

226223
/**
227-
* @param ContainerBuilder $builder
228-
* @param string $serviceId
229-
*
230224
* @return mixed
231225
*/
232-
protected function resolveServiceDefinition(ContainerBuilder $builder, $serviceId)
226+
protected function resolveServiceDefinition(ContainerBuilder $builder, string $serviceId)
233227
{
234228
if ($builder->hasDefinition($serviceId)) {
235229
return $builder->getDefinition($serviceId);
@@ -249,12 +243,9 @@ protected function resolveServiceDefinition(ContainerBuilder $builder, $serviceI
249243
}
250244

251245
/**
252-
* @param ContainerBuilder $builder
253-
* @param bool $showHidden
254-
*
255246
* @return array
256247
*/
257-
protected function findDefinitionsByTag(ContainerBuilder $builder, $showHidden)
248+
protected function findDefinitionsByTag(ContainerBuilder $builder, bool $showHidden)
258249
{
259250
$definitions = [];
260251
$tags = $builder->findTags();

src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public function build(ContainerBuilder $container)
139139
}
140140
}
141141

142-
private function addCompilerPassIfExists(ContainerBuilder $container, $class, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION, $priority = 0)
142+
private function addCompilerPassIfExists(ContainerBuilder $container, string $class, string $type = PassConfig::TYPE_BEFORE_OPTIMIZATION, int $priority = 0)
143143
{
144144
$container->addResource(new ClassExistenceResource($class));
145145

0 commit comments

Comments
 (0)