Skip to content

Commit

Permalink
fix static analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
liborm85 committed Nov 13, 2024
1 parent c05be26 commit 3d95673
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 4 deletions.
27 changes: 24 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,28 @@ parameters:

reportUnmatchedIgnoredErrors: false
ignoreErrors:
-
message: '#^PHPDoc tag @var with type RecursiveDirectoryIterator is not subtype of native type RecursiveIteratorIterator\<RecursiveDirectoryIterator\>\.$#'
identifier: varTag.nativeType
count: 2
path: src/Directory.php

-
message: '#^Instanceof between Liborm85\\ComposerVendorCleaner\\Cleaner and Liborm85\\ComposerVendorCleaner\\Cleaner will always evaluate to true\.$#'
identifier: instanceof.alwaysTrue
count: 2
path: src/Plugin.php

# compatibility with multiple PHPUnit versions:
-
message: '#^Call to function method_exists\(\) with ''\\\\PHPUnit\\\\Framework…'' and ''assertIsCallable'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: tests/PluginTest.php

# compatibility with multiple PHPUnit versions:
- '#Call to an undefined static method [a-zA-Z0-9\\_]+::assertInternalType()#'
# skip void return type in unit tests
- '#Method Liborm85\\ComposerVendorCleaner\\Tests\\[a-zA-Z0-9\\_]+Test::test[a-zA-Z0-9\\_]+\(\) has no return type specified#'
-
message: '#^Call to an undefined static method Liborm85\\ComposerVendorCleaner\\Tests\\PluginTest\:\:assertInternalType\(\)\.$#'
identifier: staticMethod.notFound
count: 1
path: tests/PluginTest.php
2 changes: 1 addition & 1 deletion src/Directory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class Directory
{
/**
* @var string[];
* @var string[]
*/
private $paths = [];

Expand Down
9 changes: 9 additions & 0 deletions tests/DevFilesFinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class DevFilesFinderTest extends TestCase
'/tests/TEST.DOCX',
];

/**
* @return void
*/
public function testGetGlobPatternsForPackage()
{
$devFiles = [
Expand Down Expand Up @@ -75,6 +78,9 @@ public function testGetGlobPatternsForPackage()
);
}

/**
* @return void
*/
public function testGetFilteredEntries1()
{
$patterns = [
Expand All @@ -96,6 +102,9 @@ public function testGetFilteredEntries1()
);
}

/**
* @return void
*/
public function testGetFilteredEntries2()
{
$patterns = [
Expand Down
27 changes: 27 additions & 0 deletions tests/GlobFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class GlobFilterTest extends TestCase
'wtest.docx',
];

/**
* @return void
*/
public function testListOfFilesMatchCase()
{
$globFilter = new GlobFilter();
Expand All @@ -40,6 +43,9 @@ public function testListOfFilesMatchCase()
);
}

/**
* @return void
*/
public function testListOfFilesNoMatchCase()
{
$globFilter = new GlobFilter();
Expand All @@ -50,6 +56,9 @@ public function testListOfFilesNoMatchCase()
);
}

/**
* @return void
*/
public function testExcludeMatchCase()
{
$globFilter = new GlobFilter();
Expand All @@ -61,6 +70,9 @@ public function testExcludeMatchCase()
);
}

/**
* @return void
*/
public function testExcludeNoMatchCase()
{
$globFilter = new GlobFilter();
Expand All @@ -72,6 +84,9 @@ public function testExcludeNoMatchCase()
);
}

/**
* @return void
*/
public function testEmptyInclude()
{
$globFilter = new GlobFilter();
Expand All @@ -81,6 +96,9 @@ public function testEmptyInclude()
);
}

/**
* @return void
*/
public function testEmptyEntries()
{
$globFilter = new GlobFilter();
Expand All @@ -91,6 +109,9 @@ public function testEmptyEntries()
);
}

/**
* @return void
*/
public function testUnorderedArray()
{
$globFilter = new GlobFilter();
Expand All @@ -101,6 +122,9 @@ public function testUnorderedArray()
);
}

/**
* @return void
*/
public function testOrderedAscendingArray()
{
$globFilter = new GlobFilter();
Expand All @@ -111,6 +135,9 @@ public function testOrderedAscendingArray()
);
}

/**
* @return void
*/
public function testOrderedDescendingArray()
{
$globFilter = new GlobFilter();
Expand Down
3 changes: 3 additions & 0 deletions tests/PluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
class PluginTest extends TestCase
{

/**
* @return void
*/
public function testGetSubscribedEvents()
{
$plugin = $this->getPlugin();
Expand Down

0 comments on commit 3d95673

Please sign in to comment.