[BUGFIX] AbstractDomainObject _cleanProperties is array 14/29814/4
authorRoland Waldner <mostwantedtypo3@gmail.com>
Sat, 3 May 2014 13:57:28 +0000 (15:57 +0200)
committerMarc Bastian Heinrichs <typo3@mbh-software.de>
Sat, 3 May 2014 19:02:49 +0000 (21:02 +0200)
Properly initialize _cleanProperties to array to prevent warnings.

Resolves: #57244
Releases: 6.2
Change-Id: I64f62cbcaf7268740af0e3c51303c49fc343136b
Reviewed-on: https://review.typo3.org/29814
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Oliver Klee
Reviewed-by: Marc Bastian Heinrichs
Tested-by: Marc Bastian Heinrichs
typo3/sysext/extbase/Classes/DomainObject/AbstractDomainObject.php

index 53130ec..a8f2e77 100644 (file)
@@ -64,7 +64,7 @@ abstract class AbstractDomainObject implements DomainObjectInterface, \TYPO3\CMS
        /**
         * @var array An array holding the clean property values. Set right after reconstitution of the object
         */
-       private $_cleanProperties;
+       private $_cleanProperties = array();
 
        /**
         * This is the magic __wakeup() method. It's invoked by the unserialize statement in the reconstitution process
@@ -211,9 +211,6 @@ abstract class AbstractDomainObject implements DomainObjectInterface, \TYPO3\CMS
         */
        public function _memorizePropertyCleanState($propertyName) {
                $propertyValue = $this->{$propertyName};
-               if (!is_array($this->_cleanProperties)) {
-                       $this->_cleanProperties = array();
-               }
                if (is_object($propertyValue)) {
                        $this->_cleanProperties[$propertyName] = clone $propertyValue;
                        // We need to make sure the clone and the original object
@@ -247,11 +244,7 @@ abstract class AbstractDomainObject implements DomainObjectInterface, \TYPO3\CMS
         * @return mixed The clean property value or NULL
         */
        public function _getCleanProperty($propertyName) {
-               if (is_array($this->_cleanProperties)) {
-                       return isset($this->_cleanProperties[$propertyName]) ? $this->_cleanProperties[$propertyName] : NULL;
-               } else {
-                       return NULL;
-               }
+               return isset($this->_cleanProperties[$propertyName]) ? $this->_cleanProperties[$propertyName] : NULL;
        }
 
        /**