Skip to content

Commit e14d85b

Browse files
staabmsebastianbergmann
authored andcommitted
Prevent unnecessary duplicate work in DataProvider->providedData()
1 parent 1848e87 commit e14d85b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Metadata/Api/DataProvider.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@
4747
*/
4848
public function providedData(string $className, string $methodName): ?array
4949
{
50-
$dataProvider = MetadataRegistry::parser()->forMethod($className, $methodName)->isDataProvider();
51-
$testWith = MetadataRegistry::parser()->forMethod($className, $methodName)->isTestWith();
50+
$metadataCollection = MetadataRegistry::parser()->forMethod($className, $methodName);
51+
$dataProvider = $metadataCollection->isDataProvider();
52+
$testWith = $metadataCollection->isTestWith();
5253

5354
if ($dataProvider->isEmpty() && $testWith->isEmpty()) {
5455
return null;

0 commit comments

Comments
 (0)