[Neos] CGL Questions

Rens Admiraal rens.admiraal at typo3.org
Mon Oct 14 23:39:39 CEST 2013


Thanks for the feedback ;) I actually had some discussion with Stefano 
from the QA team yesterday, and I wrote a composer plugin for the 
installation of the codesniffs. Tonight Stefano merged my changes 
upstream, so I'll add the stuff to the base distributions tomorrow so we 
at least have the possibility to run the sniffs like running phpunit (it 
can also be added to your IDE then).

Also big thanks for all the reviews today ;-) Nice that we managed to 
have most of the changes out of the queue by now already ;-)

Greetz,
Rens


Bastian Waidelich schreef op 10/14/13 11:00 :
> Rens Admiraal wrote:
>
> Hey Rens,
>
> thanks for all your cleanup work during the weekend, I'd like to
> nominate you "Flow housekeeper of the month"!
>
>> I did some tries with the QA team a while ago to get the QA-Teams sniff
>> packages compatible with Flow. It seems like they didn't do anything
>> with it yet, so I'll do another try in some lost minutes... But more
>> important I think it's a good thing if we start running the codesniffs
>> regularly.
>
> +1 did you give it another try in the meantime? ;)
>
>
>> * Usage of functions in foreach / if / for / switch statements
>> Do we allow this? For example:
>>
>>      foreach ($this->getSomeArray() as $v) { ....
>
> I think there is no reason not to allow this. Especially for foreach()
> as PHP creates a copy of the subject anyways.
> For if, for & switch I don't see a problem either. The function will
> only be executed once in any case.
> Only drawback *could* be lack of readability, and here other CGL rules
> apply. So I'd be in favor not adding a rule for this specifically.
>
>
>> * Do we allow empty catch statements?
>> Example:
>>
>>      } catch (\Exception $e) { // just some comments or nothing }}
>
> Why not and what else to do? I mean it's usually an indicator for a
> clumsy architecture but I don't think that we should add this to the
> CGL. We could however extend the CGL-section at some point adding more
> architectural topics (like composition over inheritance etc)
>
>
>> * How do we format use statements?
>> Will we use 1 use statement like:
>>
>>      use    Class 1,
>>          Class 2;
>>
>> Or do we add all use statements on a new line?
>
> As Aske wrote, we decided to go for one use statement per line for now.
> This is also mentioned in the latest version of the CGL[1]
>
>
>
> [1]
> http://docs.typo3.org/flow/TYPO3FlowDocumentation/latest/TheDefinitiveGuide/PartV/CodingGuideLines/PHP.html#importing-namespaces
>
>
>



More information about the Neos mailing list