Skip to content

Commit

Permalink
5177 use dump() instead of print in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Snoek authored and wouterj committed Jun 27, 2015
1 parent 10898c9 commit 78c9b7c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion components/class_loader/class_map_generator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ method::

use Symfony\Component\ClassLoader\ClassMapGenerator;

print_r(ClassMapGenerator::createMap(__DIR__.'/library'));
dump(ClassMapGenerator::createMap(__DIR__.'/library'));

Given the files and class from the table above, you should see an output like
this:
Expand Down
2 changes: 1 addition & 1 deletion components/css_selector.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ equivalents::

use Symfony\Component\CssSelector\CssSelector;

print CssSelector::toXPath('div.item > h4 > a');
dump(CssSelector::toXPath('div.item > h4 > a'));

This gives the following output:

Expand Down
2 changes: 1 addition & 1 deletion components/dom_crawler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ traverse easily::
$crawler = new Crawler($html);

foreach ($crawler as $domElement) {
print $domElement->nodeName;
dump($domElement->nodeName);
}

Specialized :class:`Symfony\\Component\\DomCrawler\\Link` and
Expand Down
16 changes: 7 additions & 9 deletions components/finder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ directories::
$finder->files()->in(__DIR__);

foreach ($finder as $file) {
// Print the absolute path
print $file->getRealpath()."\n";
// Dump the absolute path
dump($file->getRealpath());

// Print the relative path to the file, omitting the filename
print $file->getRelativePath()."\n";
// Dump the relative path to the file, omitting the filename
dump($file->getRelativePath());

// Print the relative path to the file
print $file->getRelativePathname()."\n";
// Dump the relative path to the file
dump($file->getRelativePathname());
}

The ``$file`` is an instance of :class:`Symfony\\Component\\Finder\\SplFileInfo`
Expand Down Expand Up @@ -121,9 +121,7 @@ And it also works with user-defined streams::
$finder = new Finder();
$finder->name('photos*')->size('< 100K')->date('since 1 hour ago');
foreach ($finder->in('s3://bucket-name') as $file) {
// ... do something

print $file->getFilename()."\n";
// ... do something with the file
}

.. note::
Expand Down

0 comments on commit 78c9b7c

Please sign in to comment.