Closed pschelte-extec closed 1 year ago
That's expected as in index.php early line, the service is not loaded yet. This works on module level, you should not touch index.php with custom logic.
You are probably right, but how can you explain that the deprecated error is logged in the DB by ErrorHeroModule and that the user friendly message provided by ErrorHeroModule is displayed instead of the usual basic PHP error ?
here is the message I have in my DB reported by ErrorHeroModule :
Automatic conversion of false to array is deprecated /ec/prod/app/webroot/home/food/safety/food_waste/eu-food-loss-waste-prevention-hub/index.php 10 E_DEPRECATED
That's out of this module scope, again, this is on module level, index.php consume the module on this execution:
this module doesn't covert error to message, it is for logging and trap purpose.
What ZF/Expressive/Laminas/Mezzio application I'm using when issue happen ?
What PHP version you're using?
What ErrorHeroModule version you're using?
What Database you're using?
Expected behavior
I have added \E_DEPRECATED error as a value of the array 'exclude-php-errors' in the config file so E_DEPRACATED errors should be ignored.
Actual behavior
E_DEPRECATED errors are still catched even if I have added \E_DEPRECATED error as a value of the array 'exclude-php-errors' in the config file.
Steps/Codes to reproduce the behavior
in \config\autoload\error-hero-module.global.php
in index.php add this at the first beginning :
<?php $a = false; $a[] = 1;
execute index.php within your app in your browser.
the E_DEPRECATED error is catched by ErrorHeroModule.