[TYPO3-core] RFC #16620: bug: Warnings about performing array functions on non-arrays
Jigal van Hemert
jigal at xs4all.nl
Fri Dec 3 11:30:21 CET 2010
Hi Steffen,
On 3-12-2010 11:03, Steffen Kamper wrote:
> in which case is
> $GLOBALS['TBE_STYLES']['spriteIconApi']['iconsAvailable'] empty?
> I don't think we need this check, the others are ok.
It was empty when using the extension in an installation of the reporter
of the bug, but the essence is that the code uses external data (it is
defined outside this class) in a foreach (or any other function which
requires an array) without checking that it is an array. If it were a
parameter (in a new method) it would be correct to use a type hint to
enforce the use of an array.
This is not the most important fix (almost a no-brainer to me), but I
think we should aim for code which doesn't produce PHP warnings.
--
Kind regards / met vriendelijke groet,
Jigal van Hemert
skype:jigal.van.hemert
msn: jigal at xs4all.nl
http://twitter.com/jigalvh
More information about the TYPO3-team-core
mailing list