From bd497e47030769e56ebdf289004cb9e90706777f Mon Sep 17 00:00:00 2001 From: mark_story Date: Thu, 10 Jul 2014 12:05:56 -0400 Subject: [PATCH] Fix PHPCS warnings. --- src/Datasource/EntityTrait.php | 4 +++- tests/TestCase/ORM/EntityTest.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Datasource/EntityTrait.php b/src/Datasource/EntityTrait.php index 383f20577a0..e4f3c03c3c6 100644 --- a/src/Datasource/EntityTrait.php +++ b/src/Datasource/EntityTrait.php @@ -610,8 +610,10 @@ protected function _nestedErrors($field) { } $entity = $this; - while (count($path)) { + $len = count($path); + while ($len) { $part = array_shift($path); + $len = count($path); if ($entity instanceof static) { $val = $entity->get($part); } elseif (is_array($entity)) { diff --git a/tests/TestCase/ORM/EntityTest.php b/tests/TestCase/ORM/EntityTest.php index 50269d607c6..e8d8dde5de0 100644 --- a/tests/TestCase/ORM/EntityTest.php +++ b/tests/TestCase/ORM/EntityTest.php @@ -831,7 +831,7 @@ public function testErrorsDeep() { */ public function testErrorPathReading() { $assoc = new Entity; - $entity= new Entity([ + $entity = new Entity([ 'field' => 'value', 'one' => $assoc, 'many' => [$assoc]