Skip to content

Commit f1d0b04

Browse files
staabmsebastianbergmann
authored andcommitted
Prevent unnecessary duplicate work in DataProvider->providedData()
1 parent 4f05cab commit f1d0b04

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
@@ -59,8 +59,9 @@
5959
*/
6060
public function providedData(string $className, string $methodName): ?array
6161
{
62-
$dataProvider = MetadataRegistry::parser()->forMethod($className, $methodName)->isDataProvider();
63-
$testWith = MetadataRegistry::parser()->forMethod($className, $methodName)->isTestWith();
62+
$metadataCollection = MetadataRegistry::parser()->forMethod($className, $methodName);
63+
$dataProvider = $metadataCollection->isDataProvider();
64+
$testWith = $metadataCollection->isTestWith();
6465

6566
if ($dataProvider->isEmpty() && $testWith->isEmpty()) {
6667
return $this->dataProvidedByTestWithAnnotation($className, $methodName);

0 commit comments

Comments
 (0)