Permalink
Browse files

DevKit updates for 3.x branch (#470)

* DevKit updates

* Applied fixes from FlintCI (#469)

* DevKit updates
  • Loading branch information...
SonataCI authored and kunicmarko20 committed Sep 10, 2018
1 parent fd902fe commit 5f5de3dd362281ae50df16c2df71dda31c31554b
@@ -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,7 +9,8 @@ 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 [ "$SONATA_USER" != "" ]; then composer require "sonata-project/user-bundle:$SONATA_USER" --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;
if [ "$SONATA_USER" != "" ]; then composer require "sonata-project/user-bundle:$SONATA_USER" --no-update; fi;
View
@@ -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
View
@@ -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>
View
@@ -203,7 +203,7 @@ protected function configureDatagridFilters(DatagridMapper $datagridMapper)
->add('with_open_comments', CallbackFilter::class, [
// 'callback' => array($this, 'getWithOpenCommentFilter'),
'callback' => function ($queryBuilder, $alias, $field, $data) use ($that) {
if (!is_array($data) || !$data['value']) {
if (!\is_array($data) || !$data['value']) {
return;
}
@@ -221,7 +221,7 @@ protected function configureDatagridFilters(DatagridMapper $datagridMapper)
*/
protected function configureTabMenu(MenuItemInterface $menu, $action, AdminInterface $childAdmin = null)
{
if (!$childAdmin && !in_array($action, ['edit'])) {
if (!$childAdmin && !\in_array($action, ['edit'])) {
return;
}
@@ -92,7 +92,7 @@ public function findOneByPermalink($permalink, BlogInterface $blog)
->andWhere($collectionQueryParts['query']);
}
if (0 == count($parameters)) {
if (0 == \count($parameters)) {
return null;
}
@@ -144,10 +144,10 @@ public function getPager(array $criteria, $page, $limit = 10, array $sort = [])
}
if (isset($criteria['author'])) {
if (!is_array($criteria['author']) && stristr($criteria['author'], 'NULL')) {
if (!\is_array($criteria['author']) && stristr($criteria['author'], 'NULL')) {
$query->andWhere('p.author IS '.$criteria['author']);
} else {
$query->andWhere(sprintf('p.author IN (%s)', implode((array) $criteria['author'], ',')));
$query->andWhere(sprintf('p.author IN (%s)', implode(',', (array) $criteria['author'])));
}
}
@@ -66,7 +66,7 @@ public function findOneByPermalink($permalink, BlogInterface $blog)
->andWhere($collectionQueryParts['query']);
}
if (0 == count($parameters)) {
if (0 == \count($parameters)) {
return null;
}
@@ -131,10 +131,10 @@ public function getPager(array $criteria, $page, $limit = 10, array $sort = [])
}
if (isset($criteria['author'])) {
if (!is_array($criteria['author']) && stristr($criteria['author'], 'NULL')) {
if (!\is_array($criteria['author']) && stristr($criteria['author'], 'NULL')) {
$query->andWhere('p.author IS '.$criteria['author']);
} else {
$query->andWhere(sprintf('p.author IN (%s)', implode((array) $criteria['author'], ',')));
$query->andWhere(sprintf('p.author IN (%s)', implode(',', (array) $criteria['author'])));
}
}
@@ -32,7 +32,7 @@ public function getParameters($permalink)
{
$parameters = explode('/', $permalink);
if (count($parameters) > 2 || 0 == count($parameters)) {
if (\count($parameters) > 2 || 0 == \count($parameters)) {
throw new \InvalidArgumentException('wrong permalink format');
}
@@ -48,7 +48,7 @@ public function getParameters($permalink)
{
$parameters = explode('/', $permalink);
if (4 != count($parameters)) {
if (4 != \count($parameters)) {
throw new \InvalidArgumentException('wrong permalink format');
}

0 comments on commit 5f5de3d

Please sign in to comment.