Skip to content

Commit 381394d

Browse files
committed
minor #32786 add parameter type declarations to private methods (xabbuh)
This PR was merged into the 4.4 branch. Discussion ---------- add parameter type declarations to private methods | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- 1b2aaa4a06 add parameter type declarations to private methods
2 parents 6d5398a + 3bc8243 commit 381394d

File tree

6 files changed

+12
-14
lines changed

6 files changed

+12
-14
lines changed

CacheWarmer/TemplateFinder.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,9 @@ public function findAllTemplates()
7070
/**
7171
* Find templates in the given directory.
7272
*
73-
* @param string $dir The folder where to look for templates
74-
*
7573
* @return TemplateReferenceInterface[]
7674
*/
77-
private function findTemplatesInFolder($dir)
75+
private function findTemplatesInFolder(string $dir)
7876
{
7977
$templates = [];
8078

Command/TranslationDebugCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
295295
$io->table($headers, $rows);
296296
}
297297

298-
private function formatState($state): string
298+
private function formatState(int $state): string
299299
{
300300
if (self::MESSAGE_MISSING === $state) {
301301
return '<error> missing </error>';

Console/Descriptor/JsonDescriptor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ protected function describeEventDispatcherListeners(EventDispatcherInterface $ev
165165
*/
166166
protected function describeCallable($callable, array $options = [])
167167
{
168-
$this->writeData($this->getCallableData($callable, $options), $options);
168+
$this->writeData($this->getCallableData($callable), $options);
169169
}
170170

171171
/**
@@ -315,7 +315,7 @@ private function getEventDispatcherListenersData(EventDispatcherInterface $event
315315
return $data;
316316
}
317317

318-
private function getCallableData($callable, array $options = []): array
318+
private function getCallableData($callable): array
319319
{
320320
$data = [];
321321

@@ -386,7 +386,7 @@ private function getCallableData($callable, array $options = []): array
386386
throw new \InvalidArgumentException('Callable is not describable.');
387387
}
388388

389-
private function describeValue($value, $omitTags, $showArguments)
389+
private function describeValue($value, bool $omitTags, bool $showArguments)
390390
{
391391
if (\is_array($value)) {
392392
$data = [];

Console/Descriptor/TextDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ protected function describeCallable($callable, array $options = [])
503503
$this->writeText($this->formatCallable($callable), $options);
504504
}
505505

506-
private function renderEventListenerTable(EventDispatcherInterface $eventDispatcher, $event, array $eventListeners, SymfonyStyle $io)
506+
private function renderEventListenerTable(EventDispatcherInterface $eventDispatcher, string $event, array $eventListeners, SymfonyStyle $io)
507507
{
508508
$tableHeaders = ['Order', 'Callable', 'Priority'];
509509
$tableRows = [];

Console/Descriptor/XmlDescriptor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ private function getContainerAliasDocument(Alias $alias, string $id = null): \DO
449449
return $dom;
450450
}
451451

452-
private function getContainerParameterDocument($parameter, $options = []): \DOMDocument
452+
private function getContainerParameterDocument($parameter, array $options = []): \DOMDocument
453453
{
454454
$dom = new \DOMDocument('1.0', 'UTF-8');
455455
$dom->appendChild($parameterXML = $dom->createElement('parameter'));
@@ -485,7 +485,7 @@ private function getEventDispatcherListenersDocument(EventDispatcherInterface $e
485485
return $dom;
486486
}
487487

488-
private function appendEventListenerDocument(EventDispatcherInterface $eventDispatcher, $event, \DOMElement $element, array $eventListeners)
488+
private function appendEventListenerDocument(EventDispatcherInterface $eventDispatcher, string $event, \DOMElement $element, array $eventListeners)
489489
{
490490
foreach ($eventListeners as $listener) {
491491
$callableXML = $this->getCallableDocument($listener);

DependencyInjection/FrameworkExtension.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ private function registerAssetsConfiguration(array $config, ContainerBuilder $co
10601060
/**
10611061
* Returns a definition for an asset package.
10621062
*/
1063-
private function createPackageDefinition($basePath, array $baseUrls, Reference $version)
1063+
private function createPackageDefinition(?string $basePath, array $baseUrls, Reference $version)
10641064
{
10651065
if ($basePath && $baseUrls) {
10661066
throw new \LogicException('An asset package cannot have base URLs and base paths.');
@@ -1076,7 +1076,7 @@ private function createPackageDefinition($basePath, array $baseUrls, Reference $
10761076
return $package;
10771077
}
10781078

1079-
private function createVersion(ContainerBuilder $container, $version, $format, $jsonManifestPath, $name)
1079+
private function createVersion(ContainerBuilder $container, ?string $version, ?string $format, ?string $jsonManifestPath, string $name)
10801080
{
10811081
// Configuration prevents $version and $jsonManifestPath from being set
10821082
if (null !== $version) {
@@ -1331,7 +1331,7 @@ private function registerValidatorMapping(ContainerBuilder $container, array $co
13311331
$this->registerMappingFilesFromConfig($container, $config, $fileRecorder);
13321332
}
13331333

1334-
private function registerMappingFilesFromDir($dir, callable $fileRecorder)
1334+
private function registerMappingFilesFromDir(string $dir, callable $fileRecorder)
13351335
{
13361336
foreach (Finder::create()->followLinks()->files()->in($dir)->name('/\.(xml|ya?ml)$/')->sortByName() as $file) {
13371337
$fileRecorder($file->getExtension(), $file->getRealPath());
@@ -1355,7 +1355,7 @@ private function registerMappingFilesFromConfig(ContainerBuilder $container, arr
13551355
}
13561356
}
13571357

1358-
private function registerAnnotationsConfiguration(array $config, ContainerBuilder $container, $loader)
1358+
private function registerAnnotationsConfiguration(array $config, ContainerBuilder $container, LoaderInterface $loader)
13591359
{
13601360
if (!$this->annotationsConfigEnabled) {
13611361
return;

0 commit comments

Comments
 (0)