mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-01-17 23:28:15 +01:00
Use RegexIterator in docs (by @lstrojny)
Also fix formatting in changelog and be more specific in a doc comment.
This commit is contained in:
parent
eeb5e899a5
commit
222c9612ab
@ -288,16 +288,11 @@ $prettyPrinter = new PHPParser_PrettyPrinter_Zend;
|
||||
$traverser->addVisitor(new PHPParser_NodeVisitor_NameResolver); // we will need resolved names
|
||||
$traverser->addVisitor(new NodeVisitor_NamespaceConverter); // our own node visitor
|
||||
|
||||
// iterate over all files in the directory
|
||||
foreach (new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator(IN_DIR),
|
||||
RecursiveIteratorIterator::LEAVES_ONLY)
|
||||
as $file) {
|
||||
// only convert .php files
|
||||
if (!preg_match('~\.php$~', $file)) {
|
||||
continue;
|
||||
}
|
||||
// iterate over all .php files in the directory
|
||||
$files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(IN_DIR));
|
||||
$files = new RegexIterator($files, '/\.php$/');
|
||||
|
||||
foreach ($files as $file) {
|
||||
try {
|
||||
// read the file that should be converted
|
||||
$code = file_get_contents($file);
|
||||
|
@ -157,7 +157,7 @@ class #(-p)
|
||||
*
|
||||
* @param string $code The source code to parse
|
||||
*
|
||||
* @return array Array of statements
|
||||
* @return PHPParser_Node[] Array of statements
|
||||
*/
|
||||
public function parse($code) {
|
||||
$this->lexer->startLexing($code);
|
||||
|
@ -939,7 +939,7 @@ class PHPParser_Parser
|
||||
*
|
||||
* @param string $code The source code to parse
|
||||
*
|
||||
* @return array Array of statements
|
||||
* @return PHPParser_Node[] Array of statements
|
||||
*/
|
||||
public function parse($code) {
|
||||
$this->lexer->startLexing($code);
|
||||
|
Loading…
x
Reference in New Issue
Block a user