Skip to content

switch back to the original error_reporting level #488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 16, 2015

Conversation

gimler
Copy link
Contributor

@gimler gimler commented Feb 11, 2015

Instate of switching to a high error reporting level switch back to last error reporting level

@@ -188,12 +188,13 @@ protected function printFooter()
{
// Turn off errors so we don't get timezone warnings if people
// don't have their timezone set.
$errorLevel = error_reporting();
error_reporting(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Just do $errorLevel = error_reporting(0); instead of adding extra line because error_reportring function, if I'm not mistaken always returns previous error level.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you are right i have changed this

@aik099
Copy link
Contributor

aik099 commented Feb 11, 2015

👍 , I wonder how you're able to find this place. The only reason would be, when PHP_CodeSniffer's PHP files are included in other project that had some errors in it.

@gsherwood
Copy link
Member

If you include CLI.php to actually run PHPCS, error reporting is set for you. CLI is required for any sort of checking or reporting functionality, so it would be pretty hard to get the error reporting level set to anything other than E_ALL | E_STRICT.

But I'll still merge the code in because it wont break anything. I assume PHP_CodeSniffer must be being used in a different way in this case, causing a problem.

gsherwood added a commit that referenced this pull request Feb 16, 2015
switch back to the original error_reporting level
@gsherwood gsherwood merged commit 04994fe into squizlabs:master Feb 16, 2015
jrfnl added a commit to jrfnl/PHP_CodeSniffer that referenced this pull request Jul 29, 2024
…e-after-cast

Generic/SpaceAfterCast: improve code coverage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants