Skip to content

Instantly share code, notes, and snippets.

@koriym
Created April 5, 2012 01:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koriym/2307109 to your computer and use it in GitHub Desktop.
Save koriym/2307109 to your computer and use it in GitHub Desktop.
PSR-1 formart.
Converted about PHP files from dos format to unix format:
for file in $(find . -name *.php); do dos2unix $file; done;
Expanded all multi-line use statements.
for file in $(find . -name "*.php"); do php -r 'file_put_contents($argv[1],preg_replace_callback("(use (\s*[a-zA-Z0-9\\\\]+(\s*as[\sa-zA-Z0-9]+)?[,;])+)",function($m){return preg_replace("(,\s*([^,;]+))",";\nuse \\1",$m[0]);},file_get_contents($argv[1])));' $file; done;
Removed all trailing whitespaces.
for file in $(find . -type f | grep -v \.git); do sed -i -E 's/[[:space:]]*$//' $file; done;
---
https://github.com/zendframework/zf2/pull/1001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment