[TYPO3-core] RFC #7903: Code cleanup: PHP5ize t3lib_extMgm to bring in line with it's documentation.
Oliver Hader
oliver at typo3.org
Wed Mar 19 14:27:02 CET 2008
Hi Kasper,
Kasper Ligaard schrieb:
> This is an SVN patch request.
>
> Type: Code cleanup
>
> Bugtracker references: http://bugs.typo3.org/view.php?id=7903
>
> Branches: TYPO3_4-2
>
> Problem:
> In the documentation for t3lib_extMgm it states:
>
> "This class is never instantiated, rather the methods inside is called
> as functions like t3lib_extMgm::isLoaded('my_extension');"
>
> Now that we have PHP5 as a minimum we should make the function in
> t3lib_extMgm 'public static'. Without running 'public static' E_STRICT
> warnings are given to people using the class as documented, and not
> giving errors to people using it wrongly (e.g. instantiating it)
>
> Solution:
> The attached patch adds 'public static' to all the function of
> t3lib_extMgm.
>
> Notes:
> - I know Typo3 does not use E_STRICT, but I still think the proposed
> change would benefit all.
> - This patch request is similar to
> http://bugs.typo3.org/view.php?id=7350
> - I have found no place in Typo3 where t3lib_extMgm are instantiated, so
> this change should be safe.
> - I have never met places on the web where t3lib_extMgm are not
> correctly used, so (again) this change should be safe.
>
> PS: This is my first patch request. Please tell me if something was done
> wrong :-)
Great! Your first RFC looks good, thank you! :-)
+1 for using "public static function"
What do you think about using type hints like in t3lib_div, e.g.
public static function addTCAcolumns($table, array $columnArray,
$addTofeInterface=0) {
olly
--
Oliver Hader
TYPO3 Core Team
More information about the TYPO3-team-core
mailing list