File tree 4 files changed +10
-12
lines changed
4 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ method::
50
50
51
51
use Symfony\Component\ClassLoader\ClassMapGenerator;
52
52
53
- print_r (ClassMapGenerator::createMap(__DIR__.'/library'));
53
+ dump (ClassMapGenerator::createMap(__DIR__.'/library'));
54
54
55
55
Given the files and class from the table above, you should see an output like
56
56
this:
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ equivalents::
51
51
52
52
use Symfony\Component\CssSelector\CssSelector;
53
53
54
- print CssSelector::toXPath('div.item > h4 > a');
54
+ dump( CssSelector::toXPath('div.item > h4 > a') );
55
55
56
56
This gives the following output:
57
57
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ traverse easily::
47
47
$crawler = new Crawler($html);
48
48
49
49
foreach ($crawler as $domElement) {
50
- print $domElement->nodeName;
50
+ dump( $domElement->nodeName) ;
51
51
}
52
52
53
53
Specialized :class: `Symfony\\ Component\\ DomCrawler\\ Link ` and
Original file line number Diff line number Diff line change @@ -30,14 +30,14 @@ directories::
30
30
$finder->files()->in(__DIR__);
31
31
32
32
foreach ($finder as $file) {
33
- // Print the absolute path
34
- print $file->getRealpath()."\n" ;
33
+ // Dump the absolute path
34
+ dump( $file->getRealpath()) ;
35
35
36
- // Print the relative path to the file, omitting the filename
37
- print $file->getRelativePath()."\n" ;
36
+ // Dump the relative path to the file, omitting the filename
37
+ dump( $file->getRelativePath()) ;
38
38
39
- // Print the relative path to the file
40
- print $file->getRelativePathname()."\n" ;
39
+ // Dump the relative path to the file
40
+ dump( $file->getRelativePathname()) ;
41
41
}
42
42
43
43
The ``$file `` is an instance of :class: `Symfony\\ Component\\ Finder\\ SplFileInfo `
@@ -121,9 +121,7 @@ And it also works with user-defined streams::
121
121
$finder = new Finder();
122
122
$finder->name('photos*')->size('< 100K')->date('since 1 hour ago');
123
123
foreach ($finder->in('s3://bucket-name') as $file) {
124
- // ... do something
125
-
126
- print $file->getFilename()."\n";
124
+ // ... do something with the file
127
125
}
128
126
129
127
.. note ::
You can’t perform that action at this time.
0 commit comments