protected function extractPayload($model, $comments = '')
    {
        $payload = [];
        preg_match('/@payload\ (.*)\n/i', $comments, $doc);
        $isArray = false;
        if (count($doc)) {
            $namespace = str_replace('{__API__}', $model, $doc[1]);
            if (false !== strpos($namespace, '[') && false !== strpos($namespace, ']')) {
                $namespace = str_replace(']', '', str_replace('[', '', $namespace));
                $isArray = true;
            }
            $payload = $this->extractModelFields($namespace);
            $reflector = new \ReflectionClass($namespace);
            $shortName = $reflector->getShortName();
        } else {
            $namespace = $model;
            $shortName = $model;
        }

        return [$namespace, $shortName, $payload, $isArray];
    }
protected function extractPayload($model, $comments = '')
    {
        $payload = [];
        preg_match('/@payload\ (.*)\n/i', $comments, $doc);
        $isArray = false;
        if (count($doc)) {
            $namespace = str_replace('{__API__}', $model, $doc[1]);
            if (false !== strpos($namespace, '[') && false !== strpos($namespace, ']')) {
                $namespace = str_replace(']', '', str_replace('[', '', $namespace));
                $isArray = true;
            }
            $payload = $this->extractModelFields($namespace);
            $reflector = new \ReflectionClass($namespace);
            $shortName = $reflector->getShortName();
        } else {
            $namespace = $model;
            $shortName = $model;
        }

        return [$namespace, $shortName, $payload, $isArray];
    }
protected function extractPayload ( $ model , $ comments = '' ) { $ payload = [ ] ; preg_match ( '/@payload\ (.*)\n/i' , $ comments , $ doc ) ; $ isArray = false ; if ( count ( $ doc ) ) { $ namespace = str_replace ( '{__API__}' , $ model , $ doc [ 1 ] ) ; if ( false !== strpos ( $ namespace , '[' ) && false !== strpos ( $ namespace , ']' ) ) { $ namespace = str_replace ( ']' , '' , str_replace ( '[' , '' , $ namespace ) ) ; $ isArray = true ; } $ payload = $ this -> extractModelFields ( $ namespace ) ; $ reflector = new \ ReflectionClass ( $ namespace ) ; $ shortName = $ reflector -> getShortName ( ) ; } else { $ namespace = $ model ; $ shortName = $ model ; } return [ $ namespace , $ shortName , $ payload , $ isArray ] ; }
Method that extract the payload for the endpoint

@param string $model
@param string $comments

@return array
Method that extract the payload for the endpoint