Skip to content

Commit 7b931e2

Browse files
authored
Add TypeHint
1 parent b36ba09 commit 7b931e2

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)