From dc339c566bff392bf5046ab31440e6d0714e8564 Mon Sep 17 00:00:00 2001 From: Libor M Date: Sun, 18 Oct 2020 14:49:28 +0200 Subject: [PATCH 01/15] PHP 8.0 in Travis --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 9521f9c..068f76c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,13 +9,18 @@ php: - 7.2 - 7.3 - hhvm + - nightly matrix: + include: + - php: nightly + env: DEPENDENCIES="--ignore-platform-reqs" allow_failures: - php: 7.1 - php: 7.2 - php: 7.3 - php: hhvm + - php: nightly env: global: From 170bde485684414e0e1b2d1bfa51c049d260a64c Mon Sep 17 00:00:00 2001 From: Libor M Date: Sun, 18 Oct 2020 14:55:35 +0200 Subject: [PATCH 02/15] travis - fix OS for PHP 5.3, 5.4, 5.5 --- .travis.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.travis.yml b/.travis.yml index 068f76c..0c2697a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,9 @@ language: php +dist: xenial + php: + - 5.3 - 5.4 - 5.5 - 5.6 @@ -8,13 +11,27 @@ php: - 7.1 - 7.2 - 7.3 + - 7.4 - hhvm - nightly matrix: include: + - php: 5.3 + dist: precise + - php: 5.4 + dist: trusty + - php: 5.5 + dist: trusty - php: nightly env: DEPENDENCIES="--ignore-platform-reqs" + exclude: + - php: 5.3 + dist: xenial + - php: 5.4 + dist: xenial + - php: 5.5 + dist: xenial allow_failures: - php: 7.1 - php: 7.2 From f528b1aa0698e46afc1a9ac2dfd46d42a15670ab Mon Sep 17 00:00:00 2001 From: Libor M Date: Sun, 18 Oct 2020 15:10:52 +0200 Subject: [PATCH 03/15] skip pclzip notice --- tests/Common/Tests/Adapter/Zip/AbstractZipAdapterTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Common/Tests/Adapter/Zip/AbstractZipAdapterTest.php b/tests/Common/Tests/Adapter/Zip/AbstractZipAdapterTest.php index c95eae7..f434212 100644 --- a/tests/Common/Tests/Adapter/Zip/AbstractZipAdapterTest.php +++ b/tests/Common/Tests/Adapter/Zip/AbstractZipAdapterTest.php @@ -52,7 +52,8 @@ public function testAddFromString() $adapter = $this->createAdapter(); $adapter->open($this->zipTest); - $this->assertSame($adapter, $adapter->addFromString($expectedPath, $expectedContent)); + // pclzip/pclzip library trow notice/warning in PHP 7.1+, issue: https://github.com/ivanlanin/pclzip/pull/8 + @$this->assertSame($adapter, $adapter->addFromString($expectedPath, $expectedContent)); $adapter->close(); $this->assertTrue(TestHelperZip::assertFileExists($this->zipTest, $expectedPath)); From 2c97a86d46b63099a2296d83be374ca9a25af302 Mon Sep 17 00:00:00 2001 From: Libor M Date: Sun, 18 Oct 2020 15:42:26 +0200 Subject: [PATCH 04/15] fix php 5 travis --- .travis.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0c2697a..b9695ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ language: php dist: xenial php: - - 5.3 - 5.4 - 5.5 - 5.6 @@ -17,8 +16,6 @@ php: matrix: include: - - php: 5.3 - dist: precise - php: 5.4 dist: trusty - php: 5.5 @@ -26,8 +23,6 @@ matrix: - php: nightly env: DEPENDENCIES="--ignore-platform-reqs" exclude: - - php: 5.3 - dist: xenial - php: 5.4 dist: xenial - php: 5.5 @@ -43,13 +38,16 @@ env: global: ## - secure: "LtlUOzC8FtqgbqUTmU7EU281NSCb58UFdvnz8lelNIDltBdP4eayN/TsgNIePB4jXg2d2R56ZA6j/grhE/md6jdUkulV355H3GrH/hIZmmQ+F9+87agnwLzb9+MJbqXoiE7VvjY3zGIO09G897SUfsfu6JWEcscYFlsH6KcXM6M=" -before_script: +before_install: ## Packages - - sudo apt-get -qq update > /dev/null - - sudo apt-get -qq install graphviz > /dev/null + - sudo rm -f /etc/apt/sources.list.d/mongodb.list # Makes apt crash on Precise, and we don't need MongoDB + - sudo apt-get update -qq + - sudo apt-get install -y graphviz + +before_script: ## Composer - composer self-update - - composer install --prefer-source --dev + - travis_wait composer install --prefer-source --dev $(if [ -n "$DEPENDENCIES" ]; then echo $DEPENDENCIES; fi) ## PHPDocumentor - mkdir -p build/docs - mkdir -p build/coverage From 3a582000370d9bfe61f785ce902141d82949b459 Mon Sep 17 00:00:00 2001 From: Libor M Date: Sun, 18 Oct 2020 16:22:13 +0200 Subject: [PATCH 05/15] remove hhvm --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b9695ca..d5c36ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,6 @@ php: - 7.2 - 7.3 - 7.4 - - hhvm - nightly matrix: @@ -31,7 +30,6 @@ matrix: - php: 7.1 - php: 7.2 - php: 7.3 - - php: hhvm - php: nightly env: From 45cb53ca098d0a0a2409c3c2b90b60b369fe80f8 Mon Sep 17 00:00:00 2001 From: Libor M Date: Sun, 18 Oct 2020 16:22:20 +0200 Subject: [PATCH 06/15] update packages --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 2a75a30..ec43e92 100644 --- a/composer.json +++ b/composer.json @@ -22,9 +22,9 @@ "phpunit/phpunit": "^4.8.36 || ^7.0", "phpdocumentor/phpdocumentor":"2.*", "phpmd/phpmd": "2.*", - "sebastian/phpcpd": "2.*", - "phploc/phploc": "2.*", - "squizlabs/php_codesniffer": "2.*" + "sebastian/phpcpd": "2.* || 3.* || 4.* || 5.* || 6.*", + "phploc/phploc": "2.* || 3.* || 4.* || 5.* || 6.* || 7.*", + "squizlabs/php_codesniffer": "2.* || ^3.5" }, "autoload": { "psr-4": { From 78c2372db4922bceee925b14e7392216399dc5c8 Mon Sep 17 00:00:00 2001 From: Libor M Date: Sun, 18 Oct 2020 16:33:13 +0200 Subject: [PATCH 07/15] allow php 5.3 --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index d5c36ac..07e7b46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ language: php dist: xenial php: + - 5.3 - 5.4 - 5.5 - 5.6 @@ -15,6 +16,8 @@ php: matrix: include: + - php: 5.3 + dist: precise - php: 5.4 dist: trusty - php: 5.5 @@ -22,6 +25,8 @@ matrix: - php: nightly env: DEPENDENCIES="--ignore-platform-reqs" exclude: + - php: 5.3 + dist: xenial - php: 5.4 dist: xenial - php: 5.5 From 003217f02027c9417fc62d50d2cfb31d1a8003c4 Mon Sep 17 00:00:00 2001 From: Libor M Date: Sun, 18 Oct 2020 16:33:54 +0200 Subject: [PATCH 08/15] not fail test 7.1, 7.2, 7.3 --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 07e7b46..df1dc29 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,9 +32,6 @@ matrix: - php: 5.5 dist: xenial allow_failures: - - php: 7.1 - - php: 7.2 - - php: 7.3 - php: nightly env: From 52ce87b76e343964ede8aae359072ac29ec815f7 Mon Sep 17 00:00:00 2001 From: Libor M Date: Sun, 18 Oct 2020 16:38:29 +0200 Subject: [PATCH 09/15] PHP 8.0 - depracated libxml_disable_entity_loader, is disabled by default --- src/Common/XMLReader.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Common/XMLReader.php b/src/Common/XMLReader.php index 6c720ae..3a6669a 100644 --- a/src/Common/XMLReader.php +++ b/src/Common/XMLReader.php @@ -71,10 +71,14 @@ public function getDomFromZip($zipFile, $xmlFile) */ public function getDomFromString($content) { - $originalLibXMLEntityValue = libxml_disable_entity_loader(true); + if (\PHP_VERSION_ID < 80000) { + $originalLibXMLEntityValue = libxml_disable_entity_loader(true); + } $this->dom = new \DOMDocument(); $this->dom->loadXML($content); - libxml_disable_entity_loader($originalLibXMLEntityValue); + if (\PHP_VERSION_ID < 80000) { + libxml_disable_entity_loader($originalLibXMLEntityValue); + } return $this->dom; } From a8f31b8193d8dccfa27fd01b178532d731f81c44 Mon Sep 17 00:00:00 2001 From: Libor M Date: Sun, 18 Oct 2020 16:42:47 +0200 Subject: [PATCH 10/15] travis - PHP 5.x require more memory --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index df1dc29..7d35440 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,6 +47,8 @@ before_install: before_script: ## Composer - composer self-update + ## Composer in PHP versions 5.x requires 3 GB memory + - if [ ${TRAVIS_PHP_VERSION:0:2} == "5." ]; then export COMPOSER_MEMORY_LIMIT=3G ; fi - travis_wait composer install --prefer-source --dev $(if [ -n "$DEPENDENCIES" ]; then echo $DEPENDENCIES; fi) ## PHPDocumentor - mkdir -p build/docs From 7a368c470105d9d586496255e49fc03e15b8ddcd Mon Sep 17 00:00:00 2001 From: Libor M Date: Sun, 18 Oct 2020 16:57:48 +0200 Subject: [PATCH 11/15] coverage only for one php --- .travis.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7d35440..467449d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,8 @@ matrix: dist: trusty - php: 5.5 dist: trusty + - php: 7.0 + env: COVERAGE=1 - php: nightly env: DEPENDENCIES="--ignore-platform-reqs" exclude: @@ -45,6 +47,8 @@ before_install: - sudo apt-get install -y graphviz before_script: + ## Deactivate xdebug if we don't do code coverage + - if [ -z "$COVERAGE" ]; then phpenv config-rm xdebug.ini || echo "xdebug not available" ; fi ## Composer - composer self-update ## Composer in PHP versions 5.x requires 3 GB memory @@ -56,17 +60,17 @@ before_script: script: ## PHP_CodeSniffer - - ./vendor/bin/phpcs src/ tests/ --standard=PSR2 -n + - if [ -z "$COVERAGE" ]; then ./vendor/bin/phpcs src/ tests/ --standard=PSR2 -n ; fi ## PHP Copy/Paste Detector # - ./vendor/bin/phpcpd src/ ## PHP Mess Detector - - ./vendor/bin/phpmd src/,tests/ text ./phpmd.xml.dist + - if [ -z "$COVERAGE" ]; then ./vendor/bin/phpmd src/,tests/ text ./phpmd.xml.dist ; fi ## PHPUnit - - ./vendor/bin/phpunit -c ./ --coverage-text --coverage-html ./build/coverage + - ./vendor/bin/phpunit -c ./ $(if [ -n "$COVERAGE" ]; then echo --coverage-text --coverage-html ./build/coverage; else echo --no-coverage; fi) ## PHPLOC - - ./vendor/bin/phploc src/ + - if [ -z "$COVERAGE" ]; then ./vendor/bin/phploc src/ ; fi ## PHPDocumentor - - ./vendor/bin/phpdoc -q -d ./src -t ./build/docs --template="responsive-twig" + - if [ -z "$COVERAGE" ]; then ./vendor/bin/phpdoc -q -d ./src -t ./build/docs --template="responsive-twig" ; fi after_script: ## PHPDocumentor From 2459f3994fa8aa63137836627790f7d1419dfcc0 Mon Sep 17 00:00:00 2001 From: Libor M Date: Sun, 18 Oct 2020 17:18:59 +0200 Subject: [PATCH 12/15] travis format --- .travis.yml | 140 ++++++++++++++++++++++++++-------------------------- 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/.travis.yml b/.travis.yml index 467449d..e30b1b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,86 +3,86 @@ language: php dist: xenial php: - - 5.3 - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - 7.2 - - 7.3 - - 7.4 - - nightly + - 5.3 + - 5.4 + - 5.5 + - 5.6 + - 7.0 + - 7.1 + - 7.2 + - 7.3 + - 7.4 + - nightly matrix: - include: - - php: 5.3 - dist: precise - - php: 5.4 - dist: trusty - - php: 5.5 - dist: trusty - - php: 7.0 - env: COVERAGE=1 - - php: nightly - env: DEPENDENCIES="--ignore-platform-reqs" - exclude: - - php: 5.3 - dist: xenial - - php: 5.4 - dist: xenial - - php: 5.5 - dist: xenial - allow_failures: - - php: nightly + include: + - php: 5.3 + dist: precise + - php: 5.4 + dist: trusty + - php: 5.5 + dist: trusty + - php: 7.0 + env: COVERAGE=1 + - php: nightly + env: DEPENDENCIES="--ignore-platform-reqs" + exclude: + - php: 5.3 + dist: xenial + - php: 5.4 + dist: xenial + - php: 5.5 + dist: xenial + allow_failures: + - php: nightly -env: - global: - ## - secure: "LtlUOzC8FtqgbqUTmU7EU281NSCb58UFdvnz8lelNIDltBdP4eayN/TsgNIePB4jXg2d2R56ZA6j/grhE/md6jdUkulV355H3GrH/hIZmmQ+F9+87agnwLzb9+MJbqXoiE7VvjY3zGIO09G897SUfsfu6JWEcscYFlsH6KcXM6M=" +#env: +# global: +# - secure: "LtlUOzC8FtqgbqUTmU7EU281NSCb58UFdvnz8lelNIDltBdP4eayN/TsgNIePB4jXg2d2R56ZA6j/grhE/md6jdUkulV355H3GrH/hIZmmQ+F9+87agnwLzb9+MJbqXoiE7VvjY3zGIO09G897SUfsfu6JWEcscYFlsH6KcXM6M=" before_install: - ## Packages - - sudo rm -f /etc/apt/sources.list.d/mongodb.list # Makes apt crash on Precise, and we don't need MongoDB - - sudo apt-get update -qq - - sudo apt-get install -y graphviz + ## Packages + - sudo rm -f /etc/apt/sources.list.d/mongodb.list # Makes apt crash on Precise, and we don't need MongoDB + - sudo apt-get update -qq + - sudo apt-get install -y graphviz before_script: - ## Deactivate xdebug if we don't do code coverage - - if [ -z "$COVERAGE" ]; then phpenv config-rm xdebug.ini || echo "xdebug not available" ; fi - ## Composer - - composer self-update - ## Composer in PHP versions 5.x requires 3 GB memory - - if [ ${TRAVIS_PHP_VERSION:0:2} == "5." ]; then export COMPOSER_MEMORY_LIMIT=3G ; fi - - travis_wait composer install --prefer-source --dev $(if [ -n "$DEPENDENCIES" ]; then echo $DEPENDENCIES; fi) - ## PHPDocumentor - - mkdir -p build/docs - - mkdir -p build/coverage + ## Deactivate xdebug if we don't do code coverage + - if [ -z "$COVERAGE" ]; then phpenv config-rm xdebug.ini || echo "xdebug not available" ; fi + ## Composer + - composer self-update + ## Composer in PHP versions 5.x requires 3 GB memory + - if [ ${TRAVIS_PHP_VERSION:0:2} == "5." ]; then export COMPOSER_MEMORY_LIMIT=3G ; fi + - travis_wait composer install --prefer-source --dev $(if [ -n "$DEPENDENCIES" ]; then echo $DEPENDENCIES; fi) + ## PHPDocumentor + - mkdir -p build/docs + - mkdir -p build/coverage script: - ## PHP_CodeSniffer - - if [ -z "$COVERAGE" ]; then ./vendor/bin/phpcs src/ tests/ --standard=PSR2 -n ; fi - ## PHP Copy/Paste Detector - # - ./vendor/bin/phpcpd src/ - ## PHP Mess Detector - - if [ -z "$COVERAGE" ]; then ./vendor/bin/phpmd src/,tests/ text ./phpmd.xml.dist ; fi - ## PHPUnit - - ./vendor/bin/phpunit -c ./ $(if [ -n "$COVERAGE" ]; then echo --coverage-text --coverage-html ./build/coverage; else echo --no-coverage; fi) - ## PHPLOC - - if [ -z "$COVERAGE" ]; then ./vendor/bin/phploc src/ ; fi - ## PHPDocumentor - - if [ -z "$COVERAGE" ]; then ./vendor/bin/phpdoc -q -d ./src -t ./build/docs --template="responsive-twig" ; fi + ## PHP_CodeSniffer + - if [ -z "$COVERAGE" ]; then ./vendor/bin/phpcs src/ tests/ --standard=PSR2 -n ; fi + ## PHP Copy/Paste Detector + # - ./vendor/bin/phpcpd src/ + ## PHP Mess Detector + - if [ -z "$COVERAGE" ]; then ./vendor/bin/phpmd src/,tests/ text ./phpmd.xml.dist ; fi + ## PHPUnit + - ./vendor/bin/phpunit -c ./ $(if [ -n "$COVERAGE" ]; then echo --coverage-text --coverage-html ./build/coverage; else echo --no-coverage; fi) + ## PHPLOC + - if [ -z "$COVERAGE" ]; then ./vendor/bin/phploc src/ ; fi + ## PHPDocumentor + #- if [ -z "$COVERAGE" ]; then ./vendor/bin/phpdoc -q -d ./src -t ./build/docs --template="responsive-twig" ; fi after_script: - ## PHPDocumentor - ## - bash .travis_shell_after_success.sh - ## Scrutinizer - - wget https://scrutinizer-ci.com/ocular.phar - - php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml + ## PHPDocumentor + ## - bash .travis_shell_after_success.sh + ## Scrutinizer + - wget https://scrutinizer-ci.com/ocular.phar + - php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml notifications: - webhooks: - urls: - - https://webhooks.gitter.im/e/e019b92a7793d27e080c - on_success: change # options: [always|never|change] default: always - on_failure: always # options: [always|never|change] default: always - on_start: false # default: false \ No newline at end of file + webhooks: + urls: + - https://webhooks.gitter.im/e/e019b92a7793d27e080c + on_success: change # options: [always|never|change] default: always + on_failure: always # options: [always|never|change] default: always + on_start: false # default: false \ No newline at end of file From d67eeef7562afb91338f278cfb712cdedb79a2cb Mon Sep 17 00:00:00 2001 From: Libor M Date: Mon, 19 Oct 2020 11:18:04 +0200 Subject: [PATCH 13/15] travis - composer --dev option is deprecated --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e30b1b6..40f71b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,7 +53,7 @@ before_script: - composer self-update ## Composer in PHP versions 5.x requires 3 GB memory - if [ ${TRAVIS_PHP_VERSION:0:2} == "5." ]; then export COMPOSER_MEMORY_LIMIT=3G ; fi - - travis_wait composer install --prefer-source --dev $(if [ -n "$DEPENDENCIES" ]; then echo $DEPENDENCIES; fi) + - travis_wait composer install --prefer-source $(if [ -n "$DEPENDENCIES" ]; then echo $DEPENDENCIES; fi) ## PHPDocumentor - mkdir -p build/docs - mkdir -p build/coverage From ee770ad6f2f59f81393dbc13ef40acc320fa73a9 Mon Sep 17 00:00:00 2001 From: Libor M Date: Mon, 19 Oct 2020 15:14:49 +0200 Subject: [PATCH 14/15] PHP 8.0 for cast to string return value with dot (.) This assert is irelevant for test. --- tests/Common/Tests/XMLWriterTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/Common/Tests/XMLWriterTest.php b/tests/Common/Tests/XMLWriterTest.php index 2ff2d2c..0e2ca39 100644 --- a/tests/Common/Tests/XMLWriterTest.php +++ b/tests/Common/Tests/XMLWriterTest.php @@ -65,7 +65,6 @@ public function testWriteAttributeShouldWriteFloatValueLocaleIndependent() setlocale(LC_NUMERIC, 'de_DE.UTF-8', 'de'); - $this->assertSame('1,2', (string)$value); $this->assertSame('' . chr(10), $xmlWriter->getData()); } } From 0852ee9b4846190b37e257a6fb1088b470da9373 Mon Sep 17 00:00:00 2001 From: Libor M Date: Mon, 19 Oct 2020 16:42:10 +0200 Subject: [PATCH 15/15] fix scrutinizer --- .scrutinizer.yml | 12 +++++++++--- .travis.yml | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 6d188be..6ce76e3 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -1,3 +1,9 @@ +build: + nodes: + analysis: + tests: + override: [php-scrutinizer-run] + filter: excluded_paths: [ 'vendor/*', 'tests/*', 'samples/*' ] @@ -14,11 +20,11 @@ tools: config: ruleset: phpmd.xml.dist external_code_coverage: - enabled: true - timeout: 900 + enabled: false + timeout: 1200 php_cpd: true # php_sim: # Temporarily disabled to allow focus on things other than duplicates # min_mass: 40 php_pdepend: true php_analyzer: true - sensiolabs_security_checker: true \ No newline at end of file + sensiolabs_security_checker: true diff --git a/.travis.yml b/.travis.yml index 40f71b4..e7214ab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -76,8 +76,8 @@ after_script: ## PHPDocumentor ## - bash .travis_shell_after_success.sh ## Scrutinizer - - wget https://scrutinizer-ci.com/ocular.phar - - php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml + - if [ -z "$COVERAGE" ]; then wget https://scrutinizer-ci.com/ocular.phar ; fi + - if [ -z "$COVERAGE" ]; then php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml ; fi notifications: webhooks: