chore: Bump phpstan version

And fix the issue found by the new version. $uri === '' was always false
at that point.

Signed-off-by: Carl Schwan <carlschwan@kde.org>
This commit is contained in:
Carl Schwan 2026-07-15 10:41:59 +02:00
commit 76d787ac73
No known key found for this signature in database
GPG key ID: 02325448204E452A
2 changed files with 3 additions and 6 deletions

View file

@ -15,7 +15,7 @@
"require-dev": { "require-dev": {
"php-parallel-lint/php-parallel-lint": "^1.0", "php-parallel-lint/php-parallel-lint": "^1.0",
"friendsofphp/php-cs-fixer": "^2", "friendsofphp/php-cs-fixer": "^2",
"phpstan/phpstan": "^0.12", "phpstan/phpstan": "^2.2",
"psalm/phar": "^4.3", "psalm/phar": "^4.3",
"phpunit/phpunit": "^8" "phpunit/phpunit": "^8"
}, },

View file

@ -25,13 +25,10 @@ use Sabre\DAV\Exception\Forbidden;
use Sabre\DAV\Server; use Sabre\DAV\Server;
class PathHelper { class PathHelper {
/** @var Server */ private Server $server;
private $server;
/** /**
* PathHelper constructor. * PathHelper constructor.
*
* @param Server $server
*/ */
public function __construct(Server $server) { public function __construct(Server $server) {
$this->server = $server; $this->server = $server;
@ -42,7 +39,7 @@ class PathHelper {
return $uri; return $uri;
} }
try { try {
return ($uri === '' && $this->server->getBaseUri() === '/') ? '' : $this->server->calculateUri($uri); return $this->server->calculateUri($uri);
} catch (Forbidden $e) { } catch (Forbidden $e) {
return null; return null;
} }