eZ Community » Forums » General » PHP Code beautify
expandshrink

PHP Code beautify

PHP Code beautify

Friday 16 February 2007 5:42:16 pm - 1 reply

Waterproof released their nice PHP Code beautifier also as Linux version.
You can fetch it from http://www.waterproof.fr/products/phpCodeBeautifier/
It is really helpful.

I made a tiny shell script that uses it to match with the eZ coding style ( usefull for network etc ).

#!/bin/bash
./phpCB -space-before-end-bracket \
                -space-after-start-bracket \
                -space-after-end-angle-bracket \
                -extra-padding-for-case-statement \
                -one-true-brace-function-declaration \
                -change-shell-comment-to-double-slashes-comment \
                -force-large-php-code-tag \
                -force-true-false-null-contant-lowercase \
                --comment-rendering-style PHPDoc \
                --equal-align-position 50 \
                --padding-char-count 4 \
                $1

I thought you might find that useful. Here an idea how to check coding style:

./beautify ugly.php > beauty.php && diff --side-by-side ugly.php beauty.php

Because it is still just a computer programm, it helps but might also have disadvantages in specific situations.

Saturday 17 February 2007 12:38:41 pm

A simple way to cleanup php code
(in your module, extension, etc)
to meet the eZ publish php code standard!

Hey that's pretty neat!

//kracker

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from