Skip to content

Commit f49c536

Browse files
Explicitly suppress UnresolvableInclude/PhpIncludeInspection inspections by Psalm/PhpStorm
1 parent 14d6a11 commit f49c536

File tree

5 files changed

+20
-18
lines changed

5 files changed

+20
-18
lines changed

.psalm/baseline.xml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -847,14 +847,6 @@
847847
<MissingThrowsDocblock occurrences="4">
848848
<code>ensureClassExists</code>
849849
</MissingThrowsDocblock>
850-
<UnresolvableInclude occurrences="1">
851-
<code>require_once $extension-&gt;sourceFile()</code>
852-
</UnresolvableInclude>
853-
</file>
854-
<file src="src/Runner/Extension/PharLoader.php">
855-
<UnresolvableInclude occurrences="1">
856-
<code>require $file</code>
857-
</UnresolvableInclude>
858850
</file>
859851
<file src="src/Runner/Filter/GroupFilterIterator.php">
860852
<MissingReturnType occurrences="1">
@@ -976,10 +968,6 @@
976968
<RedundantCondition occurrences="1">
977969
<code>assert(isset($arguments) &amp;&amp; $arguments instanceof Configuration)</code>
978970
</RedundantCondition>
979-
<UnresolvableInclude occurrences="2">
980-
<code>require $loaderFile</code>
981-
<code>require $printerFile</code>
982-
</UnresolvableInclude>
983971
<UnsafeInstantiation occurrences="1">
984972
<code>new static</code>
985973
</UnsafeInstantiation>
@@ -1241,11 +1229,6 @@
12411229
</DocblockTypeContradiction>
12421230
<MissingThrowsDocblock occurrences="1"/>
12431231
</file>
1244-
<file src="src/Util/FileLoader.php">
1245-
<UnresolvableInclude occurrences="1">
1246-
<code>include_once $filename</code>
1247-
</UnresolvableInclude>
1248-
</file>
12491232
<file src="src/Util/GlobalState.php">
12501233
<MissingParamType occurrences="1">
12511234
<code>$variable</code>

src/Runner/Extension/ExtensionHandler.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ private function ensureClassExists(Extension $extension): void
8989
}
9090

9191
if ($extension->hasSourceFile()) {
92-
/** @noinspection PhpIncludeInspection */
92+
/**
93+
* @noinspection PhpIncludeInspection
94+
* @psalm-suppress UnresolvableInclude
95+
*/
9396
require_once $extension->sourceFile();
9497
}
9598

src/Runner/Extension/PharLoader.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ public function loadPharExtensionsInDirectory(string $directory): array
5858
continue;
5959
}
6060

61+
/**
62+
* @noinspection PhpIncludeInspection
63+
* @psalm-suppress UnresolvableInclude
64+
*/
6165
require $file;
6266

6367
$loadedExtensions[] = $manifest->getName()->asString() . ' ' . $manifest->getVersion()->getVersionString();

src/TextUI/Command.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,10 @@ protected function handleLoader(string $loaderClass, string $loaderFile = ''): ?
434434
$loaderFile = stream_resolve_include_path($loaderFile);
435435

436436
if ($loaderFile) {
437+
/**
438+
* @noinspection PhpIncludeInspection
439+
* @psalm-suppress UnresolvableInclude
440+
*/
437441
require $loaderFile;
438442
}
439443
}
@@ -491,6 +495,10 @@ protected function handlePrinter(string $printerClass, string $printerFile = '')
491495
$printerFile = stream_resolve_include_path($printerFile);
492496

493497
if ($printerFile) {
498+
/**
499+
* @noinspection PhpIncludeInspection
500+
* @psalm-suppress UnresolvableInclude
501+
*/
494502
require $printerFile;
495503
}
496504
}

src/Util/FileLoader.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ public static function load(string $filename): void
5858
{
5959
$oldVariableNames = array_keys(get_defined_vars());
6060

61+
/**
62+
* @noinspection PhpIncludeInspection
63+
* @psalm-suppress UnresolvableInclude
64+
*/
6165
include_once $filename;
6266

6367
$newVariables = get_defined_vars();

0 commit comments

Comments
 (0)