Skip to content

Commit

Permalink
Merge pull request #643 from kylekatarnls/feature/php-53-support
Browse files Browse the repository at this point in the history
Revert #528 as CI tool is not a sufficient reason to drop a PHP version
  • Loading branch information
kylekatarnls committed Jul 30, 2019
2 parents 3a82eab + 8c57412 commit 4a8a567
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ language: php

matrix:
include:
- php: 5.3
dist: precise
- php: 5.3
dist: precise
env: DEPENDENCIES=low
- php: 5.4
dist: trusty
- php: 5.4
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"minimum-stability": "stable",
"require": {
"php": ">=5.4.0",
"php": ">=5.3.9",
"pdepend/pdepend": "^2.5",
"ext-xml": "*"
},
Expand Down
5 changes: 3 additions & 2 deletions src/main/php/PHPMD/Renderer/JSONRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private function initReportData()
*/
private function addViolationsToReport(Report $report, array $data)
{
$filesList = [];
$filesList = array();
/** @var RuleViolation $violation */
foreach ($report->getRuleViolations() as $violation) {
$fileName = $violation->getFileName();
Expand Down Expand Up @@ -121,7 +121,8 @@ private function addErrorsToReport(Report $report, array $data)
*/
private function encodeReport($data)
{
$encodeOptions = JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_PRETTY_PRINT;
$encodeOptions = JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP |
(defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 0);

return json_encode($data, $encodeOptions);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/PHPMD/Rule/CleanCode/MissingImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MissingImport extends AbstractRule implements MethodAware, FunctionAware
/**
* @var array Self reference class names.
*/
protected $selfReferences = ['self', 'static'];
protected $selfReferences = array('self', 'static');

/**
* Checks for missing class imports and warns about it
Expand Down
2 changes: 1 addition & 1 deletion src/site/rst/download/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ PHPMD itself is considered as an early development version at its
current state. It relies on the following software products:

- `PHP_Depend >= 2.0.0`__
- `PHP >= 5.4.0`__
- `PHP >= 5.3.9`__

__ https://github.com/phpmd/phpmd
__ http://getcomposer.org/composer.phar
Expand Down

0 comments on commit 4a8a567

Please sign in to comment.