Skip to content

Commit 66d9722

Browse files
committed
minor #13892 Add TypeHint (zairigimad)
This PR was merged into the 5.0 branch. Discussion ---------- Add TypeHint <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- 7b931e2 Add TypeHint
2 parents b36ba09 + 7b931e2 commit 66d9722

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

testing.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,8 @@ Extracting Information
729729

730730
The Crawler can extract information from the nodes::
731731

732+
use Symfony\Component\DomCrawler\Crawler;
733+
732734
// returns the attribute value for the first node
733735
$crawler->attr('class');
734736

@@ -749,7 +751,7 @@ The Crawler can extract information from the nodes::
749751
$info = $crawler->extract(['_text', 'href']);
750752

751753
// executes a lambda for each node and return an array of results
752-
$data = $crawler->each(function ($node, $i) {
754+
$data = $crawler->each(function (Crawler $node, $i) {
753755
return $node->attr('href');
754756
});
755757

0 commit comments

Comments
 (0)