fiv / tokenizer
This package is abandoned and no longer maintained.
The author suggests using the funivan/php-tokenizer package instead.
Extreme and flexible library for parsing and modify php code
0.9.8
2014-07-15 08:32 UTC
Requires
- php: >=5.4
- fiv/spl: 1.1.*
Requires (Dev)
- phpunit/phpunit: 3.7.*
- satooshi/php-coveralls: v0.6.1
README
Flexible library for parsing and modify php code;
##Install:
composer require fiv/tokenizer:*
##Use For example lets find all if and elseif conditions:
$fileTokens = new Fiv\Tokenizer\File(__FILE__); $query = $fileTokens->getCollection()->extendedQuery(); $query->strict()->valueIs(array('if', 'elseif')); $query->section('(', ')'); $blocks = $query->getBlock(); foreach ($blocks as $code) { echo $code . "\n"; }