mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge pull request #1055 from and-ers/master
Optimize and switch array_push() for [] =
This commit is contained in:
commit
a949988208
4 changed files with 5 additions and 5 deletions
|
@ -627,7 +627,7 @@ class ConsoleOptionParser {
|
|||
*/
|
||||
protected function _parseArg($argument, $args) {
|
||||
if (empty($this->_args)) {
|
||||
array_push($args, $argument);
|
||||
$args[] = $argument;
|
||||
return $args;
|
||||
}
|
||||
$next = count($args);
|
||||
|
@ -636,7 +636,7 @@ class ConsoleOptionParser {
|
|||
}
|
||||
|
||||
if ($this->_args[$next]->validChoice($argument)) {
|
||||
array_push($args, $argument);
|
||||
$args[] = $argument;
|
||||
return $args;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -523,7 +523,7 @@ class String {
|
|||
}
|
||||
} else {
|
||||
foreach ($droppedTags as $closingTag) {
|
||||
array_push($openTags, $closingTag[1]);
|
||||
$openTags[] = $closingTag[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ class ScaffoldView extends ThemeView {
|
|||
$paths = $this->_paths($this->plugin);
|
||||
$exts = array($this->ext);
|
||||
if ($this->ext !== '.ctp') {
|
||||
array_push($exts, '.ctp');
|
||||
$exts[] = '.ctp';
|
||||
}
|
||||
foreach ($exts as $ext) {
|
||||
foreach ($paths as $path) {
|
||||
|
|
|
@ -1058,7 +1058,7 @@ class View extends Object {
|
|||
protected function _getExtensions() {
|
||||
$exts = array($this->ext);
|
||||
if ($this->ext !== '.ctp') {
|
||||
array_push($exts, '.ctp');
|
||||
$exts[] = '.ctp';
|
||||
}
|
||||
return $exts;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue