src/Shell/Task/CsvModuleTask.php
protected function getTargetApiPath() : array
    {
        $result = [
            'fragment' => 'Controller/Api',
            'namespace' => 'App\Controller\Api',
        ];

        $versions = Utility::getApiVersions();

        if (empty($versions)) {
            return $result;
        }

        $recent = end($versions);

        if (preg_match('/^api(.*)$/', $recent['prefix'], $matches)) {
            $postfix = strtoupper($matches[1]);
            $result['fragment'] .= $postfix . '/';
            $result['namespace'] .= str_replace('/', '\\', $postfix);
        }

        return $result;
    }
protected function getTargetApiPath() : array
    {
        $result = [
            'fragment' => 'Controller/Api',
            'namespace' => 'App\Controller\Api',
        ];

        $versions = Utility::getApiVersions();

        if (empty($versions)) {
            return $result;
        }

        $recent = end($versions);

        if (preg_match('/^api(.*)$/', $recent['prefix'], $matches)) {
            $postfix = strtoupper($matches[1]);
            $result['fragment'] .= $postfix . '/';
            $result['namespace'] .= str_replace('/', '\\', $postfix);
        }

        return $result;
    }
protected function getTargetApiPath ( ) : array { $ result = [ 'fragment' => 'Controller/Api' , 'namespace' => 'App\Controller\Api' , ] ; $ versions = Utility :: getApiVersions ( ) ; if ( empty ( $ versions ) ) { return $ result ; } $ recent = end ( $ versions ) ; if ( preg_match ( '/^api(.*)$/' , $ recent [ 'prefix' ] , $ matches ) ) { $ postfix = strtoupper ( $ matches [ 1 ] ) ; $ result [ 'fragment' ] .= $ postfix . '/' ; $ result [ 'namespace' ] .= str_replace ( '/' , '\\' , $ postfix ) ; } return $ result ; }
Get Target API Path for API Controllers

We create API controllers for the most recent API version.

@return mixed[] $result containing path Fragment for baking.
Get Target API Path for API Controllers