Skip to content

Commit f9935a8

Browse files
committed
Turned return type annotations of private methods into php return types.
1 parent bca0db2 commit f9935a8

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

Generator/Dumper/PhpGeneratorDumper.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,8 @@ public function __construct(RequestContext \$context, LoggerInterface \$logger =
7979
/**
8080
* Generates PHP code representing an array of defined routes
8181
* together with the routes properties (e.g. requirements).
82-
*
83-
* @return string PHP code
8482
*/
85-
private function generateDeclaredRoutes()
83+
private function generateDeclaredRoutes(): string
8684
{
8785
$routes = "[\n";
8886
foreach ($this->getRoutes()->all() as $name => $route) {
@@ -105,10 +103,8 @@ private function generateDeclaredRoutes()
105103

106104
/**
107105
* Generates PHP code representing the `generate` method that implements the UrlGeneratorInterface.
108-
*
109-
* @return string PHP code
110106
*/
111-
private function generateGenerateMethod()
107+
private function generateGenerateMethod(): string
112108
{
113109
return <<<'EOF'
114110
public function generate($name, $parameters = [], $referenceType = self::ABSOLUTE_PATH)

Loader/XmlFileLoader.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,9 @@ protected function loadFile($file)
253253
/**
254254
* Parses the config elements (default, requirement, option).
255255
*
256-
* @return array An array with the defaults as first item, requirements as second and options as third
257-
*
258256
* @throws \InvalidArgumentException When the XML is invalid
259257
*/
260-
private function parseConfigs(\DOMElement $node, string $path)
258+
private function parseConfigs(\DOMElement $node, string $path): array
261259
{
262260
$defaults = [];
263261
$requirements = [];

Router.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,10 +405,8 @@ protected function getMatcherDumperInstance()
405405
/**
406406
* Provides the ConfigCache factory implementation, falling back to a
407407
* default implementation if necessary.
408-
*
409-
* @return ConfigCacheFactoryInterface
410408
*/
411-
private function getConfigCacheFactory()
409+
private function getConfigCacheFactory(): ConfigCacheFactoryInterface
412410
{
413411
if (null === $this->configCacheFactory) {
414412
$this->configCacheFactory = new ConfigCacheFactory($this->options['debug']);

0 commit comments

Comments
 (0)