From f17f680293eac2299d630cccfc3f4a440f1aab36 Mon Sep 17 00:00:00 2001
From: GoZ <goz@226961.no-reply.drupal.org>
Date: Thu, 6 Dec 2018 18:02:49 +0100
Subject: [PATCH] Issue #3018586: [warning] count(): Parameter must be an array
 or an object that implements Countable
 EntityStagingProcessEntityReferenceFieldSubscriber.php:92

---
 .../EntityStagingProcessEntityReferenceFieldSubscriber.php  | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/EventSubscriber/EntityStagingProcessEntityReferenceFieldSubscriber.php b/src/EventSubscriber/EntityStagingProcessEntityReferenceFieldSubscriber.php
index 82e1235..d9d67ce 100644
--- a/src/EventSubscriber/EntityStagingProcessEntityReferenceFieldSubscriber.php
+++ b/src/EventSubscriber/EntityStagingProcessEntityReferenceFieldSubscriber.php
@@ -89,10 +89,8 @@ class EntityStagingProcessEntityReferenceFieldSubscriber implements EventSubscri
         }
       }
 
-      if (count($migration) == 1) {
-        if (is_array($migration)) {
-          $migration = $migration[0];
-        }
+      if (\is_array($migration) && \count($migration) === 1) {
+        $migration = $migration[0];
       }
 
       $process_field = [
-- 
2.18.0

