mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
Merge pull request #836 from dogmatic69/simplify-object-collection
PHP 5.4 strict error fix
This commit is contained in:
commit
051362a734
1 changed files with 4 additions and 2 deletions
|
@ -299,7 +299,8 @@ abstract class ObjectCollection {
|
||||||
*/
|
*/
|
||||||
public function set($name = null, $object = null) {
|
public function set($name = null, $object = null) {
|
||||||
if (!empty($name) && !empty($object)) {
|
if (!empty($name) && !empty($object)) {
|
||||||
$this->_loaded[array_pop(pluginSplit($name))] = $object;
|
list(, $name) = pluginSplit($name);
|
||||||
|
$this->_loaded[$name] = $object;
|
||||||
}
|
}
|
||||||
return $this->_loaded;
|
return $this->_loaded;
|
||||||
}
|
}
|
||||||
|
@ -319,7 +320,8 @@ abstract class ObjectCollection {
|
||||||
$options = (array)$objectName;
|
$options = (array)$objectName;
|
||||||
$objectName = $i;
|
$objectName = $i;
|
||||||
}
|
}
|
||||||
$normal[array_pop(pluginSplit($objectName))] = array('class' => $objectName, 'settings' => $options);
|
list(, $name) = pluginSplit($objectName);
|
||||||
|
$normal[$name] = array('class' => $objectName, 'settings' => $options);
|
||||||
}
|
}
|
||||||
return $normal;
|
return $normal;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue