You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use Statements are not getting checked for existence during the Generation step. This can create issues where you will get a fatal error During class fetch. I noticed this specifically when working with error exceptions.
namespace My\Stuff;
use Throwable;
use Phalcon\Views\Exception as ViewException // Note the misspellinguse Phalcon\Di\Injectable;
use Phalcon\Events\EventInterface;
use Phalcon\Dispatcher\DispatcherInterface;
class Listener extends Injectable
{
publicfunctionbeforeException(<EventInterface> event, <DispatcherInterface> dispatcher, <Throwable> exception)
{
try {
throw exception;
} catch ViewException {
thrownew \Exception("Reached");
} catch Error {
// Never Reached
}
}
}
In the psudo code above, I am referencing the wrong path for the exception (note the extra 's'). When the throw occurs in the beforeException method, it will cause the fatal error During class fetch with no other details. Normally I would not bother creating an issue for this, except that I have no warnings in the Generate step indicating that the Class doesn't exist at compile time. It took me the better part of several hours to understand what was the issue and a lot of commenting out of code sections.
The text was updated successfully, but these errors were encountered:
use
Statements are not getting checked for existence during the Generation step. This can create issues where you will get a fatal errorDuring class fetch
. I noticed this specifically when working with error exceptions.In the psudo code above, I am referencing the wrong path for the exception (note the extra 's'). When the throw occurs in the beforeException method, it will cause the fatal error
During class fetch
with no other details. Normally I would not bother creating an issue for this, except that I have no warnings in the Generate step indicating that theClass doesn't exist at compile time
. It took me the better part of several hours to understand what was the issue and a lot of commenting out of code sections.The text was updated successfully, but these errors were encountered: