Skip to content

Commit cb7af2a

Browse files
committed
Merge branch '5.0' into 5.1
* 5.0: Add TypeHint
2 parents 7d38696 + 66d9722 commit cb7af2a

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
@@ -787,6 +787,8 @@ Extracting Information
787787

788788
The Crawler can extract information from the nodes::
789789

790+
use Symfony\Component\DomCrawler\Crawler;
791+
790792
// returns the attribute value for the first node
791793
$crawler->attr('class');
792794

@@ -807,7 +809,7 @@ The Crawler can extract information from the nodes::
807809
$info = $crawler->extract(['_text', 'href']);
808810

809811
// executes a lambda for each node and return an array of results
810-
$data = $crawler->each(function ($node, $i) {
812+
$data = $crawler->each(function (Crawler $node, $i) {
811813
return $node->attr('href');
812814
});
813815

0 commit comments

Comments
 (0)