diff --git a/doc/1_Installation.markdown b/doc/1_Installation.markdown index 02650bd..bb853a9 100644 --- a/doc/1_Installation.markdown +++ b/doc/1_Installation.markdown @@ -6,22 +6,14 @@ There are multiple ways to include the PHP parser into your project: Installing via Composer ----------------------- -Create a `composer.json` file in your project root and use it to define your dependencies: +Run the following command inside your project: - { - "require": { - "nikic/php-parser": "~1.0.2" - } - } + php composer.phar require nikic/php-parser -Then install Composer in your project (or [download the composer.phar][1] directly): +If you haven't installed [Composer][1] yet, you can do so using: curl -s http://getcomposer.org/installer | php -And finally ask Composer to install the dependencies: - - php composer.phar install - Installing as a Git Submodule ----------------------------- @@ -35,5 +27,5 @@ Installing from the Zip- or Tarball Download the latest version from [the download page][2], unpack it and move the files somewhere into your project. - [1]: http://getcomposer.org/composer.phar - [2]: https://github.com/nikic/PHP-Parser/tags \ No newline at end of file + [1]: https://getcomposer.org/ + [2]: https://github.com/nikic/PHP-Parser/tags diff --git a/doc/2_Usage_of_basic_components.markdown b/doc/2_Usage_of_basic_components.markdown index e6daad6..d4ea040 100644 --- a/doc/2_Usage_of_basic_components.markdown +++ b/doc/2_Usage_of_basic_components.markdown @@ -6,7 +6,7 @@ This document explains how to use the parser, the pretty printer and the node tr Bootstrapping ------------- -The library needs to register a class autoloader. You can either use the ''vendor/autoload.php'' file generated by +The library needs to register a class autoloader. You can either use the `vendor/autoload.php` file generated by Composer or by including the bundled `lib/bootstrap.php` file: ```php @@ -415,4 +415,4 @@ class NodeVisitor_NamespaceConverter extends PhpParser\NodeVisitorAbstract } ``` -That's all. \ No newline at end of file +That's all. diff --git a/doc/component/Lexer.markdown b/doc/component/Lexer.markdown index c1185f1..0bf06b6 100644 --- a/doc/component/Lexer.markdown +++ b/doc/component/Lexer.markdown @@ -67,7 +67,11 @@ class MyNodeVisitor extends PhpParser\NodeVisitorAbstract { } } -$lexer = new TokenOffsetLexer(); +$lexer = new PhpParser\Lexer(array( + 'usedAttributes' => array( + 'comments', 'startLine', 'endLine', 'startTokenPos', 'endTokenPos' + ) +)); $parser = new PhpParser\Parser($lexer); $visitor = new MyNodeVisitor();