diff --git a/src/Psalm/Internal/Analyzer/TraitAnalyzer.php b/src/Psalm/Internal/Analyzer/TraitAnalyzer.php index 10de0e5eff5..3d65d479008 100644 --- a/src/Psalm/Internal/Analyzer/TraitAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/TraitAnalyzer.php @@ -24,7 +24,6 @@ public function __construct( ) { $this->source = $source; $this->file_analyzer = $source->getFileAnalyzer(); - $this->aliases = $source->getAliases(); $this->class = $class; $this->fq_class_name = $fq_class_name; $codebase = $source->getCodebase(); diff --git a/src/Psalm/Internal/Fork/PsalmRestarter.php b/src/Psalm/Internal/Fork/PsalmRestarter.php index a8bbc50761c..139bd69d0b1 100644 --- a/src/Psalm/Internal/Fork/PsalmRestarter.php +++ b/src/Psalm/Internal/Fork/PsalmRestarter.php @@ -10,6 +10,7 @@ use function array_merge; use function array_splice; use function assert; +use function count; use function defined; use function extension_loaded; use function file_get_contents; @@ -140,7 +141,7 @@ private static function toBytes(string $value): int /** * No type hint to allow xdebug-handler v1 and v2 usage * - * @param string[] $command + * @param non-empty-list $command * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint */ protected function restart($command): void @@ -178,6 +179,7 @@ protected function restart($command): void 0, $additional_options, ); + assert(count($command) > 0); parent::restart($command); } diff --git a/tests/fixtures/SuicidalAutoloader/autoloader.php b/tests/fixtures/SuicidalAutoloader/autoloader.php index d506219c141..33ce6e511f2 100644 --- a/tests/fixtures/SuicidalAutoloader/autoloader.php +++ b/tests/fixtures/SuicidalAutoloader/autoloader.php @@ -10,6 +10,7 @@ Transliterator::class, // symfony/string InstalledVersions::class, // composer v2 'Mockery\Closure', // Mockery/mockery 1.6.1 + 'Mockery\Matcher\TExpected', // Mockery/mockery, invalid template usage 'parent', // it's unclear why Psalm tries to autoload parent 'PHPUnit\Framework\ArrayAccess', 'PHPUnit\Framework\Countable',