- Completed merge
This commit is contained in:
1 parent
430cd03bc4
commit
00ebf3381f
10 files changed
+93
-34
No files matched your search
@@ -70,7 +70,6 @@ class EntityCollection extends \ArrayObject {
|
||||
public function removeOne($value, string $field, bool $strict = true) : ? object
|
||||
{
|
||||
foreach($this->search($value, $field, $strict) as $key => $item) {
|
||||
|
||||
$this->offsetUnset($key);
|
||||
|
||||
return $item;
|
||||
@@ -79,7 +78,7 @@ class EntityCollection extends \ArrayObject {
|
||||
return null;
|
||||
}
|
||||
|
||||
public function remove(/* mixed */ $values, string $field, bool $strict = true) : array
|
||||
public function remove(/* mixed */ $value, string $field, bool $strict = true) : array
|
||||
{
|
||||
$removed = [];
|
||||
|
||||
@@ -161,7 +160,7 @@ class EntityCollection extends \ArrayObject {
|
||||
$list = [];
|
||||
|
||||
foreach($this as $item) {
|
||||
if ( is_callable($field) ) {
|
||||
if ( ! is_string($field) && is_callable($field) ) {
|
||||
$value = call_user_func_array($field, [ $item ]);
|
||||
}
|
||||
else {
|
||||
@@ -173,7 +172,7 @@ class EntityCollection extends \ArrayObject {
|
||||
}
|
||||
|
||||
if ( $keyField !== null ) {
|
||||
if ( is_callable($keyField) ) {
|
||||
if ( ! is_string($field) && is_callable($keyField) ) {
|
||||
$key = call_user_func_array($keyField, [ $item ]);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in new issue
Block a user