Issue Task Closed

#73053Error "Could not analyse class XY" may hide useful PHP warning

Xavier Perseguers 02/01/16, 10:10 updated 10/02/18, 11:20

Description

After creating a VH, I systematically got an error:

#1289386765: Could not analyse class: "VendorName\ExtensionKey\ViewHelpers\ResponsiveImageViewHelper" maybe not loaded or no autoloader?

I really did not get why it failed although typo3temp/autoload had been flushed, no opcode whatsoever.

Finally, digging into the Core and breaking where the exception occured, I had a look at the actual exception and found a PHP warning:

PHP Warning: Declaration of VendorName\ExtensionKey\ViewHelpers\ResponsiveImageViewHelper::render($src = NULL, $width = NULL, $height = NULL, $minWidth = NULL, $minHeight = NULL, $maxWidth = NULL, $maxHeight = NULL, $treatIdAsReference = false, $image = NULL) should be compatible with TYPO3\CMS\Fluid\ViewHelpers\ImageViewHelper::render($src = NULL, $width = NULL, $height = NULL, $minWidth = NULL, $minHeight = NULL, $maxWidth = NULL, $maxHeight = NULL, $treatIdAsReference = false, $image = NULL, $crop = NULL, $absolute = false) in /path/to/extension_key/Classes/ViewHelpers/ResponsiveImageViewHelper.php line 27 (More information)

This is highly valuable debugging information and should not get hidden.

Reviews 2