Skip to content

Commit

Permalink
Merge 49c69c9 into d780f00
Browse files Browse the repository at this point in the history
  • Loading branch information
SonataCI committed Sep 10, 2018
2 parents d780f00 + 49c69c9 commit 610b19e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
9 changes: 5 additions & 4 deletions .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/"
Expand All @@ -9,6 +9,7 @@ echo "memory_limit=3072M" >> "$TRAVIS_INI_FILE"

sed --in-place "s/\"dev-master\":/\"dev-${TRAVIS_COMMIT}\":/" composer.json

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;

7 changes: 6 additions & 1 deletion .travis/install_test.sh
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion phpunit.xml.dist
Expand Up @@ -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"
>
<testsuites>
Expand Down
6 changes: 3 additions & 3 deletions src/Checker/TranslatableChecker.php
Expand Up @@ -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',
Expand All @@ -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;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Filter/TranslationFieldFilter.php
Expand Up @@ -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;
}

Expand Down

0 comments on commit 610b19e

Please sign in to comment.