src/Yggdrasil/Core/Controller/ApiController.php
protected function fromBody(string $key)
    {
        $dataCollection = $this->parseBody();

        if (!$this->inBody([$key])) {
            throw new \InvalidArgumentException('Data with key ' . $key . ' doesn\'t exist in request body.');
        }

        return $dataCollection[$key];
    }
protected function fromBody(string $key)
    {
        $dataCollection = $this->parseBody();

        if (!$this->inBody([$key])) {
            throw new \InvalidArgumentException('Data with key ' . $key . ' doesn\'t exist in request body.');
        }

        return $dataCollection[$key];
    }
protected function fromBody ( string $ key ) { $ dataCollection = $ this -> parseBody ( ) ; if ( ! $ this -> inBody ( [ $ key ] ) ) { throw new \ InvalidArgumentException ( 'Data with key ' . $ key . ' doesn\'t exist in request body.' ) ; } return $ dataCollection [ $ key ] ; }
Returns request body data specified by key

@param string $key
@return mixed
@throws \InvalidArgumentException if data specified by key doesn't exist
Returns request body data specified by key