Skip to content

Commit

Permalink
Merge pull request #9374 from neznaika0/refactor/phpstan-nullCoalesce
Browse files Browse the repository at this point in the history
refactor: Fix phpstan nullCoalesce
  • Loading branch information
samsonasik authored Jan 8, 2025
2 parents e5a60f3 + 6d04e1d commit dd08f95
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 16 deletions.
2 changes: 1 addition & 1 deletion system/HTTP/Files/UploadedFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ public function guessExtension(): string
*/
public function getClientExtension(): string
{
return pathinfo($this->originalName, PATHINFO_EXTENSION) ?? '';
return pathinfo($this->originalName, PATHINFO_EXTENSION);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion system/Router/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ class Router implements RouterInterface
public function __construct(RouteCollectionInterface $routes, ?Request $request = null)
{
$config = config(App::class);

if (isset($config->permittedURIChars)) {
$this->permittedURIChars = $config->permittedURIChars;
}
Expand All @@ -154,7 +155,7 @@ public function __construct(RouteCollectionInterface $routes, ?Request $request
$this->controller = $this->collection->getDefaultController();
$this->method = $this->collection->getDefaultMethod();

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

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

Expand Down
1 change: 0 additions & 1 deletion utils/phpstan-baseline/loader.neon
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ includes:
- missingType.property.neon
- missingType.return.neon
- notIdentical.alwaysTrue.neon
- nullCoalesce.expr.neon
- nullCoalesce.property.neon
- nullCoalesce.variable.neon
- offsetAccess.notFound.neon
Expand Down
13 changes: 0 additions & 13 deletions utils/phpstan-baseline/nullCoalesce.expr.neon

This file was deleted.

0 comments on commit dd08f95

Please sign in to comment.