-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:nilportugues/php_backslasher
- Loading branch information
Showing
9 changed files
with
17 additions
and
387 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,54 +10,30 @@ Function resolution without the backslash forces the PHP internals to verify for | |
**Idea from Nikita Popov talk**: | ||
- [PHP 7 – What changed internally? (PHP Barcelona 2015)](http://www.slideshare.net/nikita_ppv/php-7-what-changed-internally-php-barcelona-2015) (slide [72](http://image.slidesharecdn.com/php7internals-151101105627-lva1-app6891/95/php-7-what-changed-internally-php-barcelona-2015-72-638.jpg?cb=1446375542)) | ||
|
||
## Usage | ||
|
||
``` | ||
$ php bin/php_backslasher fix <path/to/directory> | ||
``` | ||
|
||
|
||
## Installation | ||
|
||
### As a dependency using Composer | ||
Use [Composer](https://getcomposer.org) to install the package: | ||
|
||
``` | ||
$ composer require nilportugues/php_backslasher | ||
``` | ||
|
||
### As a PHAR file | ||
|
||
You can also use already last built `.phar`. | ||
## Usage | ||
|
||
``` bash | ||
$ git clone [email protected]:nilportugues/php_backslasher.git | ||
$ cd php_backslasher | ||
$ php build/php_backslasher.phar | ||
``` | ||
|
||
You can copy the `.phar` file as a global script | ||
|
||
``` bash | ||
$ cp build/php_backslasher.phar /usr/local/bin/php_backslasher | ||
$ php bin/php_backslasher fix <path/to/directory> | ||
``` | ||
|
||
###Output | ||
|
||
## Building the PHAR: | ||
Works for function in conditional statements, negative conditionals, placed in an array as key or value and any other normal use. | ||
|
||
While the PHAR file is included under `bin/php_backslasher`, but can be built using the following command: | ||
```php | ||
echo strlen('Hello World'); | ||
|
||
// becomes: | ||
echo \strlen('Hello World'); | ||
``` | ||
$ php -d phar.readonly=false box.phar build | ||
``` | ||
|
||
You may also like to make it runnable by just giving it permissions to be used as an executable file and hide its extension. | ||
|
||
``` | ||
$ chmod 755 bin/php_backslasher.phar | ||
$ mv bin/php_backslasher.phar bin/php_backslasher | ||
``` | ||
|
||
|
||
|
||
## Contribute | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,6 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
require_once __DIR__ . '/../src/bootstrap.php'; | ||
|
||
/** | ||
* This file is part of the php_backslasher package | ||
* | ||
* Copyright (c) 2014 Marc Morera | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* Feel free to edit as you please, and have fun. | ||
* | ||
* @author Marc Morera <[email protected]> | ||
*/ | ||
|
||
require __DIR__ . '/../src/bootstrap.php'; | ||
|
||
use NilPortugues\BackslashFixer\Console\Application; | ||
|
||
error_reporting(-1); | ||
ini_set('display_errors', 1); | ||
|
||
// run the command application | ||
$application = new Application(); | ||
$application = new \NilPortugues\BackslashFixer\Console\Application(); | ||
$application->run(); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.