From 98cf53f0e0c31c7cbfff7520194b3510193a0988 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Mon, 29 May 2023 20:51:32 +0700 Subject: [PATCH 1/2] [Test] Enable displayDetailsOnTestsThatTriggerWarnings to true in tests to show warning --- phpunit.xml | 1 + 1 file changed, 1 insertion(+) 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" > From 2a91f41e98cd9afa0849697621a976b40552dfb0 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Mon, 29 May 2023 20:55:01 +0700 Subject: [PATCH 2/2] Fixed :tada: --- rules/CodingStyle/Application/UseImportsAdder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 !== []) {