Skip to content

Commit

Permalink
Finish moving method and remove static access.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jul 27, 2013
1 parent 53674f9 commit b5e44a6
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 11 deletions.
3 changes: 1 addition & 2 deletions lib/Cake/Console/Shell.php
Expand Up @@ -29,7 +29,6 @@
use Cake\Utility\File;
use Cake\Utility\Inflector;
use Cake\Utility\MergeVariablesTrait;
use Cake\Utility\ObjectCollection;
use Cake\Utility\String;

/**
Expand Down Expand Up @@ -315,7 +314,7 @@ public function loadTasks() {
if ($this->tasks === true || empty($this->tasks) || empty($this->Tasks)) {
return true;
}
$this->_taskMap = ObjectCollection::normalizeObjectArray((array)$this->tasks);
$this->_taskMap = $this->Tasks->normalizeArray((array)$this->tasks);
$this->taskNames = array_merge($this->taskNames, array_keys($this->_taskMap));
return true;
}
Expand Down
3 changes: 1 addition & 2 deletions lib/Cake/Controller/Component.php
Expand Up @@ -17,7 +17,6 @@
use Cake\Core\Object;
use Cake\Event\Event;
use Cake\Event\EventListener;
use Cake\Utility\ObjectCollection;

/**
* Base class for an individual Component. Components provide reusable bits of
Expand Down Expand Up @@ -103,7 +102,7 @@ public function __construct(ComponentRegistry $registry, $settings = []) {
$this->settings = $settings;
$this->_set($settings);
if (!empty($this->components)) {
$this->_componentMap = ObjectCollection::normalizeObjectArray($this->components);
$this->_componentMap = $registry->normalizeArray($this->components);
}
}

Expand Down
3 changes: 1 addition & 2 deletions lib/Cake/Controller/Controller.php
Expand Up @@ -28,7 +28,6 @@
use Cake\Routing\Router;
use Cake\Utility\ClassRegistry;
use Cake\Utility\Inflector;
use Cake\Utility\ObjectCollection;
use Cake\Utility\MergeVariablesTrait;
use Cake\Utility\ViewVarsTrait;
use Cake\View\View;
Expand Down Expand Up @@ -617,7 +616,7 @@ protected function _loadComponents() {
if (empty($this->components)) {
return;
}
$components = ObjectCollection::normalizeObjectArray($this->components);
$components = $this->Components->normalizeArray($this->components);
foreach ($components as $properties) {
list(, $class) = pluginSplit($properties['class']);
$this->{$class} = $this->Components->load($properties['class'], $properties['settings']);
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Utility/ObjectRegistry.php
Expand Up @@ -90,7 +90,7 @@ public function __isset($name) {
* @param array $objects Array of child objects to normalize.
* @return array Array of normalized objects.
*/
public static function normalizeObjectArray($objects) {
public function normalizeArray($objects) {
$normal = array();
foreach ($objects as $i => $objectName) {
$options = array();
Expand Down
3 changes: 1 addition & 2 deletions lib/Cake/View/Helper.php
Expand Up @@ -24,7 +24,6 @@
use Cake\Utility\ClassRegistry;
use Cake\Utility\Hash;
use Cake\Utility\Inflector;
use Cake\Utility\ObjectCollection;

/**
* Abstract base class for all other Helpers in CakePHP.
Expand Down Expand Up @@ -203,7 +202,7 @@ public function __construct(View $View, $settings = array()) {
$this->settings = Hash::merge($this->settings, $settings);
}
if (!empty($this->helpers)) {
$this->_helperMap = ObjectCollection::normalizeObjectArray($this->helpers);
$this->_helperMap = $View->Helpers->normalizeArray($this->helpers);
}
}

Expand Down
3 changes: 1 addition & 2 deletions lib/Cake/View/View.php
Expand Up @@ -33,7 +33,6 @@
use Cake\Routing\RequestActionTrait;
use Cake\Routing\Router;
use Cake\Utility\Inflector;
use Cake\Utility\ObjectCollection;
use Cake\Utility\ViewVarsTrait;

/**
Expand Down Expand Up @@ -834,7 +833,7 @@ public function __isset($name) {
* @return void
*/
public function loadHelpers() {
$helpers = ObjectCollection::normalizeObjectArray($this->helpers);
$helpers = $this->Helpers->normalizeArray($this->helpers);
foreach ($helpers as $properties) {
list(, $class) = pluginSplit($properties['class']);
$this->{$class} = $this->Helpers->load($properties['class'], $properties['settings']);
Expand Down

0 comments on commit b5e44a6

Please sign in to comment.