]> git.mxchange.org Git - core.git/commitdiff
Use array_push() instead of []
authorRoland Häder <roland@mxchange.org>
Sun, 3 Mar 2013 22:35:01 +0000 (22:35 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 3 Mar 2013 22:35:01 +0000 (22:35 +0000)
inc/classes/main/cache/class_MemoryCache.php
inc/classes/main/criteria/class_BaseCriteria.php
inc/classes/main/database/databases/class_LocalFileDatabase.php
inc/classes/main/filter/class_FilterChain.php
inc/classes/main/mailer/class_BaseMailer.php
inc/classes/main/registry/class_BaseRegistry.php
inc/classes/main/response/class_BaseResponse.php
inc/classes/main/template/class_BaseTemplateEngine.php
inc/classes/third_party/api/wernisportal/class_WernisApi.php
inc/loader/class_ClassLoader.php

index 7f254d3367f2abd2d722be7a4c8f1ea819f82972..d9d252cecce63740094be2372fa7d1c842bba3b1 100644 (file)
@@ -78,7 +78,7 @@ class MemoryCache extends BaseFrameworkSystem implements Cacheable {
                // So look for array element?
                if (($exists === TRUE) && (!is_null($arrayElement))) {
                        // Get it
-                       $array = $this->offetget($offset);
+                       $array = $this->offsetGet($offset);
 
                        // Is it an array and element is found?
                        if ((is_array($array)) && (isset($array[$arrayElement]))) {
index 9597c14a0bf35240410e3d2012bd8066d657e01d..da807125fb6d56e0edb3863aff35d46ae003437c 100644 (file)
@@ -202,7 +202,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '(' . $this->__toString() . ')-CRITERIA[' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue);
 
                // Add it
-               $this->criteria['choice'][$this->convertDashesToUnderscores($criteriaKey)][] = (string) $criteriaValue;
+               array_push($this->criteria['choice'][$this->convertDashesToUnderscores($criteriaKey)], (string) $criteriaValue);
        }
 
        /**
index f49a9f16bdae6bdd546fc538628007097558431c..efc67c3e277a0eb236aadd61264d86a9503ad9cb 100644 (file)
@@ -408,7 +408,7 @@ class LocalFileDatabase extends BaseDatabaseBackend implements DatabaseBackendIn
 
                                                // Entry found!
                                                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: indexKey=' . $this->getIndexKey() . ',idx=' . $idx . ',dataArray=' . print_r($dataArray, TRUE));
-                                               $resultData[BaseDatabaseBackend::RESULT_INDEX_ROWS][] = $dataArray;
+                                               array_push($resultData[BaseDatabaseBackend::RESULT_INDEX_ROWS], $dataArray);
 
                                                // Count found entries up
                                                $limitFound++;
index 3aff6387bed5393f1ab557f7dba27159c4d4e827..c192bf3f3909fdb0055f84cdfc8a06c52d9c9974 100644 (file)
@@ -57,7 +57,7 @@ class FilterChain extends BaseFrameworkSystem implements Registerable {
         * @return      void
         */
        public final function addFilter (Filterable $filterInstance) {
-               $this->filters[] = $filterInstance;
+               array_push($this->filters, $filterInstance);
        }
 
        /**
index 71124d2f7f638d8dfe60d7ba7b76449dbb32605a..ffd0bc158d6db6b7b0a592b2c2e6e4eeb5c6638a 100644 (file)
@@ -79,7 +79,7 @@ class BaseMailer extends BaseFrameworkSystem {
                } // END - if
 
                // Add it as a recipient
-               $this->recipientList[$templateName]['recipients'][] = $userInstance;
+               array_pushh($this->recipientList[$templateName]['recipients'], $userInstance);
        }
 
        /**
index 4fd9aaf6dd5b022b2d3f1d80a0aa477b0617bacd..fc0b4c19d10360d62cca96ecadc6984a91b823c8 100644 (file)
@@ -97,7 +97,7 @@ class BaseRegistry extends BaseFrameworkSystem implements Registerable {
         */
        public final function addEntry ($key, $value) {
                // Simply add it
-               $this->rawEntries[$key][] = $value;
+               array_push($this->rawEntries[$key], $value);
        }
 
        /**
index c8cfa4f510c80fac7008de0268f623fe04555bda..2533d7c95582f893b60de635b752141f1d604db8 100644 (file)
@@ -125,7 +125,7 @@ class BaseResponse extends BaseFrameworkSystem {
         */
        public final function addFatalMessage ($messageId) {
                // Adds the resolved message id to the fatal message list
-               $this->fatalMessages[] = $this->getApplicationInstance()->getLanguageInstance()->getMessage($messageId);
+               array_push($this->fatalMessages, $this->getApplicationInstance()->getLanguageInstance()->getMessage($messageId));
        }
 
        /**
@@ -136,7 +136,7 @@ class BaseResponse extends BaseFrameworkSystem {
         */
        public final function addFatalMessagePlain ($message) {
                // Adds the resolved message id to the fatal message list
-               $this->fatalMessages[] = $message;
+               array_push($this->fatalMessages, $message);
        }
 
        /**
index 46667de55bcc0fe22a4b68e80ee344a9a1f92f04..0f7f32fcf060f33e3082c09260bb8958a1651a54 100644 (file)
@@ -345,7 +345,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                $currVars = $this->readCurrentGroup();
 
                // Append our variable
-               $currVars[] = $this->generateVariableArray($variableName, $value);
+               array_push($currVars, $this->generateVariableArray($variableName, $value));
 
                // Add it to the stack
                $this->setVarStack($this->currGroup, $currVars);
@@ -420,7 +420,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                // Is the variable set?
                if ($index === FALSE) {
                        // Not found, add it
-                       $this->varStack[$varGroup][] = $this->generateVariableArray($variableName, $value);
+                       array_push($this->varStack[$varGroup], $this->generateVariableArray($variableName, $value));
                } else {
                        // Then modify it
                        $this->setVariableValue($this->currGroup, $index, $value);
@@ -879,13 +879,13 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                                        $this->loadedRawData[$template] = $this->readVariable($template, 'config');
 
                                        // Recursive protection:
-                                       $this->loadedTemplates[] = $template;
+                                       array_push($this->loadedTemplates, $template);
                                } elseif ($this->getVariableIndex($template) !== FALSE) {
                                        // Use that content here
                                        $this->loadedRawData[$template] = $this->readVariable($template);
 
                                        // Recursive protection:
-                                       $this->loadedTemplates[] = $template;
+                                       array_push($this->loadedTemplates, $template);
                                } else {
                                        // Then try to search for code-templates
                                        try {
@@ -895,10 +895,10 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
 
                                                // Remember this template for recursion detection
                                                // RECURSIVE PROTECTION!
-                                               $this->loadedTemplates[] = $template;
+                                               array_push($this->loadedTemplates, $template);
                                        } catch (FileIoException $e) {
                                                // Even this is not done... :/
-                                               $this->rawTemplates[] = $template;
+                                               array_push($this->rawTemplates, $template);
                                        }
                                }
                        } // END - if
@@ -923,7 +923,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                } // END - if
 
                // Remember this template being compiled
-               $this->compiledTemplates[] = $template;
+               array_push($this->compiledTemplates, $template);
 
                // Compile the loaded code in five steps:
                //
@@ -994,7 +994,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
 
                                        // Remember this template for recursion detection
                                        // RECURSIVE PROTECTION!
-                                       $this->loadedTemplates[] = $template;
+                                       array_push($this->loadedTemplates, $template);
                                } catch (FileIoException $e) {
                                        // This template was never found. We silently ignore it
                                        unset($this->rawTemplates[$key]);
index d2e105488c8b40ca83ce8e40e09223de992a9106..45c42f18413afc0607b16474389f70afd90b1bcd 100644 (file)
@@ -392,7 +392,7 @@ class WernisApi extends BaseFrameworkSystem {
                // Generate request header
                $request  = "GET /".trim($script)." HTTP/1.0\r\n";
                $request .= "Host: ".$host."\r\n";
-               $request .= sprintf("User-Agent: Bube oder Dame / 1.0 by Quix0r [Spieler: %d]\r\n\r\n", $this->w_id);
+               $request .= sprintf("User-Agent: WernisApi/1.0 by Quix0r [Spieler: %d]\r\n\r\n", $this->w_id);
 
                // Initialize array
                $response = array();
@@ -402,17 +402,17 @@ class WernisApi extends BaseFrameworkSystem {
 
                // Read response
                while(!feof($fp)) {
-                       $response[] = trim(fgets($fp, 1024));
-               }
+                       array_push($response, trim(fgets($fp, 1024)));
+               } // END - while
 
                // Close socket
                fclose($fp);
 
                // Was the request successfull?
-               if ((!ereg("200 OK", $response[0])) && (empty($response[0]))) {
+               if ((!ereg('200 OK', $response[0])) && (empty($response[0]))) {
                        // Not found / access forbidden
                        $response = array('', '', '');
-               }
+               } // END - if
 
                // Return response
                return $response;
index 7c9afa937f31af5e32c55b20769e6aa18dc34791..d7c3c33d48e6e3b6b1c3e0576398fcb31bf4717c 100644 (file)
@@ -253,10 +253,10 @@ class ClassLoader {
                 * scanning the whole directory structure starting from given base
                 * path.
                 */
-               $ignoreList[] = '.';
-               $ignoreList[] = '..';
-               $ignoreList[] = '.htaccess';
-               $ignoreList[] = '.svn';
+               array_push($ignoreList, '.');
+               array_push($ignoreList, '..');
+               array_push($ignoreList, '.htaccess');
+               array_push($ignoreList, '.svn');
 
                // Keep it in class for later usage
                $this->ignoreList = $ignoreList;
@@ -346,7 +346,7 @@ class ClassLoader {
                        $this->total++;
 
                        // Mark this class as loaded
-                       $this->loadedClasses[] = $this->classes[$fileName];
+                       array_push($this->loadedClasses, $this->classes[$fileName]);
 
                        // Remove it from classes list
                        unset($this->classes[$fileName]);