Issues

ZF-7316: Cleaning all the code

Description

Some files contain CRLF:


find . -name '*.php' -print0 | xargs -0 sed --regexp-extended --in-place 's/\r\n/\n/g'

Some files contain TABS:


find . -name '*.php' -print0 | xargs -0 sed --regexp-extended --in-place 's/\t/    /g'

Some files contain endline spaces:


find . -name '*.php' -print0 | xargs -0 sed --regexp-extended --in-place 's/[ ]*$//g'

By running this 3 commands on the top of standard directory. It could be applied to library and tests.

After that, a pre-commit hook could be added to test all of them (but it's another history ;) )

Comments

I agree : As time goes, ZF code gets worse and worse written. Hang on : I'm actually not shouting at ZF or ZF contributors ;-), but that is just a point of view after having reviewed thousands of lines of codes for years now.

We can see sometimes public members in classes but they shouldn't be public, or protected ones but that don't start with an underscore. Lot of code is not PHPDocumented as well...

As some problems could break BC and should wait for 2.0 , the "tabs, spaces, and CRLF" problem can be patched safely ;-)

I make simple cross referrence by Open Office 3.1

Update cross reference.

I have created children issues that class has CRLFs in their line ends.

Fixed all files in core: CRLF -> LF TAB -> 4 Spaces No ending spaces

Corresponding commits should be merged into release branch. I've just done it for Zend_Search_lucene (ZF-7530 subtask).

For me it is impossible to know if a given change is allowed to be branched or not because trunk contains code for the next minor release.

Therefor this change was not branched.

Many of the changes made for this issue may conflict with changes previously merged to the release branch. As this is simply a minor correction and does not impact functionality, I'd prefer we not merge to the release branch and instead wait until the next minor release.

Closing.