Skip to content

Commit

Permalink
Drop useless typecast
Browse files Browse the repository at this point in the history
  • Loading branch information
xificurk committed Feb 9, 2024
1 parent 275e7ff commit 81326bc
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ updates:
- dependency-name: "nette/bootstrap"
- dependency-name: "nette/component-model"
- dependency-name: "nette/http"
- dependency-name: "composer-runtime-api"
groups:
phpstan:
patterns: ["*phpstan*"]
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
"nette/schema": "^1.0.3@dev",
"nette/bootstrap": ">=3.1@dev",
"nette/component-model": ">=3.0.2",
"nette/http": ">=3.1.0@dev"
"nette/http": ">=3.1.0@dev",
"composer-runtime-api": "^2.0",
"composer/semver": "3.4.0"
},
"autoload": {
"psr-4": {
Expand Down
1 change: 1 addition & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ includes:
- vendor/spaze/phpstan-disallowed-calls/disallowed-loose-calls.neon
- tests/PHPStan/disallowedCalls.neon
- tests/PHPStan/shipmonk.neon
- tests/PHPStan/conditional.config.php

parameters:
level: max
Expand Down
2 changes: 1 addition & 1 deletion src/AutocompleteInput/AutocompleteInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private function getPresenter(): Presenter

private function getUniqueId(): string
{
return (string) $this->lookupPath(Presenter::class, true);
return $this->lookupPath(Presenter::class, true);
}

}
17 changes: 17 additions & 0 deletions tests/PHPStan/conditional.config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
declare(strict_types = 1);

use Composer\InstalledVersions;
use Composer\Semver\VersionParser;

$config = [];

if (InstalledVersions::satisfies(new VersionParser(), 'nette/application', '<3.2')) {
$config['parameters']['ignoreErrors'][] = [
'message' => '#^Method Nepada\\\\AutocompleteInput\\\\AutocompleteInput\\:\\:getUniqueId\\(\\) should return string but returns string\\|null\\.$#',
'path' => '../../src/AutocompleteInput/AutocompleteInput.php',
'count' => 1,
];
}

return $config;

0 comments on commit 81326bc

Please sign in to comment.