Skip to content

Commit

Permalink
chore: handle extract() (PHP-CS-Fixer#7684)
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus authored Jan 7, 2024
1 parent 6889dab commit 3566e7c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/AutoReview/ProjectCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,18 @@ public function testThatTestClassCoversAreCorrect(string $testClassName): void
}
}

/**
* @dataProvider provideSrcClassCases
* @dataProvider provideTestClassCases
*/
public function testThereIsNoUsageOfExtract(string $className): void
{
$calledFunctions = $this->extractFunctionNamesCalledInClass($className);

$message = sprintf('Class %s must not use "extract()", explicitly extract only the keys that are needed - you never know what\'s else inside.', $className);
self::assertNotContains('extract', $calledFunctions, $message);
}

/**
* @dataProvider provideThereIsNoPregFunctionUsedDirectlyCases
*/
Expand Down

0 comments on commit 3566e7c

Please sign in to comment.