Skip to content

Commit 1349e1e

Browse files
kubawerloskeradus
authored andcommitted
DX: add missing explicit return types
1 parent 2cad888 commit 1349e1e

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

src/Cache/Cache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function has($file)
4747
public function get($file)
4848
{
4949
if (!$this->has($file)) {
50-
return;
50+
return null;
5151
}
5252

5353
return $this->hashes[$file];

src/Cache/CacheInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function has($file);
3434
/**
3535
* @param string $file
3636
*
37-
* @return int
37+
* @return null|int
3838
*/
3939
public function get($file);
4040

src/Cache/FileHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ public function getFile()
4242
public function read()
4343
{
4444
if (!file_exists($this->file)) {
45-
return;
45+
return null;
4646
}
4747

4848
$content = file_get_contents($this->file);
4949

5050
try {
5151
$cache = Cache::fromJson($content);
5252
} catch (\InvalidArgumentException $exception) {
53-
return;
53+
return null;
5454
}
5555

5656
return $cache;

src/Cache/FileHandlerInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ interface FileHandlerInterface
2525
public function getFile();
2626

2727
/**
28-
* @return CacheInterface
28+
* @return null|CacheInterface
2929
*/
3030
public function read();
3131

src/Console/Command/DescribeCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
107107
if ('@' === $name[0]) {
108108
$this->describeSet($output, $name);
109109

110-
return;
110+
return null;
111111
}
112112

113113
$this->describeRule($output, $name);

src/Fixer/ControlStructure/YodaStyleFixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ final class YodaStyleFixer extends AbstractFixer implements ConfigurationDefinit
3636
private $candidatesMap;
3737

3838
/**
39-
* @var array<string, null|bool>
39+
* @var array<int|string, null|bool>
4040
*/
4141
private $candidateTypesConfiguration;
4242

src/Fixer/LanguageConstruct/FunctionToConstantFixer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929
final class FunctionToConstantFixer extends AbstractFixer implements ConfigurationDefinitionFixerInterface
3030
{
3131
/**
32-
* @var string[]
32+
* @var array<string, Token[]>
3333
*/
3434
private static $availableFunctions;
3535

3636
/**
37-
* @var array<string, Token>
37+
* @var array<string, Token[]>
3838
*/
3939
private $functionsFixMap;
4040

src/Linter/CachingLinter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class CachingLinter implements LinterInterface
2525
private $sublinter;
2626

2727
/**
28-
* @var array<string, LintingResultInterface>
28+
* @var array<int, LintingResultInterface>
2929
*/
3030
private $cache = [];
3131

src/Preg.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class Preg
2525
/**
2626
* @param string $pattern
2727
* @param string $subject
28-
* @param null|string[] &$matches
28+
* @param null|string[] $matches
2929
* @param int $flags
3030
* @param int $offset
3131
*
@@ -51,7 +51,7 @@ public static function match($pattern, $subject, &$matches = null, $flags = 0, $
5151
/**
5252
* @param string $pattern
5353
* @param string $subject
54-
* @param null|string[] &$matches
54+
* @param null|string[] $matches
5555
* @param int $flags
5656
* @param int $offset
5757
*
@@ -79,7 +79,7 @@ public static function matchAll($pattern, $subject, &$matches = null, $flags = P
7979
* @param string|string[] $replacement
8080
* @param string|string[] $subject
8181
* @param int $limit
82-
* @param null|int &$count
82+
* @param null|int $count
8383
*
8484
* @throws PregException
8585
*
@@ -105,7 +105,7 @@ public static function replace($pattern, $replacement, $subject, $limit = -1, &$
105105
* @param callable $callback
106106
* @param string|string[] $subject
107107
* @param int $limit
108-
* @param null|int &$count
108+
* @param null|int $count
109109
*
110110
* @throws PregException
111111
*

0 commit comments

Comments
 (0)