src/Yggdrasil/Core/Controller/ApiController.php
protected function parseBody(): array
    {
        if ($this->getRequest()->headers->get('Content-Type') === 'application/json') {
            $dataCollection = json_decode($this->getRequest()->getContent(), true);
        } else {
            if ($this->getRequest()->isMethod('POST')) {
                $dataCollection = array_merge(
                    $this->getRequest()->request->all(),
                    $this->getRequest()->files->all()
                );
            } else {
                parse_str($this->getRequest()->getContent(), $dataCollection);
            }
        }

        return $dataCollection;
    }
protected function parseBody(): array
    {
        if ($this->getRequest()->headers->get('Content-Type') === 'application/json') {
            $dataCollection = json_decode($this->getRequest()->getContent(), true);
        } else {
            if ($this->getRequest()->isMethod('POST')) {
                $dataCollection = array_merge(
                    $this->getRequest()->request->all(),
                    $this->getRequest()->files->all()
                );
            } else {
                parse_str($this->getRequest()->getContent(), $dataCollection);
            }
        }

        return $dataCollection;
    }
protected function parseBody ( ) : array { if ( $ this -> getRequest ( ) -> headers -> get ( 'Content-Type' ) === 'application/json' ) { $ dataCollection = json_decode ( $ this -> getRequest ( ) -> getContent ( ) , true ) ; } else { if ( $ this -> getRequest ( ) -> isMethod ( 'POST' ) ) { $ dataCollection = array_merge ( $ this -> getRequest ( ) -> request -> all ( ) , $ this -> getRequest ( ) -> files -> all ( ) ) ; } else { parse_str ( $ this -> getRequest ( ) -> getContent ( ) , $ dataCollection ) ; } } return $ dataCollection ; }
Parses request body into array

@return array
Parses request body into array