src/Bag.php
public function pushTo($key, $value): bool
    {
        if (is_array($value)) {
            foreach ($value as $subKeykey => $value) {
                $this[$key][$subKeykey] = $value;
            }
        } else {
            $this[$key][] = $value;
        }

        return true;
    }
public function pushTo($key, $value): bool
    {
        if (is_array($value)) {
            foreach ($value as $subKeykey => $value) {
                $this[$key][$subKeykey] = $value;
            }
        } else {
            $this[$key][] = $value;
        }

        return true;
    }
public function pushTo ( $ key , $ value ) : bool { if ( is_array ( $ value ) ) { foreach ( $ value as $ subKeykey => $ value ) { $ this [ $ key ] [ $ subKeykey ] = $ value ; } } else { $ this [ $ key ] [ ] = $ value ; } return true ; }
Push a new item at the end of a item in the collection.

@todo MUST accept multilevel keys.

@param string $key   The item's key
@param mixed  $value The item's value

@return bool
Push a new item at the end of a item in the collection .