[TYPO3-core] superfluous curly brackets {}

Stefan Neufeind typo3.neufeind at speedpartner.de
Sat Oct 13 11:49:59 CEST 2012


On 10/13/2012 11:07 AM, François Suter wrote:
> Hi,
> 
>> It obviously was introduced with namespace refactoring. I can't find
>> anything about that in the CGL, so I ask you if was done by intention or
>> can be removed?
> 
> This looks weird, I would remove them.

Well, looking into the code it turned out this reads:

  $this->{$offset}

So the variable is inside brackets. And imho that makes it more obvious
that something special happens here: property-name fixed from string
$offset. And in that (rare?) special case I find it more clear / easier
to read than without the brackets. It's even more obvious if you have like:

  $this->{$abc->offset}

or so. So imho the brackets make sense there and I'd favour if we could
add it for the CGL.


Kind regards,
 Stefan


More information about the TYPO3-team-core mailing list