Skip to content

Commit e381f6c

Browse files
derrabusTobion
authored andcommitted
Add types to constructors and private/final/internal methods (Batch II)
1 parent d20041a commit e381f6c

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

Loader/Configurator/CollectionConfigurator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __destruct()
4848
/**
4949
* Creates a sub-collection.
5050
*/
51-
final public function collection($name = ''): self
51+
final public function collection(string $name = ''): self
5252
{
5353
return new self($this->collection, $this->name.$name, $this, $this->prefixes);
5454
}

Loader/XmlFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ private function parseDefaultNode(\DOMElement $node, string $path)
409409
}
410410
}
411411

412-
private function isElementValueNull(\DOMElement $element)
412+
private function isElementValueNull(\DOMElement $element): bool
413413
{
414414
$namespaceUri = 'http://www.w3.org/2001/XMLSchema-instance';
415415

Matcher/Dumper/CompiledUrlMatcherDumper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ private function compileRoute(Route $route, string $name, $vars, bool $hasTraili
443443
];
444444
}
445445

446-
private function getExpressionLanguage()
446+
private function getExpressionLanguage(): ExpressionLanguage
447447
{
448448
if (null === $this->expressionLanguage) {
449449
if (!class_exists('Symfony\Component\ExpressionLanguage\ExpressionLanguage')) {
@@ -455,7 +455,7 @@ private function getExpressionLanguage()
455455
return $this->expressionLanguage;
456456
}
457457

458-
private function indent(string $code, int $level = 1)
458+
private function indent(string $code, int $level = 1): string
459459
{
460460
return preg_replace('/^./m', str_repeat(' ', $level).'$0', $code);
461461
}

Matcher/Dumper/CompiledUrlMatcherTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ trait CompiledUrlMatcherTrait
3232
private $dynamicRoutes = [];
3333
private $checkCondition;
3434

35-
public function match($pathinfo)
35+
public function match($pathinfo): array
3636
{
3737
$allow = $allowSchemes = [];
3838
if ($ret = $this->doMatch($pathinfo, $allow, $allowSchemes)) {

Matcher/UrlMatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ protected function getExpressionLanguage()
276276
/**
277277
* @internal
278278
*/
279-
protected function createRequest($pathinfo)
279+
protected function createRequest(string $pathinfo): ?Request
280280
{
281281
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
282282
return null;

RouteCompiler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public static function compile(Route $route)
9292
);
9393
}
9494

95-
private static function compilePattern(Route $route, $pattern, $isHost)
95+
private static function compilePattern(Route $route, string $pattern, bool $isHost): array
9696
{
9797
$tokens = [];
9898
$variables = [];

0 commit comments

Comments
 (0)