Skip to content

Commit 9f8d6a6

Browse files
committed
Fixed bug #1615 : Uncaught RuntimeException when phpcbf fails to fix files
1 parent 121d545 commit 9f8d6a6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
8282
- Fixed bug #1591 : Autoloader failing to load arbitrary files when installed_paths only set via a custom ruleset
8383
- Fixed bug #1605 : Squiz.WhiteSpace.OperatorSpacing false positive on unary minus after comment
8484
-- Thanks to Juliette Reinders Folmer for the patch
85+
- Fixed bug #1615 : Uncaught RuntimeException when phpcbf fails to fix files
8586
- Fixed bug #1637 : Generic.WhiteSpaceScopeIndent closure argument indenting incorrect with multi-line strings
8687
- Fixed bug #1638 : Squiz.WhiteSpace.ScopeClosingBrace closure argument indenting incorrect with multi-line strings
8788
- Fixed bug #1640 : Squiz.Strings.DoubleQuoteUsage replaces tabs with spaces when fixing

src/Fixer.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,10 @@ public function fixFile()
203203

204204
if ($this->numFixes > 0) {
205205
if (PHP_CODESNIFFER_VERBOSITY > 1) {
206-
@ob_end_clean();
206+
if (ob_get_level() > 0) {
207+
ob_end_clean();
208+
}
209+
207210
echo "\t*** Reached maximum number of loops with $this->numFixes violations left unfixed ***".PHP_EOL;
208211
ob_start();
209212
}

0 commit comments

Comments
 (0)