summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgodzilla80@gmx.net <>2009-03-19 22:07:39 +0000
committergodzilla80@gmx.net <>2009-03-19 22:07:39 +0000
commitd634db87d432c87a092f1c4cee69a56914cbaa97 (patch)
tree2a681041b70b22b61f3325725d663d62f8338e50
parentde021710e1c0dae732e61ecb42a9ac60440f55ee (diff)
replace array_push() function calls with native language constuct if make sense
-rw-r--r--HISTORY3
-rw-r--r--framework/Collections/TQueue.php2
-rw-r--r--framework/Collections/TStack.php2
-rw-r--r--framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php2
-rw-r--r--framework/Data/SqlMap/Statements/TMappedStatement.php2
-rw-r--r--framework/Web/Javascripts/TJSON.php16
-rw-r--r--framework/Web/UI/THtmlWriter.php4
-rw-r--r--framework/Web/UI/TTemplateManager.php4
8 files changed, 18 insertions, 17 deletions
diff --git a/HISTORY b/HISTORY
index 4da3e9d4..17ef4fda 100644
--- a/HISTORY
+++ b/HISTORY
@@ -14,7 +14,8 @@ CHG: Issue#7 - Clients Scripts are not combined anymore in Debug application mod
ENH: Issue#115 - Registry for Prado generated clientside counterparts of serverside controls (Yves Berkholz)
ENH: Added caching of message files to TException (Michael)
ENH: Updated to scriptaculous 1.8.2 & Prototype 1.6.0.3
-ENH: replace is_null() function calls with native native language constuct (Yves)
+ENH: replace is_null() function calls with native language constuct (Yves)
+ENH: replace array_push() function calls with native language constuct if make sense (Yves)
Version 3.1.4 January 11, 2009
BUG: Issue#9 - Global page properties are ignored when using external configuration (Christophe)
diff --git a/framework/Collections/TQueue.php b/framework/Collections/TQueue.php
index d8b692d1..1eacfb0a 100644
--- a/framework/Collections/TQueue.php
+++ b/framework/Collections/TQueue.php
@@ -141,7 +141,7 @@ class TQueue extends TComponent implements IteratorAggregate,Countable
public function enqueue($item)
{
++$this->_c;
- array_push($this->_d,$item);
+ $this->_d[] = $item;
}
/**
diff --git a/framework/Collections/TStack.php b/framework/Collections/TStack.php
index 0d3890b4..3c8d5fc6 100644
--- a/framework/Collections/TStack.php
+++ b/framework/Collections/TStack.php
@@ -140,7 +140,7 @@ class TStack extends TComponent implements IteratorAggregate,Countable
public function push($item)
{
++$this->_c;
- array_push($this->_d,$item);
+ $this->_d[] = $item;
}
/**
diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php b/framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php
index a352cb07..85dd6735 100644
--- a/framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php
+++ b/framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php
@@ -84,7 +84,7 @@ abstract class TActiveRecordRelation
$obj->collectForeignObjects($results);
}
else if($results instanceof TActiveRecordRelation)
- array_push($stack,$this); //call it later
+ $stack[] = $this; //call it later
return $results;
}
diff --git a/framework/Data/SqlMap/Statements/TMappedStatement.php b/framework/Data/SqlMap/Statements/TMappedStatement.php
index 6b11b107..c4bb53dd 100644
--- a/framework/Data/SqlMap/Statements/TMappedStatement.php
+++ b/framework/Data/SqlMap/Statements/TMappedStatement.php
@@ -869,7 +869,7 @@ class TMappedStatement extends TComponent implements IMappedStatement
$postSelect->setMethod(self::QUERY_FOR_OBJECT);
if(!$property->getLazyLoad())
- array_push($this->_selectQueque, $postSelect);
+ $this->_selectQueque[] = $postSelect;
}
/**
diff --git a/framework/Web/Javascripts/TJSON.php b/framework/Web/Javascripts/TJSON.php
index a52a0634..92a58815 100644
--- a/framework/Web/Javascripts/TJSON.php
+++ b/framework/Web/Javascripts/TJSON.php
@@ -508,9 +508,9 @@ class TJSON
}
}
- array_push($stk, array('what' => self::JSON_SLICE,
+ $stk[] = array('what' => self::JSON_SLICE,
'where' => 0,
- 'delim' => false));
+ 'delim' => false);
$chrs = substr($str, 1, -1);
$chrs = $this->reduce_string($chrs);
@@ -538,12 +538,12 @@ class TJSON
// found a comma that is not inside a string, array, etc.,
// OR we've reached the end of the character list
$slice = substr($chrs, $top['where'], ($c - $top['where']));
- array_push($stk, array('what' => self::JSON_SLICE, 'where' => ($c + 1), 'delim' => false));
+ $stk[] = array('what' => self::JSON_SLICE, 'where' => ($c + 1), 'delim' => false);
//print("Found split at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
if (reset($stk) == self::JSON_IN_ARR) {
// we are in an array, so just push an element onto the stack
- array_push($arr, $this->decode($slice));
+ $arr[] = $this->decode($slice);
} elseif (reset($stk) == self::JSON_IN_OBJ) {
// we are in an object, so figure
@@ -576,7 +576,7 @@ class TJSON
} elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != self::JSON_IN_STR)) {
// found a quote, and we are not inside a string
- array_push($stk, array('what' => self::JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c}));
+ $stk = array('what' => self::JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c});
//print("Found start of string at {$c}\n");
} elseif (($chrs{$c} == $top['delim']) &&
@@ -590,7 +590,7 @@ class TJSON
} elseif (($chrs{$c} == '[') &&
in_array($top['what'], array(self::JSON_SLICE, self::JSON_IN_ARR, self::JSON_IN_OBJ))) {
// found a left-bracket, and we are in an array, object, or slice
- array_push($stk, array('what' => self::JSON_IN_ARR, 'where' => $c, 'delim' => false));
+ $stk = array('what' => self::JSON_IN_ARR, 'where' => $c, 'delim' => false);
//print("Found start of array at {$c}\n");
} elseif (($chrs{$c} == ']') && ($top['what'] == self::JSON_IN_ARR)) {
@@ -601,7 +601,7 @@ class TJSON
} elseif (($chrs{$c} == '{') &&
in_array($top['what'], array(self::JSON_SLICE, self::JSON_IN_ARR, self::JSON_IN_OBJ))) {
// found a left-brace, and we are in an array, object, or slice
- array_push($stk, array('what' => self::JSON_IN_OBJ, 'where' => $c, 'delim' => false));
+ $stk = array('what' => self::JSON_IN_OBJ, 'where' => $c, 'delim' => false);
//print("Found start of object at {$c}\n");
} elseif (($chrs{$c} == '}') && ($top['what'] == self::JSON_IN_OBJ)) {
@@ -612,7 +612,7 @@ class TJSON
} elseif (($substr_chrs_c_2 == '/*') &&
in_array($top['what'], array(self::JSON_SLICE, self::JSON_IN_ARR, self::JSON_IN_OBJ))) {
// found a comment start, and we are in an array, object, or slice
- array_push($stk, array('what' => self::JSON_IN_CMT, 'where' => $c, 'delim' => false));
+ $stk = array('what' => self::JSON_IN_CMT, 'where' => $c, 'delim' => false);
$c++;
//print("Found start of comment at {$c}\n");
diff --git a/framework/Web/UI/THtmlWriter.php b/framework/Web/UI/THtmlWriter.php
index 217b9663..9713d941 100644
--- a/framework/Web/UI/THtmlWriter.php
+++ b/framework/Web/UI/THtmlWriter.php
@@ -232,12 +232,12 @@ class THtmlWriter extends TApplicationComponent implements ITextWriter
if(isset(self::$_simpleTags[$tagName]))
{
$str.=' />';
- array_push($this->_openTags,'');
+ $this->_openTags[] = '';
}
else
{
$str.='>';
- array_push($this->_openTags,$tagName);
+ $this->_openTags[] = $tagName;
}
$this->_writer->write($str);
$this->_attributes=array();
diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php
index f44d414c..6d44d7d7 100644
--- a/framework/Web/UI/TTemplateManager.php
+++ b/framework/Web/UI/TTemplateManager.php
@@ -608,7 +608,7 @@ class TTemplate extends TApplicationComponent implements ITemplate
$tpl[$c++]=array($container,$type,$attributes);
if($str[strlen($str)-2]!=='/') // open tag
{
- array_push($stack,$type);
+ $stack[] = $type;
$container=$c-1;
}
}
@@ -695,7 +695,7 @@ class TTemplate extends TApplicationComponent implements ITemplate
else // regular property
{
$prop=strtolower($match[3][0]);
- array_push($stack,'@'.$prop);
+ $stack[] = '@'.$prop;
if(!$expectPropEnd)
{
if($matchStart>$textStart)