Skip to content

Commit 4b615f4

Browse files
committed
Fixed bug #20097 : CLI.php throws error in php 5.2
1 parent 5ea0972 commit 4b615f4

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

CodeSniffer/CLI.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,7 @@ public function processLongArgument($arg, $pos, $values)
307307
exit(0);
308308
break;
309309
case 'version':
310-
$phpcs = new PHP_CodeSniffer();
311-
echo 'PHP_CodeSniffer version '.$phpcs::VERSION.' ('.$phpcs::STABILITY.') ';
310+
echo 'PHP_CodeSniffer version '.PHP_CodeSniffer::VERSION.' ('.PHP_CodeSniffer::STABILITY.') ';
312311
echo 'by Squiz (http://www.squiz.net)'.PHP_EOL;
313312
exit(0);
314313
break;

CodeSniffer/Reports/Junit.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,8 @@ public function generate(
6666
$out->setIndent(true);
6767
$out->startDocument('1.0', 'UTF-8');
6868

69-
$phpcs = new PHP_CodeSniffer;
70-
7169
$out->startElement('testsuites');
72-
$out->writeAttribute('name', 'PHP_CodeSniffer '.$phpcs::VERSION);
70+
$out->writeAttribute('name', 'PHP_CodeSniffer '.PHP_CodeSniffer::VERSION);
7371
$out->writeAttribute('tests', $tests);
7472
$out->writeAttribute('failures', $errors);
7573

CodeSniffer/Reports/Xml.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@ public function generate(
5555
$out->openMemory();
5656
$out->setIndent(true);
5757
$out->startDocument('1.0', 'UTF-8');
58-
59-
$phpcs = new PHP_CodeSniffer;
6058
$out->startElement('phpcs');
61-
$out->writeAttribute('version', $phpcs::VERSION);
59+
$out->writeAttribute('version', PHP_CodeSniffer::VERSION);
6260

6361
$errorsShown = 0;
6462

package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
2626
</stability>
2727
<license uri="https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt">BSD 3-Clause License</license>
2828
<notes>
29+
- Fixed bug #20097 : CLI.php throws error in php 5.2
2930
- Fixed bug #20100 : incorrect Function mysql() has been deprecated report
3031
</notes>
3132
<contents>

0 commit comments

Comments
 (0)