Push PHPStan to level 1
This commit is contained in:
parent
1231861b09
commit
74c48c201d
@ -23,7 +23,7 @@ before_script:
|
||||
- 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
|
||||
- if [[ $PHPSTAN = 1 ]]; then vendor/bin/phpstan analyse -l 1 -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
|
||||
|
||||
|
@ -548,28 +548,28 @@ abstract class AbstractEntityPersister implements CachedEntityPersister
|
||||
$hasCache = ($persister instanceof CachedPersister);
|
||||
$key = null;
|
||||
|
||||
if ($hasCache) {
|
||||
$ownerId = $this->uow->getEntityIdentifier($coll->getOwner());
|
||||
$key = $this->buildCollectionCacheKey($assoc, $ownerId);
|
||||
$list = $persister->loadCollectionCache($coll, $key);
|
||||
if ( ! $hasCache) {
|
||||
return $this->persister->loadManyToManyCollection($assoc, $sourceEntity, $coll);
|
||||
}
|
||||
|
||||
if ($list !== null) {
|
||||
if ($this->cacheLogger) {
|
||||
$this->cacheLogger->collectionCacheHit($persister->getCacheRegion()->getName(), $key);
|
||||
}
|
||||
$ownerId = $this->uow->getEntityIdentifier($coll->getOwner());
|
||||
$key = $this->buildCollectionCacheKey($assoc, $ownerId);
|
||||
$list = $persister->loadCollectionCache($coll, $key);
|
||||
|
||||
return $list;
|
||||
if ($list !== null) {
|
||||
if ($this->cacheLogger) {
|
||||
$this->cacheLogger->collectionCacheHit($persister->getCacheRegion()->getName(), $key);
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
$list = $this->persister->loadManyToManyCollection($assoc, $sourceEntity, $coll);
|
||||
|
||||
if ($hasCache) {
|
||||
$persister->storeCollectionCache($key, $list);
|
||||
$persister->storeCollectionCache($key, $list);
|
||||
|
||||
if ($this->cacheLogger) {
|
||||
$this->cacheLogger->collectionCacheMiss($persister->getCacheRegion()->getName(), $key);
|
||||
}
|
||||
if ($this->cacheLogger) {
|
||||
$this->cacheLogger->collectionCacheMiss($persister->getCacheRegion()->getName(), $key);
|
||||
}
|
||||
|
||||
return $list;
|
||||
@ -583,28 +583,28 @@ abstract class AbstractEntityPersister implements CachedEntityPersister
|
||||
$persister = $this->uow->getCollectionPersister($assoc);
|
||||
$hasCache = ($persister instanceof CachedPersister);
|
||||
|
||||
if ($hasCache) {
|
||||
$ownerId = $this->uow->getEntityIdentifier($coll->getOwner());
|
||||
$key = $this->buildCollectionCacheKey($assoc, $ownerId);
|
||||
$list = $persister->loadCollectionCache($coll, $key);
|
||||
if ( ! $hasCache) {
|
||||
return $this->persister->loadOneToManyCollection($assoc, $sourceEntity, $coll);
|
||||
}
|
||||
|
||||
if ($list !== null) {
|
||||
if ($this->cacheLogger) {
|
||||
$this->cacheLogger->collectionCacheHit($persister->getCacheRegion()->getName(), $key);
|
||||
}
|
||||
$ownerId = $this->uow->getEntityIdentifier($coll->getOwner());
|
||||
$key = $this->buildCollectionCacheKey($assoc, $ownerId);
|
||||
$list = $persister->loadCollectionCache($coll, $key);
|
||||
|
||||
return $list;
|
||||
if ($list !== null) {
|
||||
if ($this->cacheLogger) {
|
||||
$this->cacheLogger->collectionCacheHit($persister->getCacheRegion()->getName(), $key);
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
$list = $this->persister->loadOneToManyCollection($assoc, $sourceEntity, $coll);
|
||||
|
||||
if ($hasCache) {
|
||||
$persister->storeCollectionCache($key, $list);
|
||||
$persister->storeCollectionCache($key, $list);
|
||||
|
||||
if ($this->cacheLogger) {
|
||||
$this->cacheLogger->collectionCacheMiss($persister->getCacheRegion()->getName(), $key);
|
||||
}
|
||||
if ($this->cacheLogger) {
|
||||
$this->cacheLogger->collectionCacheMiss($persister->getCacheRegion()->getName(), $key);
|
||||
}
|
||||
|
||||
return $list;
|
||||
|
@ -542,6 +542,7 @@ class ManyToManyPersister extends AbstractCollectionPersister
|
||||
$identifier1 = $this->uow->getEntityIdentifier($collection->getOwner());
|
||||
$identifier2 = $this->uow->getEntityIdentifier($element);
|
||||
|
||||
$class1 = $class2 = null;
|
||||
if ($isComposite) {
|
||||
$class1 = $this->em->getClassMetadata(get_class($collection->getOwner()));
|
||||
$class2 = $collection->getTypeClass();
|
||||
|
@ -102,6 +102,7 @@ class PhpExporter extends AbstractExporter
|
||||
$cascade = ['all'];
|
||||
}
|
||||
|
||||
$method = null;
|
||||
$associationMappingArray = [
|
||||
'fieldName' => $associationMapping['fieldName'],
|
||||
'targetEntity' => $associationMapping['targetEntity'],
|
||||
@ -129,6 +130,7 @@ class PhpExporter extends AbstractExporter
|
||||
'orphanRemoval',
|
||||
'orderBy',
|
||||
];
|
||||
$oneToManyMappingArray = [];
|
||||
foreach ($potentialAssociationMappingIndexes as $index) {
|
||||
if (isset($associationMapping[$index])) {
|
||||
$oneToManyMappingArray[$index] = $associationMapping[$index];
|
||||
@ -142,6 +144,7 @@ class PhpExporter extends AbstractExporter
|
||||
'joinTable',
|
||||
'orderBy',
|
||||
];
|
||||
$manyToManyMappingArray = [];
|
||||
foreach ($potentialAssociationMappingIndexes as $index) {
|
||||
if (isset($associationMapping[$index])) {
|
||||
$manyToManyMappingArray[$index] = $associationMapping[$index];
|
||||
|
@ -240,6 +240,7 @@ class XmlExporter extends AbstractExporter
|
||||
});
|
||||
|
||||
foreach ($metadata->associationMappings as $associationMapping) {
|
||||
$associationMappingXml = null;
|
||||
if ($associationMapping['type'] == ClassMetadataInfo::ONE_TO_ONE) {
|
||||
$associationMappingXml = $root->addChild('one-to-one');
|
||||
} elseif ($associationMapping['type'] == ClassMetadataInfo::MANY_TO_ONE) {
|
||||
|
@ -1,4 +1,7 @@
|
||||
parameters:
|
||||
earlyTerminatingMethodCalls:
|
||||
Doctrine\ORM\Query\Parser:
|
||||
- syntaxError
|
||||
ignoreErrors:
|
||||
# Memcache does not exist on PHP 7
|
||||
- '#Instantiated class Memcache not found#'
|
||||
|
Loading…
x
Reference in New Issue
Block a user