Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Look for fatal errors before syntax errors #105

Merged
merged 3 commits into from
Aug 13, 2018

Conversation

cjhaas
Copy link
Contributor

@cjhaas cjhaas commented Nov 6, 2017

I was banging my head all morning until I finally understood what the problem was in #90

This PR prioritizes fatal errors above parser errors, essentially errors above warnings.

I ran into the exact same problem mentioned by the OP, I had declare(strict_types=1); at the head of my file which is a warning for older versions of PHP but I also accidentally included a return type on one of my functions which is a fatal error for older versions. The warning can usually be safely ignored so the error should be exposed first.

@@ -47,8 +47,16 @@ public function hasSyntaxError()
public function getSyntaxError()
{
if ($this->hasSyntaxError()) {
//Look for fatal errors first
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just code style: Please add space after // and then I will merge it :)

@JakubOnderka JakubOnderka merged commit 8198205 into JakubOnderka:master Aug 13, 2018
@JakubOnderka
Copy link
Owner

Thanks, merged.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants