diff --git a/LeanMapperQuery/Entity.php b/LeanMapperQuery/Entity.php index fd862ac..0239a09 100644 --- a/LeanMapperQuery/Entity.php +++ b/LeanMapperQuery/Entity.php @@ -98,7 +98,9 @@ public static function queryEntityProperty(LeanMapper\Entity $entity, $field, IQ if ($row !== null && $targetResultProxy === null) { $targetResultProxy = $row->getResultProxy(); } - $row !== null && $resultRows[$row->{$targetPrimaryKey}] = $row; + if ($row !== null) { + $resultRows[$row->{$targetPrimaryKey}] = $row; + } } if ($targetResultProxy) { diff --git a/LeanMapperQuery/Query.php b/LeanMapperQuery/Query.php index ee0a586..b2db803 100644 --- a/LeanMapperQuery/Query.php +++ b/LeanMapperQuery/Query.php @@ -266,7 +266,7 @@ private function traverseToRelatedEntity(&$currentTable, &$currentTableAlias, Pr $targetTableAlias = $this->joinRelatedTable($relationshipTableAlias, $targetReferencingColumn, $targetTable, $targetTablePrimaryKey, $implicitFilters, false); } else { - throw new InvalidRelationshipException('Unknown relationship type. ' . get_class($relationship) . ' given.'); + throw new InvalidRelationshipException('Unknown relationship type in property {$property->getName()}.'); } $currentTable = $targetTable; $currentTableAlias = $targetTableAlias; diff --git a/phpstan.neon b/phpstan.neon index b915a5e..7eed3e4 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,4 +1,4 @@ parameters: - level: 3 + level: 5 paths: - LeanMapperQuery/