src/Valuestore.php
public function push(string $name, $pushValue)
    {
        if (! is_array($pushValue)) {
            $pushValue = [$pushValue];
        }

        if (! $this->has($name)) {
            $this->put($name, $pushValue);

            return $this;
        }

        $oldValue = $this->get($name);

        if (! is_array($oldValue)) {
            $oldValue = [$oldValue];
        }

        $newValue = array_merge($oldValue, $pushValue);

        $this->put($name, $newValue);

        return $this;
    }
public function push(string $name, $pushValue)
    {
        if (! is_array($pushValue)) {
            $pushValue = [$pushValue];
        }

        if (! $this->has($name)) {
            $this->put($name, $pushValue);

            return $this;
        }

        $oldValue = $this->get($name);

        if (! is_array($oldValue)) {
            $oldValue = [$oldValue];
        }

        $newValue = array_merge($oldValue, $pushValue);

        $this->put($name, $newValue);

        return $this;
    }
public function push ( string $ name , $ pushValue ) { if ( ! is_array ( $ pushValue ) ) { $ pushValue = [ $ pushValue ] ; } if ( ! $ this -> has ( $ name ) ) { $ this -> put ( $ name , $ pushValue ) ; return $ this ; } $ oldValue = $ this -> get ( $ name ) ; if ( ! is_array ( $ oldValue ) ) { $ oldValue = [ $ oldValue ] ; } $ newValue = array_merge ( $ oldValue , $ pushValue ) ; $ this -> put ( $ name , $ newValue ) ; return $ this ; }
Push a new value into an array.

@param string $name
@param $pushValue

@return $this
Push a new value into an array .