Skip to content

Commit df5973b

Browse files
authored
Merge pull request #7723 from kenjis/refactor-add-return-types-4.4
refactor: [4.4] add types for phpstan
2 parents dec4b71 + 05fc454 commit df5973b

7 files changed

Lines changed: 9 additions & 6 deletions

File tree

app/Config/Routing.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class Routing extends BaseRouting
7878
* Example:
7979
* public $override404 = 'App\Errors::show404';
8080
*/
81-
public $override404;
81+
public ?string $override404 = null;
8282

8383
/**
8484
* If TRUE, the system will attempt to match the URI against

system/Config/Routing.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class Routing extends BaseConfig
7676
* Example:
7777
* public $override404 = 'App\Errors::show404';
7878
*/
79-
public $override404;
79+
public ?string $override404 = null;
8080

8181
/**
8282
* If TRUE, the system will attempt to match the URI against

system/Debug/BaseExceptionHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ protected function collectVars(Throwable $exception, int $statusCode): array
8989
*
9090
* @param array|object $trace
9191
*/
92-
protected function maskSensitiveData(&$trace, array $keysToMask, string $path = '')
92+
protected function maskSensitiveData(&$trace, array $keysToMask, string $path = ''): void
9393
{
9494
foreach ($keysToMask as $keyToMask) {
9595
$explode = explode('/', $keyToMask);

system/Exceptions/FrameworkException.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ public static function forInvalidFile(string $path)
3333
return new static(lang('Core.invalidFile', [$path]));
3434
}
3535

36+
/**
37+
* @return static
38+
*/
3639
public static function forInvalidDirectory(string $path)
3740
{
3841
return new static(lang('Core.invalidDirectory', [$path]));

system/HTTP/SiteURI.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ public function refreshPath()
328328
/**
329329
* Saves our parts from a parse_url() call.
330330
*/
331-
protected function applyParts(array $parts)
331+
protected function applyParts(array $parts): void
332332
{
333333
if (! empty($parts['host'])) {
334334
$this->host = $parts['host'];

system/HotReloader/HotReloader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
final class HotReloader
1818
{
19-
public function run()
19+
public function run(): void
2020
{
2121
ini_set('zlib.output_compression', 'Off');
2222

system/Router/AutoRouterImproved.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function __construct(// @phpstan-ignore-line
121121
$this->controller = $this->defaultController;
122122
}
123123

124-
private function createSegments(string $uri)
124+
private function createSegments(string $uri): array
125125
{
126126
$segments = explode('/', $uri);
127127
$segments = array_filter($segments, static fn ($segment) => $segment !== '');

0 commit comments

Comments
 (0)