diff --git a/src/Datasource/EntityTrait.php b/src/Datasource/EntityTrait.php index 11a24291f38..022997a273b 100644 --- a/src/Datasource/EntityTrait.php +++ b/src/Datasource/EntityTrait.php @@ -230,7 +230,10 @@ public function set($property, $value = null, $options = []) { $this->dirty($p, true); - if (!isset($this->_original[$p]) && isset($this->_properties[$p]) && $this->_properties[$p] !== $value) { + if (!isset($this->_original[$p]) && + isset($this->_properties[$p]) && + $this->_properties[$p] !== $value + ) { $this->_original[$p] = $this->_properties[$p]; } @@ -509,7 +512,9 @@ public function extract(array $properties, $onlyDirty = false) { public function extractOriginal(array $properties) { $result = []; foreach ($properties as $property) { - if (($this->getOriginal($property) !== null) && ($this->getOriginal($property) !== $this->get($property))) { + if ($this->getOriginal($property) !== null && + $this->getOriginal($property) !== $this->get($property) + ) { $result[$property] = $this->getOriginal($property); } } diff --git a/tests/TestCase/ORM/EntityTest.php b/tests/TestCase/ORM/EntityTest.php index e9cd55ec7b7..28a0f426297 100644 --- a/tests/TestCase/ORM/EntityTest.php +++ b/tests/TestCase/ORM/EntityTest.php @@ -43,7 +43,6 @@ public function testSetOneParamNoSetters() { $this->assertSame(1, $entity->id); $this->assertEquals(1, $entity->getOriginal('id')); $this->assertEquals('bar', $entity->getOriginal('foo')); - } /**