PHP code example of arthurkushman / raml-php-parser

1. Go to this page and download the library: Download arthurkushman/raml-php-parser library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

arthurkushman / raml-php-parser example snippets


$parser = new \Raml\Parser();
$apiDef = $parser->parse($filename, true);

$title = $apiDef->getTitle();

$parser = new \Raml\Parser();
$api = $parser->parse('tests/fixture/simple.raml');

$routes = $api->getResourcesAsUri();

[
    GET /songs => ...
    POST /songs => ...
    GET /songs/{songId} => ...
    DELETE /songs/{songId} => ...
]

$routes = $api->getResourcesAsUri(new \Raml\RouteFormatter\NoRouteFormatter());