[TYPO3-core] Decisions and Changes to Coding Guidelines (CGL)

Oliver Hader oliver.hader at typo3.org
Thu Jan 30 19:30:53 CET 2014


Hi Joey,

Am 30.01.14 15:15, schrieb JoH asenau:
>> *Examples:*
>> - Use (int) instead of intval() or (integer)
>> - Use (bool) instead of boolval() or (boolean)
>> - Use (string) instead of strval()
> 
> Just to clarify this.
> It will be (int) $foo and not (int)$foo, I guess?

It's without additional space:
$bar = (int)$foo;

>> b) When checking if one part starts in another
>> "GeneralUtility::isFirstPartOfStr()" shall be used.
> 
> Is this really the final decision?
> As far as I followed the discussion, the agreement was to deprecate that
> method and use standard PHP functions instead.

Can you please point to the agreement you mention?
Albeit isFirstPartOfStr() is an additional function call, it is more
readable. That does not mean, that all occurrences of strpos() or the
like need to be replaced with isFirstPartOfStr(). It's a suggestion to
use isFirstPartOfStr() instead of a strict ("must") requirement.

All the best,
Olly
-- 
Oliver Hader
TYPO3 CMS Core Team Leader

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org


More information about the TYPO3-team-core mailing list