From bd8ad6f831904d1a8e996ea1111e6c6c1c370d97 Mon Sep 17 00:00:00 2001 From: SonataCI Date: Thu, 6 Sep 2018 02:08:23 +0200 Subject: [PATCH 1/3] DevKit updates --- .travis/before_install_test.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.travis/before_install_test.sh b/.travis/before_install_test.sh index f7c3603f..8456b3cb 100755 --- a/.travis/before_install_test.sh +++ b/.travis/before_install_test.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash set -ev PHP_INI_DIR="$HOME/.phpenv/versions/$(phpenv version-name)/etc/conf.d/" @@ -9,6 +9,19 @@ echo "memory_limit=3072M" >> "$TRAVIS_INI_FILE" sed --in-place "s/\"dev-master\":/\"dev-${TRAVIS_COMMIT}\":/" composer.json +# TODO: remove when drop PHP 5 support +# symfony/maker-bundle only works with PHP 7 and higher +if [ "${TRAVIS_PHP_VERSION:0:3}" != "5.6" ]; then + # but only with Symfony 3.4 and higher + if [ "$SYMFONY" != "" ]; then + if [ "${SYMFONY:0:3}" != "2.8" ] && [ "${SYMFONY:0:3}" != "3.3" ] ; then + composer require "symfony/maker-bundle:$" --no-update + fi + else + composer require "symfony/maker-bundle:$" --no-update + fi +fi + if [ "$SYMFONY" != "" ]; then composer require "symfony/symfony:$SYMFONY" --no-update; fi; if [ "$SONATA_CORE" != "" ]; then composer require "sonata-project/core-bundle:$SONATA_CORE" --no-update; fi; if [ "$SONATA_ADMIN" != "" ]; then composer require "sonata-project/admin-bundle:$SONATA_ADMIN" --no-update; fi; From cd5d0155cded2a82e2e72e5ac42249f8af51fed2 Mon Sep 17 00:00:00 2001 From: Sullivan SENECHAL Date: Thu, 6 Sep 2018 08:24:46 +0200 Subject: [PATCH 2/3] Applied fixes from FlintCI (#236) --- src/Checker/TranslatableChecker.php | 6 +++--- src/Filter/TranslationFieldFilter.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Checker/TranslatableChecker.php b/src/Checker/TranslatableChecker.php index ac8de3f0..15783fdb 100644 --- a/src/Checker/TranslatableChecker.php +++ b/src/Checker/TranslatableChecker.php @@ -71,7 +71,7 @@ public function isTranslatable($object) return false; } - if (function_exists('class_uses')) { + if (\function_exists('class_uses')) { // NEXT_MAJOR: remove Translateable and PersonalTrait. $translateTraits = [ 'Sonata\TranslationBundle\Traits\Translatable', @@ -81,14 +81,14 @@ public function isTranslatable($object) ]; $traits = class_uses($object); - if (count(array_intersect($translateTraits, $traits)) > 0) { + if (\count(array_intersect($translateTraits, $traits)) > 0) { return true; } } $objectInterfaces = class_implements($object); foreach ($this->getSupportedInterfaces() as $interface) { - if (in_array($interface, $objectInterfaces)) { + if (\in_array($interface, $objectInterfaces)) { return true; } } diff --git a/src/Filter/TranslationFieldFilter.php b/src/Filter/TranslationFieldFilter.php index e5ace400..4c5d2d69 100644 --- a/src/Filter/TranslationFieldFilter.php +++ b/src/Filter/TranslationFieldFilter.php @@ -24,13 +24,13 @@ final class TranslationFieldFilter extends Filter */ public function filter(ProxyQueryInterface $queryBuilder, $alias, $field, $data) { - if (!$data || !is_array($data) || !array_key_exists('value', $data)) { + if (!$data || !\is_array($data) || !array_key_exists('value', $data)) { return; } $data['value'] = trim($data['value']); - if (0 == strlen($data['value'])) { + if (0 == \strlen($data['value'])) { return; } From 49c69c99f344e0481fa3ea1d6936fe2bfa902ee0 Mon Sep 17 00:00:00 2001 From: SonataCI Date: Mon, 10 Sep 2018 02:08:18 +0200 Subject: [PATCH 3/3] DevKit updates --- .travis/before_install_test.sh | 20 ++++---------------- .travis/install_test.sh | 7 ++++++- phpunit.xml.dist | 1 - 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/.travis/before_install_test.sh b/.travis/before_install_test.sh index 8456b3cb..6de86426 100755 --- a/.travis/before_install_test.sh +++ b/.travis/before_install_test.sh @@ -9,19 +9,7 @@ echo "memory_limit=3072M" >> "$TRAVIS_INI_FILE" sed --in-place "s/\"dev-master\":/\"dev-${TRAVIS_COMMIT}\":/" composer.json -# TODO: remove when drop PHP 5 support -# symfony/maker-bundle only works with PHP 7 and higher -if [ "${TRAVIS_PHP_VERSION:0:3}" != "5.6" ]; then - # but only with Symfony 3.4 and higher - if [ "$SYMFONY" != "" ]; then - if [ "${SYMFONY:0:3}" != "2.8" ] && [ "${SYMFONY:0:3}" != "3.3" ] ; then - composer require "symfony/maker-bundle:$" --no-update - fi - else - composer require "symfony/maker-bundle:$" --no-update - fi -fi - -if [ "$SYMFONY" != "" ]; then composer require "symfony/symfony:$SYMFONY" --no-update; fi; -if [ "$SONATA_CORE" != "" ]; then composer require "sonata-project/core-bundle:$SONATA_CORE" --no-update; fi; -if [ "$SONATA_ADMIN" != "" ]; then composer require "sonata-project/admin-bundle:$SONATA_ADMIN" --no-update; fi; + if [ "$SYMFONY" != "" ]; then composer require "symfony/symfony:$SYMFONY" --no-update; fi; + if [ "$SONATA_CORE" != "" ]; then composer require "sonata-project/core-bundle:$SONATA_CORE" --no-update; fi; + if [ "$SONATA_ADMIN" != "" ]; then composer require "sonata-project/admin-bundle:$SONATA_ADMIN" --no-update; fi; + \ No newline at end of file diff --git a/.travis/install_test.sh b/.travis/install_test.sh index 965fa822..07243c7b 100755 --- a/.travis/install_test.sh +++ b/.travis/install_test.sh @@ -4,7 +4,12 @@ set -ev mkdir --parents "${HOME}/bin" # PHPUnit install -wget "https://phar.phpunit.de/phpunit-5.7.phar" --output-document="${HOME}/bin/phpunit" +if [ "${TRAVIS_BRANCH}" = 'master' ]; then + PHPUNIT_VERSION=7 +else + PHPUNIT_VERSION=5.7 +fi +wget "https://phar.phpunit.de/phpunit-${PHPUNIT_VERSION}.phar" --output-document="${HOME}/bin/phpunit" chmod u+x "${HOME}/bin/phpunit" # Coveralls client install diff --git a/phpunit.xml.dist b/phpunit.xml.dist index c8aed701..b470fe62 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -14,7 +14,6 @@ It's auto-generated by sonata-project/dev-kit package. convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" - syntaxCheck="false" bootstrap="tests/bootstrap.php" >