lib/Controller.php
public function setRequest(Request $request)
    {
        $this->request = $request;

        $parsedBody = $this->request->getParsedBody();

        if (!empty($parsedBody)) {
            if (is_array($parsedBody)) {
                $this->data = array_map('trim', (array)$parsedBody);
            } else {
                $this->data = $parsedBody;
            }
        }

        return $this;
    }
public function setRequest(Request $request)
    {
        $this->request = $request;

        $parsedBody = $this->request->getParsedBody();

        if (!empty($parsedBody)) {
            if (is_array($parsedBody)) {
                $this->data = array_map('trim', (array)$parsedBody);
            } else {
                $this->data = $parsedBody;
            }
        }

        return $this;
    }
public function setRequest ( Request $ request ) { $ this -> request = $ request ; $ parsedBody = $ this -> request -> getParsedBody ( ) ; if ( ! empty ( $ parsedBody ) ) { if ( is_array ( $ parsedBody ) ) { $ this -> data = array_map ( 'trim' , ( array ) $ parsedBody ) ; } else { $ this -> data = $ parsedBody ; } } return $ this ; }
Assign a request object

@param Request $request FIG-7 Request Interface

@return self
Assign a request object