1
0
mirror of synced 2025-03-06 12:56:10 +03:00

Initial PHPStan integration (level 0)

This commit is contained in:
Ondrej Mirtes 2017-05-14 23:31:15 +02:00 committed by Michael Moravec
parent 388afb46d0
commit 1231861b09
No known key found for this signature in database
GPG Key ID: 2930160BB3C7CFE4
4 changed files with 15 additions and 3 deletions

View File

@ -14,13 +14,16 @@ env:
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 [[ "$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 install --prefer-source
- if [ "$DEPENDENCIES" != "low" ]; then composer update; 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;
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=1 ./vendor/bin/phpunit -v -c tests/travis/$DB.travis.xml --exclude-group performance,non-cacheable,locking_functional
@ -39,6 +42,10 @@ matrix:
env:
- DB=sqlite
- DEPENDENCIES='low'
- php: 7.1
env:
- DB=pgsql
- PHPSTAN=1
allow_failures:
- php: nightly

View File

@ -514,10 +514,11 @@ final class PersistentCollection extends AbstractLazyCollection implements Selec
public function offsetSet($offset, $value)
{
if ( ! isset($offset)) {
return $this->add($value);
$this->add($value);
return;
}
return $this->set($offset, $value);
$this->set($offset, $value);
}
/**

View File

@ -451,7 +451,7 @@ class ResultSetMapping
/**
* @param string $alias
*
* @return AssociationMapping
* @return string
*/
public function getRelation($alias)
{

4
phpstan.neon Normal file
View File

@ -0,0 +1,4 @@
parameters:
ignoreErrors:
# Memcache does not exist on PHP 7
- '#Instantiated class Memcache not found#'