Skip to content

Commit 7e1281d

Browse files
committed
Updates phpstan/phpstan
1 parent d0da68f commit 7e1281d

File tree

6 files changed

+12
-4
lines changed

6 files changed

+12
-4
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"mockery/mockery": "^1.0",
6666
"phlak/semver": "^4.1 || ^6.0",
6767
"php-mock/php-mock-phpunit": "^2.7||^1.1",
68-
"phpstan/phpstan": "^1.11",
68+
"phpstan/phpstan": "^2.0",
6969
"phpunit/phpunit": "^11.2.6||^10.5.25",
7070
"zenstruck/console-test": "^1.6"
7171
}

phpstan.neon.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@ parameters:
33
paths:
44
- src
55
- tests
6+
treatPhpDocTypesAsCertain: false
67
reportUnmatchedIgnoredErrors: false
78
ignoreErrors:
89
- identifier: missingType.iterableValue
10+
- identifier: argument.type
11+
- identifier: identical.alwaysTrue
12+
- identifier: method.alreadyNarrowedType
913
- '#Constant WORKING_DIRECTORY not found.#'
1014
- '#Mockery\\MockInterface#'
1115
- '#Mockery\\LegacyMockInterface#'

src/Commands/InitCommand.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
109109
$directory = (string) $input->getArgument('directory');
110110
$overwriteDefaultLpvFile = $input->getOption('overwrite');
111111
$chosenPreset = (string) $input->getOption('preset');
112+
$globPatternFromPreset = false;
112113

113114
if ($directory !== WORKING_DIRECTORY) {
114115
try {
@@ -159,9 +160,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
159160
);
160161

161162
$verboseOutput = '+ Writing default glob pattern to .lpv file in ' . WORKING_DIRECTORY . '.';
163+
162164
if ($globPatternFromPreset === true) {
163165
$verboseOutput = '+ Writing glob pattern for preset ' . $chosenPreset . ' to .lpv file in ' . WORKING_DIRECTORY . '.';
164166
}
167+
165168
$output->writeln($verboseOutput, OutputInterface::VERBOSITY_VERBOSE);
166169

167170
if ($bytesWritten === false) {

tests/Commands/ValidateCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public function showsDifferenceBetweenActualAndExpectedGitattributesContent(): v
179179
'--diff' => true,
180180
]);
181181

182-
$actualDisplayRows = \array_values(\explode(PHP_EOL, $commandTester->getDisplay()));
182+
$actualDisplayRows = \explode(PHP_EOL, $commandTester->getDisplay());
183183
$expectedDiffRows = ['--- Original', '+++ Expected', '@@ -1 +1,2 @@'];
184184

185185
foreach ($expectedDiffRows as $expectedDiffRow) {

tests/Presets/FinderTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ public function findsExpectedPresetGlobByLanguageNames(string $languageName): vo
3333
{
3434
$finder = new Finder(new PhpPreset());
3535
$presetGlob = $finder->getPresetGlobByLanguageName($languageName);
36-
$this->assertTrue(\is_array($presetGlob));
36+
37+
$this->assertIsArray($presetGlob);
3738
}
3839

3940
#[Test]

tests/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ protected function createTemporaryFiles(array $files, array $directories = [])
7474
\touch($artifactFile);
7575
}
7676

77-
if (\is_array($directories) && \count($directories) > 0) {
77+
if (\count($directories) > 0) {
7878
foreach ($directories as $directory) {
7979
$artifactDirectory = $this->temporaryDirectory
8080
. DIRECTORY_SEPARATOR

0 commit comments

Comments
 (0)