Skip to content

Commit 6877fe5

Browse files
committed
minor #11682 Show DomCrawler results consistent (OskarStark)
This PR was merged into the 4.2 branch. Discussion ---------- Show DomCrawler results consistent We are already using this "format" in `create_framework/routing.rst` Cheers! Commits ------- 7c5d2f0 Show DomCrawler results consistent
2 parents 835ab38 + 7c5d2f0 commit 6877fe5

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

components/dom_crawler.rst

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -332,30 +332,34 @@ This behavior is best illustrated with examples::
332332
$crawler->addHtmlContent($html);
333333

334334
$crawler->filterXPath('//span[contains(@id, "article-")]')->evaluate('substring-after(@id, "-")');
335-
/* array:3 [
336-
0 => "100"
337-
1 => "101"
338-
2 => "102"
339-
]
335+
/* Result:
336+
[
337+
0 => '100',
338+
1 => '101',
339+
2 => '102',
340+
];
340341
*/
341342

342343
$crawler->evaluate('substring-after(//span[contains(@id, "article-")]/@id, "-")');
343-
/* array:1 [
344-
0 => "100"
344+
/* Result:
345+
[
346+
0 => '100',
345347
]
346348
*/
347349

348350
$crawler->filterXPath('//span[@class="article"]')->evaluate('count(@id)');
349-
/* array:3 [
350-
0 => 1.0
351-
1 => 1.0
352-
2 => 1.0
351+
/* Result:
352+
[
353+
0 => 1.0,
354+
1 => 1.0,
355+
2 => 1.0,
353356
]
354357
*/
355358

356359
$crawler->evaluate('count(//span[@class="article"])');
357-
/* array:1 [
358-
0 => 3.0
360+
/* Result:
361+
[
362+
0 => 3.0,
359363
]
360364
*/
361365

0 commit comments

Comments
 (0)