2017 © Pedro Peláez
 

library php-tokenizer

Wrapper around token_get_all. Easy to extract and modify tokens

image

funivan/php-tokenizer

Wrapper around token_get_all. Easy to extract and modify tokens

  • Monday, June 11, 2018
  • by funivan
  • Repository
  • 6 Watchers
  • 9 Stars
  • 10,184 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 4 Forks
  • 3 Open issues
  • 11 Versions
  • 9 % Grown

The README.md

PhpTokenizer

GitHub tag Software License Total Downloads, (*1)

Wrapper around token_get_all. Easy to extract and modify tokens, (*2)

Install

Via Composer, (*3)

``` bash composer require funivan/php-tokenizer, (*4)


## Usage Reformat our code like PhpStorm. Lets create rule: place single spaces after `while` ```php use Funivan\PhpTokenizer\Collection; use Funivan\PhpTokenizer\Pattern\PatternMatcher; use Funivan\PhpTokenizer\QuerySequence\QuerySequence; $source = "<?php while(){}"; // while (){} $collection = Collection::createFromString($source); (new PatternMatcher($collection))->apply(function (QuerySequence $checker) { $while = $checker->strict('while'); $space = $checker->possible(T_WHITESPACE); if ($checker->isValid()) { $space->remove(); $while->appendToValue(" "); } }); echo (string) $collection;

Documentation

Documentation, (*5)

Testing

bash ./vendor/bin/phpunit, (*6)

Contributing

Please see CONTRIBUTING for details., (*7)

Credits

License

The MIT License (MIT). Please see License File for more information., (*8)

The Versions

11/06 2018

dev-master

9999999-dev https://github.com/funivan/PhpTokenizer

Wrapper around token_get_all. Easy to extract and modify tokens

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

tokenizer

11/06 2018

0.2.0

0.2.0.0 https://github.com/funivan/PhpTokenizer

Wrapper around token_get_all. Easy to extract and modify tokens

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

tokenizer

24/07 2017

0.1.3

0.1.3.0 https://github.com/funivan/PhpTokenizer

Wrapper around token_get_all. Easy to extract and modify tokens

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

tokenizer

20/03 2017

0.1.2

0.1.2.0 https://github.com/funivan/PhpTokenizer

Wrapper around token_get_all. Easy to extract and modify tokens

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

tokenizer

18/07 2016

0.1.2-alpha5

0.1.2.0-alpha5 https://github.com/funivan/PhpTokenizer

Wrapper around token_get_all. Easy to extract and modify tokens

  Sources   Download

MIT

The Requires

 

The Development Requires

tokenizer

16/03 2016

0.1.2-alpha4

0.1.2.0-alpha4 https://github.com/funivan/PhpTokenizer

Wrapper around token_get_all. Easy to extract and modify tokens

  Sources   Download

MIT

The Requires

 

The Development Requires

tokenizer

03/02 2016

0.1.2-alpha3

0.1.2.0-alpha3 https://github.com/funivan/PhpTokenizer

Wrapper around token_get_all. Easy to extract and modify tokens

  Sources   Download

MIT

The Requires

 

The Development Requires

tokenizer

03/02 2016

0.1.2-alpha2

0.1.2.0-alpha2 https://github.com/funivan/PhpTokenizer

Wrapper around token_get_all. Easy to extract and modify tokens

  Sources   Download

MIT

The Requires

 

The Development Requires

tokenizer

30/11 2015

0.1.2-alpha1

0.1.2.0-alpha1 https://github.com/funivan/PhpTokenizer

Wrapper around token_get_all. Easy to extract and modify tokens

  Sources   Download

MIT

The Requires

 

The Development Requires

tokenizer

28/07 2015

0.1.1

0.1.1.0 https://github.com/funivan/PhpTokenizer

Wrapper around token_get_all. Easy to extract and modify tokens

  Sources   Download

MIT

The Requires

 

The Development Requires

tokenizer

14/05 2015

0.1.0

0.1.0.0 https://github.com/funivan/PhpTokenizer

Wrapper around token_get_all. Easy to extract and modify tokens

  Sources   Download

MIT

The Requires

 

The Development Requires

tokenizer