diff --git a/phpunit.xml b/phpunit.xml index 5bd0e6abf2b..b4e12f21875 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -6,6 +6,7 @@ colors="true" executionOrder="defects" defaultTestSuite="main" + displayDetailsOnTestsThatTriggerWarnings="true" > diff --git a/rules/CodingStyle/Application/UseImportsAdder.php b/rules/CodingStyle/Application/UseImportsAdder.php index c166371ebc4..c63530f4c5e 100644 --- a/rules/CodingStyle/Application/UseImportsAdder.php +++ b/rules/CodingStyle/Application/UseImportsAdder.php @@ -116,7 +116,7 @@ private function mirrorUseComments(array $stmts, array $newUses, int $indexStmt return; } - if ($stmts[$indexStmt] instanceof Use_) { + if (isset($stmts[$indexStmt]) && $stmts[$indexStmt] instanceof Use_) { $comments = (array) $stmts[$indexStmt]->getAttribute(AttributeKey::COMMENTS); if ($comments !== []) {