Initial PHPStan integration (level 0)
This commit is contained in:
parent
388afb46d0
commit
1231861b09
@ -14,13 +14,16 @@ env:
|
|||||||
before_script:
|
before_script:
|
||||||
- if [[ $TRAVIS_PHP_VERSION = '7.1' && $DB = 'sqlite' && "$DEPENDENCIES" != "low" ]]; then PHPUNIT_FLAGS="--coverage-clover ./build/logs/clover.xml"; else PHPUNIT_FLAGS=""; fi
|
- if [[ $TRAVIS_PHP_VERSION = '7.1' && $DB = 'sqlite' && "$DEPENDENCIES" != "low" ]]; then PHPUNIT_FLAGS="--coverage-clover ./build/logs/clover.xml"; else PHPUNIT_FLAGS=""; fi
|
||||||
- if [[ "$PHPUNIT_FLAGS" == "" ]]; then phpenv config-rm xdebug.ini; fi
|
- if [[ "$PHPUNIT_FLAGS" == "" ]]; then phpenv config-rm xdebug.ini; fi
|
||||||
|
- if [[ $PHPSTAN = 1 ]]; then echo "extension=redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi
|
||||||
- composer self-update
|
- composer self-update
|
||||||
- composer install --prefer-source
|
- composer install --prefer-source
|
||||||
- if [ "$DEPENDENCIES" != "low" ]; then composer update; fi;
|
- if [ "$DEPENDENCIES" != "low" ]; then composer update; fi;
|
||||||
- if [ "$DEPENDENCIES" == "low" ]; then composer update --prefer-lowest; fi;
|
- if [ "$DEPENDENCIES" == "low" ]; then composer update --prefer-lowest; fi;
|
||||||
|
- if [[ $PHPSTAN = 1 ]]; then composer require --dev --prefer-stable phpstan/phpstan:^0.7 symfony/console:^3.0; fi
|
||||||
- if [[ $DB == "mysql" || $DB == "mariadb" ]]; then mysql -e "CREATE SCHEMA doctrine_tests; GRANT ALL PRIVILEGES ON doctrine_tests.* to travis@'%'"; fi;
|
- if [[ $DB == "mysql" || $DB == "mariadb" ]]; then mysql -e "CREATE SCHEMA doctrine_tests; GRANT ALL PRIVILEGES ON doctrine_tests.* to travis@'%'"; fi;
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
- if [[ $PHPSTAN = 1 ]]; then vendor/bin/phpstan analyse -l 0 -c phpstan.neon lib; fi
|
||||||
- ENABLE_SECOND_LEVEL_CACHE=0 ./vendor/bin/phpunit -v -c tests/travis/$DB.travis.xml $PHPUNIT_FLAGS
|
- ENABLE_SECOND_LEVEL_CACHE=0 ./vendor/bin/phpunit -v -c tests/travis/$DB.travis.xml $PHPUNIT_FLAGS
|
||||||
- ENABLE_SECOND_LEVEL_CACHE=1 ./vendor/bin/phpunit -v -c tests/travis/$DB.travis.xml --exclude-group performance,non-cacheable,locking_functional
|
- ENABLE_SECOND_LEVEL_CACHE=1 ./vendor/bin/phpunit -v -c tests/travis/$DB.travis.xml --exclude-group performance,non-cacheable,locking_functional
|
||||||
|
|
||||||
@ -39,6 +42,10 @@ matrix:
|
|||||||
env:
|
env:
|
||||||
- DB=sqlite
|
- DB=sqlite
|
||||||
- DEPENDENCIES='low'
|
- DEPENDENCIES='low'
|
||||||
|
- php: 7.1
|
||||||
|
env:
|
||||||
|
- DB=pgsql
|
||||||
|
- PHPSTAN=1
|
||||||
|
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- php: nightly
|
- php: nightly
|
||||||
|
@ -514,10 +514,11 @@ final class PersistentCollection extends AbstractLazyCollection implements Selec
|
|||||||
public function offsetSet($offset, $value)
|
public function offsetSet($offset, $value)
|
||||||
{
|
{
|
||||||
if ( ! isset($offset)) {
|
if ( ! isset($offset)) {
|
||||||
return $this->add($value);
|
$this->add($value);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->set($offset, $value);
|
$this->set($offset, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -451,7 +451,7 @@ class ResultSetMapping
|
|||||||
/**
|
/**
|
||||||
* @param string $alias
|
* @param string $alias
|
||||||
*
|
*
|
||||||
* @return AssociationMapping
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getRelation($alias)
|
public function getRelation($alias)
|
||||||
{
|
{
|
||||||
|
4
phpstan.neon
Normal file
4
phpstan.neon
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
parameters:
|
||||||
|
ignoreErrors:
|
||||||
|
# Memcache does not exist on PHP 7
|
||||||
|
- '#Instantiated class Memcache not found#'
|
Loading…
x
Reference in New Issue
Block a user