Skip to content

Commit dd08f95

Browse files
authored
Merge pull request #9374 from neznaika0/refactor/phpstan-nullCoalesce
refactor: Fix phpstan nullCoalesce
2 parents e5a60f3 + 6d04e1d commit dd08f95

File tree

4 files changed

+3
-16
lines changed

4 files changed

+3
-16
lines changed

system/HTTP/Files/UploadedFile.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ public function guessExtension(): string
325325
*/
326326
public function getClientExtension(): string
327327
{
328-
return pathinfo($this->originalName, PATHINFO_EXTENSION) ?? '';
328+
return pathinfo($this->originalName, PATHINFO_EXTENSION);
329329
}
330330

331331
/**

system/Router/Router.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ class Router implements RouterInterface
144144
public function __construct(RouteCollectionInterface $routes, ?Request $request = null)
145145
{
146146
$config = config(App::class);
147+
147148
if (isset($config->permittedURIChars)) {
148149
$this->permittedURIChars = $config->permittedURIChars;
149150
}
@@ -154,7 +155,7 @@ public function __construct(RouteCollectionInterface $routes, ?Request $request
154155
$this->controller = $this->collection->getDefaultController();
155156
$this->method = $this->collection->getDefaultMethod();
156157

157-
$this->collection->setHTTPVerb($request->getMethod() ?? $_SERVER['REQUEST_METHOD']);
158+
$this->collection->setHTTPVerb($request->getMethod() === '' ? $_SERVER['REQUEST_METHOD'] : $request->getMethod());
158159

159160
$this->translateURIDashes = $this->collection->shouldTranslateURIDashes();
160161

utils/phpstan-baseline/loader.neon

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ includes:
3131
- missingType.property.neon
3232
- missingType.return.neon
3333
- notIdentical.alwaysTrue.neon
34-
- nullCoalesce.expr.neon
3534
- nullCoalesce.property.neon
3635
- nullCoalesce.variable.neon
3736
- offsetAccess.notFound.neon

utils/phpstan-baseline/nullCoalesce.expr.neon

-13
This file was deleted.

0 commit comments

Comments
 (0)