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

This package is auto-updated.

Last update: 2022-02-01 12:29:27 UTC


README

Build Status Coverage Status

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";
  }