https://github.com/franzliedke/php-array-shortener
A CLI tool that converts PHP files to use the new PHP 5.4+ shorthand array syntax
https://github.com/franzliedke/php-array-shortener
Last synced: 11 days ago
JSON representation
A CLI tool that converts PHP files to use the new PHP 5.4+ shorthand array syntax
- Host: GitHub
- URL: https://github.com/franzliedke/php-array-shortener
- Owner: franzliedke
- Created: 2012-12-28T12:37:18.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2021-04-08T22:57:31.000Z (about 4 years ago)
- Last Synced: 2025-04-11T21:52:13.900Z (11 days ago)
- Language: PHP
- Size: 22.5 KB
- Stars: 14
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
PHP Array Shortener
===================
A CLI tool that converts PHP files to use the new PHP 5.4+ shorthand array syntax.
Installation
------------After downloading, make sure you have [Composer](http://getcomposer.org) installed and run `composer install`.
Usage
-----In your command line, run:
php shortener shorten
This will print the converted code to the command line so that you can pipe it to another file, for example.
To convert all PHP files in an entire directory, run:
php shortener shorten
To convert all PHP files in an entire directory and all of its subdirectories, run either of the following two commands:
php shortener shorten -r
php shortener shorten --recursiveAll converted files will be written to the `shortened_files` directory. If you want to change that behavior (e.g. to convert existing files directly), provide the `output` option:
php shortener shorten -o
php shortener shorten --output