Some cosmetics and cleanups
authorFranz Koch <typo3@elements-net.de>
Mon, 21 Jun 2010 15:48:03 +0000 (15:48 +0000)
committerFranz Koch <typo3@elements-net.de>
Mon, 21 Jun 2010 15:48:03 +0000 (15:48 +0000)
- fixed doc comment (we no longer have a Tx_Extbase_Persistence_RowInterface)
- use foreach instead of a while/list construct (is supposed to be faster)
- in ClassLoader require files only once (just in case)

typo3/sysext/extbase/Classes/Persistence/Mapper/DataMapper.php
typo3/sysext/extbase/Classes/Utility/Arrays.php
typo3/sysext/extbase/Classes/Utility/ClassLoader.php

index aef0994..f9058e0 100644 (file)
@@ -215,7 +215,7 @@ class Tx_Extbase_Persistence_Mapper_DataMapper implements t3lib_Singleton {
         * Sets the given properties on the object.
         *
         * @param Tx_Extbase_DomainObject_DomainObjectInterface $object The object to set properties on
-        * @param Tx_Extbase_Persistence_RowInterface $row
+        * @param array $row
         * @return void
         */
        protected function thawProperties(Tx_Extbase_DomainObject_DomainObjectInterface $object, array $row) {
index dea93fa..9ec2e76 100644 (file)
@@ -140,11 +140,10 @@ class Tx_Extbase_Utility_Arrays {
         */
        static public function containsMultipleTypes(array $array) {
                if (count($array) > 0) {
-                       reset($array);
-                       $previousType = gettype(current($array));
-                       next($array);
-                       while (list(, $value) = each($array)) {
-                               if ($previousType !== gettype($value)) {
+                       foreach ($array as $key => $value) {
+                               if (!isset($previousType)) {
+                                       $previousType = gettype($value);
+                               } else if ($previousType !== gettype($value)) {
                                        return TRUE;
                                }
                        }
index 96e7545..d783f53 100644 (file)
@@ -48,7 +48,7 @@ class Tx_Extbase_Utility_ClassLoader {
                if (t3lib_extMgm::isLoaded($extensionKey)) {
                        $classFilePathAndName = t3lib_extMgm::extPath($extensionKey) . 'Classes/' . strtr($classNameParts[2], '_', '/') . '.php';
                        if (file_exists($classFilePathAndName)) {
-                               require($classFilePathAndName);
+                               require_once($classFilePathAndName);
                        }
                }
        }