From c1c92b00f24c5673c921653a4fcbbb82a7523a5f Mon Sep 17 00:00:00 2001 From: Piotr Szymaszek Date: Sun, 21 Jan 2018 20:45:37 +0100 Subject: [PATCH] Fixed TranslatationHelper for PHP7.2 --- .travis.yml | 2 +- lib/FSi/DoctrineExtensions/Translatable/TranslationHelper.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b0a5c55..2dc577e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ matrix: - php: 7.1 env: - COMPOSER_FLAGS='--prefer-lowest' - - php: 7.1 + - php: 7.2 sudo: false diff --git a/lib/FSi/DoctrineExtensions/Translatable/TranslationHelper.php b/lib/FSi/DoctrineExtensions/Translatable/TranslationHelper.php index 8d27df3..4d3dcc8 100644 --- a/lib/FSi/DoctrineExtensions/Translatable/TranslationHelper.php +++ b/lib/FSi/DoctrineExtensions/Translatable/TranslationHelper.php @@ -182,7 +182,7 @@ public function hasTranslatedProperties(ClassTranslationContext $context, $objec foreach ($properties as $property => $translationField) { $value = $this->propertyManipulator->getPropertyValue($object, $property); if ($translationMeta->isCollectionValuedAssociation($translationField) - && count($value) + && (is_iterable($value) && count($value)) || !$translationMeta->isCollectionValuedAssociation($translationField) && null !== $value ) {