modifs.mineures sans commentaires
This commit is contained in:
parent
e8b7ca91af
commit
6c7cef322d
|
@ -73,11 +73,11 @@ class akey {
|
||||||
static final function merge(&$array, $key, $merge): void {
|
static final function merge(&$array, $key, $merge): void {
|
||||||
if ($array instanceof ArrayAccess) {
|
if ($array instanceof ArrayAccess) {
|
||||||
$value = $array->offsetGet($key);
|
$value = $array->offsetGet($key);
|
||||||
cl::merge($value, $merge);
|
$value = cl::merge($value, $merge);
|
||||||
$array->offsetSet($key, $value);
|
$array->offsetSet($key, $value);
|
||||||
} else {
|
} else {
|
||||||
cl::ensure_array($array);
|
cl::ensure_array($array);
|
||||||
cl::merge($array[$key], $merge);
|
$array[$key] = cl::merge($array[$key], $merge);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ class mprop {
|
||||||
*/
|
*/
|
||||||
static final function merge(object $object, string $property, $array): void {
|
static final function merge(object $object, string $property, $array): void {
|
||||||
$values = cl::with(self::get($object, $property));
|
$values = cl::with(self::get($object, $property));
|
||||||
cl::merge($values, cl::with($array));
|
$values = cl::merge($values, cl::with($array));
|
||||||
self::set($object, $property, $values);
|
self::set($object, $property, $values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ class oprop {
|
||||||
$p = $c->getProperty($property);
|
$p = $c->getProperty($property);
|
||||||
$p->setAccessible(true);
|
$p->setAccessible(true);
|
||||||
$values = cl::with($p->getValue($object));
|
$values = cl::with($p->getValue($object));
|
||||||
cl::merge($values, cl::with($array));
|
$values = cl::merge($values, cl::with($array));
|
||||||
$p->setValue($object, $values);
|
$p->setValue($object, $values);
|
||||||
} catch (ReflectionException $e) {
|
} catch (ReflectionException $e) {
|
||||||
if (property_exists($object, $property)) {
|
if (property_exists($object, $property)) {
|
||||||
|
@ -121,7 +121,7 @@ class oprop {
|
||||||
} else {
|
} else {
|
||||||
$values = [];
|
$values = [];
|
||||||
}
|
}
|
||||||
cl::merge($values, cl::with($array));
|
$values = cl::merge($values, cl::with($array));
|
||||||
$object->$property = $values;
|
$object->$property = $values;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue