Skip to content
Permalink
Browse files

Finish moving method and remove static access.

  • Loading branch information...
markstory committed Jul 25, 2013
1 parent 53674f9 commit b5e44a659dc73966b8c910cda60430d27ffbbb77
@@ -29,7 +29,6 @@
use Cake\Utility\File;
use Cake\Utility\Inflector;
use Cake\Utility\MergeVariablesTrait;
use Cake\Utility\ObjectCollection;
use Cake\Utility\String;
/**
@@ -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;
}
@@ -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
@@ -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);
}
}
@@ -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;
@@ -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']);
@@ -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();
@@ -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.
@@ -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);
}
}
@@ -33,7 +33,6 @@
use Cake\Routing\RequestActionTrait;
use Cake\Routing\Router;
use Cake\Utility\Inflector;
use Cake\Utility\ObjectCollection;
use Cake\Utility\ViewVarsTrait;
/**
@@ -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']);

0 comments on commit b5e44a6

Please sign in to comment.
You can’t perform that action at this time.