mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Fixing implementation of Set::remove() for instance and static calling
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4523 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
a633a7392a
commit
770446905a
1 changed files with 9 additions and 4 deletions
|
@ -286,9 +286,8 @@ class Set extends Object {
|
|||
* @param mixed $path A dot-separated string.
|
||||
* @return array
|
||||
*/
|
||||
function remove(&$list, $path, $data = null) {
|
||||
if (empty($data) && is_a($this, 'Set')) {
|
||||
$data = $path;
|
||||
function remove($list, $path = null) {
|
||||
if (empty($path) && is_a($this, 'Set')) {
|
||||
$path = $list;
|
||||
$list = $this->get();
|
||||
}
|
||||
|
@ -310,8 +309,14 @@ class Set extends Object {
|
|||
$_list =& $_list[$key];
|
||||
}
|
||||
}
|
||||
|
||||
if (is_a($this, 'Set')) {
|
||||
$this->value = $list;
|
||||
return $this;
|
||||
} else {
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Checks if a particular path is set in an array
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue