From af48dc82db9ac070d299c63b3c7c5367bd9b82e1 Mon Sep 17 00:00:00 2001 From: bh-ref Date: Wed, 16 Dec 2015 14:44:09 +0100 Subject: [PATCH 1/2] use proper array comparization the keys in the arrays might be the same but in different order, so we should use `array_diff_key` --- src/Migration/Step/UrlRewrite/Version191to2000.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Migration/Step/UrlRewrite/Version191to2000.php b/src/Migration/Step/UrlRewrite/Version191to2000.php index 39e05f882..e1fff801d 100644 --- a/src/Migration/Step/UrlRewrite/Version191to2000.php +++ b/src/Migration/Step/UrlRewrite/Version191to2000.php @@ -145,10 +145,14 @@ protected function integrity() { $result = true; $this->progress->start(1); - $result &= array_keys($this->source->getStructure(self::SOURCE)->getFields()) - == $this->structure[MapInterface::TYPE_SOURCE][self::SOURCE]; - $result &= array_keys($this->destination->getStructure(self::DESTINATION)->getFields()) - == $this->structure[MapInterface::TYPE_DEST][self::DESTINATION]; + $result &= !array_diff_key( + array_keys($this->source->getStructure(self::SOURCE)->getFields()), + $this->structure[MapInterface::TYPE_SOURCE][self::SOURCE] + ); + $result &= !array_diff_key( + array_keys($this->destination->getStructure(self::DESTINATION)->getFields()) + $this->structure[MapInterface::TYPE_DEST][self::DESTINATION] + ); $this->progress->advance(); $this->progress->finish(); return (bool)$result; From e36bfe7f8f44bedfd7b48ea1453968351ea75e8b Mon Sep 17 00:00:00 2001 From: bh-ref Date: Wed, 16 Dec 2015 16:21:28 +0100 Subject: [PATCH 2/2] missing comma --- src/Migration/Step/UrlRewrite/Version191to2000.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Migration/Step/UrlRewrite/Version191to2000.php b/src/Migration/Step/UrlRewrite/Version191to2000.php index e1fff801d..be6008e9b 100644 --- a/src/Migration/Step/UrlRewrite/Version191to2000.php +++ b/src/Migration/Step/UrlRewrite/Version191to2000.php @@ -150,7 +150,7 @@ protected function integrity() $this->structure[MapInterface::TYPE_SOURCE][self::SOURCE] ); $result &= !array_diff_key( - array_keys($this->destination->getStructure(self::DESTINATION)->getFields()) + array_keys($this->destination->getStructure(self::DESTINATION)->getFields()), $this->structure[MapInterface::TYPE_DEST][self::DESTINATION] ); $this->progress->advance();