TASK: Support at least PHP 5.6

* Adjust CI , composer and docs.
* Migrate modern code to 5.6 supported code.

Relates: #71
This commit is contained in:
Daniel Siepmann 2017-04-27 14:16:22 +02:00
parent b9bdd5dd3b
commit 510774a3cc
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
5 changed files with 29 additions and 6 deletions

View file

@ -41,12 +41,20 @@ lint:php-mass-detection:
script: script:
- ./vendor/bin/phpmd src text phpmd.xml > result/phpmd.txt - ./vendor/bin/phpmd src text phpmd.xml > result/phpmd.txt
test:7.1: &PHP-UNITTESTING test:5.6: &PHP-UNITTESTING
image: php:7.1-alpine image: php:5.6-alpine
stage: test stage: test
script: script:
- ./vendor/bin/phpunit - ./vendor/bin/phpunit
test:7.0:
<<: *PHP-UNITTESTING
image: php:7.0-alpine
test:7.1:
<<: *PHP-UNITTESTING
image: php:7.1-alpine
test:latest: test:latest:
<<: *PHP-UNITTESTING <<: *PHP-UNITTESTING
image: php:7-alpine image: php:7-alpine

View file

@ -19,7 +19,8 @@ Requirements
To install the project you need ``composer`` to be installed and inside your ``$PATH``. To install the project you need ``composer`` to be installed and inside your ``$PATH``.
Otherwise run ``make install-composer`` to install composer. Otherwise run ``make install-composer`` to install composer.
At least PHP 7.1 is required. We recommend to use at least PHP 5.6, we do not test with lower versions as 5.6 is latest maintained
version.
Installation Installation
============ ============

View file

@ -23,7 +23,7 @@
] ]
}, },
"require": { "require": {
"php": "~7.1", "php": ">=5.6",
"helmich/typo3-typoscript-parser": "1.1.*", "helmich/typo3-typoscript-parser": "1.1.*",
"squizlabs/php_codesniffer": "2.8.*", "squizlabs/php_codesniffer": "2.8.*",
"symfony/yaml": "3.2.*", "symfony/yaml": "3.2.*",

View file

@ -49,10 +49,17 @@ abstract class AbstractYamlRemovedUsage implements FeatureInterface
$this->sniff = $sniff; $this->sniff = $sniff;
$this->configured = new RemovedByYamlConfiguration( $this->configured = new RemovedByYamlConfiguration(
$this->getRemovedConfigFiles(), $this->getRemovedConfigFiles(),
\Closure::fromCallable([$this, 'prepareStructure']) $this->getPrepateStructure()
); );
} }
protected function getPrepateStructure()
{
return function (array $typo3Versions) {
return call_user_func_array([$this, 'prepareStructure'], [$typo3Versions]);
};
}
/** /**
* Prepares structure from config for later usage. * Prepares structure from config for later usage.
* *

View file

@ -39,10 +39,17 @@ abstract class AbstractGenericUsage implements PhpCsSniff
{ {
$this->configured = new RemovedByYamlConfiguration( $this->configured = new RemovedByYamlConfiguration(
$this->getRemovedConfigFiles(), $this->getRemovedConfigFiles(),
\Closure::fromCallable([$this, 'prepareStructure']) $this->getPrepateStructure()
); );
} }
protected function getPrepateStructure()
{
return function (array $typo3Versions) {
return call_user_func_array([$this, 'prepareStructure'], [$typo3Versions]);
};
}
/** /**
* Prepares structure from config for later usage. * Prepares structure from config for later usage.
* *