From 2f6eadc3375c23395cf629e72bf84feda06d6a9b Mon Sep 17 00:00:00 2001 From: Rodrigo Prado Date: Wed, 24 Jun 2015 22:31:47 -0300 Subject: [PATCH 1/2] added syntax highlighting in section php code --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index abc99fc..701423d 100644 --- a/README.md +++ b/README.md @@ -5,16 +5,17 @@ A Control-Flow-Graph implementation in Pure PHP. ## Usage To bootstrap the parser, you need to give it a `PhpParser` instance: - +```php $parser = new PHPCfg\Parser( new PhpParser\Parser(new PhpParser\Lexer) ); - +``` Then, just call parse on a block of code, giving it a filename: - +```php $block = $parser->parse(file_get_contents(__FILE__), __FILE__); - +``` To dump the graph, simply use the built-in dumper: - +```php $dumper = new PHPCfg\Dumper; - echo $dumper->dump($block); \ No newline at end of file + echo $dumper->dump($block); +``` From c9b9618abfa779fbf75b8fd29adf728b6dc25294 Mon Sep 17 00:00:00 2001 From: Rodrigo Prado Date: Thu, 25 Jun 2015 08:44:12 -0300 Subject: [PATCH 2/2] dropped indentation --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 701423d..81464af 100644 --- a/README.md +++ b/README.md @@ -6,16 +6,16 @@ A Control-Flow-Graph implementation in Pure PHP. To bootstrap the parser, you need to give it a `PhpParser` instance: ```php - $parser = new PHPCfg\Parser( - new PhpParser\Parser(new PhpParser\Lexer) - ); +$parser = new PHPCfg\Parser( + new PhpParser\Parser(new PhpParser\Lexer) +); ``` Then, just call parse on a block of code, giving it a filename: ```php - $block = $parser->parse(file_get_contents(__FILE__), __FILE__); +$block = $parser->parse(file_get_contents(__FILE__), __FILE__); ``` To dump the graph, simply use the built-in dumper: ```php - $dumper = new PHPCfg\Dumper; - echo $dumper->dump($block); +$dumper = new PHPCfg\Dumper; +echo $dumper->dump($block); ```