dg / composer-backslasher
Composer plugin that speeds up your application by adding backslashes to all PHP internal functions and constants.
Installs: 17 795
Dependents: 0
Suggesters: 0
Security: 0
Stars: 40
Watchers: 9
Forks: 3
Open Issues: 0
Type:composer-plugin
Requires
- php: >=5.4.0
- composer-plugin-api: ^1.0
- nikic/php-parser: ^2.0 || ^3.0 || ^4.0
Requires (Dev)
- nette/tester: ^1.7
README
Composer plugin that speeds up your application by adding backslashes to all PHP internal functions and constants in /vendor
.
Does not modify files of your application.
Installation
composer require dg/composer-backslasher
Then simply use composer update
.
How it works?
It simply turns this code:
namespace A; if (preg_match('/(foo)(bar)(baz)/', 'foobarbaz', $matches, PREG_OFFSET_CAPTURE)) { // ... }
into this code:
namespace A; if (\preg_match('/(foo)(bar)(baz)/', 'foobarbaz', $matches, \PREG_OFFSET_CAPTURE)) { // ... }
to avoid double lookup for global functions and constants.
Configuration
If you want to ignore certain functions or constants, specify them in the configuration.
Simply add a extra > backslasher-ignore
section to composer.json
file:
{ "extra": { "backslasher-ignore": [ "GuzzleHttp\\Promise\\each" ] } }
Support Project
Do you like Composer Backslasher? Are you looking forward to the new features?