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

Michiel Roos michiel at maxserv.nl
Thu Jan 30 15:33:58 CET 2014


Well, as far as I am concerned GeneralUtility::isFirstPartOfStr() this is not the way to go.

Sometimes we need to check if something is the last part of a string and sometimes we need to check if something is somewhere in the middle of a string.

Do we create:
* GeneralUtility::isLastPartOfStr()
* GeneralUtility::isPartOfStrAtPosition()

To handle those cases? If not, then so much for consistency.

Here is some more discussion about this topic: http://forge.typo3.org/issues/54517#note-4

Most uses that currently use strpos and or substr to check if something is the first part of a string actually have a string as needle and a string as haystack to check against. This means the additional check and casts in GeneralUtility::isFirstPartOfStr() are needless overhead.

If you wish I can do some nice method counts and performance benchmarks to illustrate my point.



More information about the TYPO3-team-core mailing list