PHPackages                             arthurkushman/raml-php-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. arthurkushman/raml-php-parser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

arthurkushman/raml-php-parser
=============================

A RAML parser built in php

v4.8.0(4y ago)04MITPHPPHP ^7.3|^8.0

Since Jun 26Pushed 4y agoCompare

[ Source](https://github.com/arthurkushman/raml-php-parser)[ Packagist](https://packagist.org/packages/arthurkushman/raml-php-parser)[ Docs](https://github.com/raml-org/raml-php-parser)[ RSS](/packages/arthurkushman-raml-php-parser/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (12)Versions (52)Used By (0)

[![Build Status](https://camo.githubusercontent.com/e35b1b6dbd169fe05fb74c48d2347ca72354d6dcf946169762b883d1c8c51906/68747470733a2f2f6170692e7472617669732d63692e6f72672f72616d6c2d6f72672f72616d6c2d7068702d7061727365722e7376673f6272616e63683d6d6173746572)](https://www.travis-ci.org/raml-org/raml-php-parser)[![Coverage Status](https://camo.githubusercontent.com/a763563fbf6291077d1b097ae56dc9472310386a4e8427808ad9f217d502bf5c/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f72616d6c2d6f72672f72616d6c2d7068702d7061727365722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/raml-org/raml-php-parser?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/58f1ae5e00f0d4006414039f9d6c5e78d87670ec7dcc7b37f3280a26e245bc85/68747470733a2f2f706f7365722e707567782e6f72672f72616d6c2d6f72672f72616d6c2d7068702d7061727365722f762f737461626c65)](https://packagist.org/packages/raml-org/raml-php-parser)[![Total Downloads](https://camo.githubusercontent.com/1a73f041245b9675ceb811931dc10fa1d00de722848d32ef9710fdda7bf2a630/68747470733a2f2f706f7365722e707567782e6f72672f72616d6c2d6f72672f72616d6c2d7068702d7061727365722f646f776e6c6f616473)](https://packagist.org/packages/raml-org/raml-php-parser)

See the [RAML specification](https://github.com/raml-org/raml-spec).

RAML 0.8 Support
----------------

[](#raml-08-support)

For RAML 0.8 support follow version 2.

RAML 1.0 Support
----------------

[](#raml-10-support)

For RAML 1.0 support follow version 3 or above. RAML 1.0 support is still work in progress.

*What is done and should work:*

- Part of RAML 1.0 [type expressions](https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md/#type-expressions)
- Enums
- Union type expression (the "or" `|` operator)
- Array of types
- `discriminator` and `discriminatorValue` facets
- Traits inheritance

*To be implemented:*

- [Libraries](https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md/#libraries)
- [User defined facets](https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md/#user-defined-facets)
- Full implementation of [type expressions](https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md/#type-expressions)
    - The shorthand array and the union type have been implemented
    - Bi-dimensional array and the array-union combination have **NOT** been implemented yet.
- [Multiple inheritance](https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md/#multiple-inheritance)
- [Annotations](https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md/#annotations)
- [Overlays and Extensions](https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md/#overlays-and-extensions)
- [Improved Security Schemes](https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md/#security-schemes)

### Get started

[](#get-started)

Requires:

- composer (see )

```
composer require raml-org/raml-php-parser
```

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

$title = $apiDef->getTitle();
```

### Parsing schemas

[](#parsing-schemas)

The library can convert schemas into an validation object. There is a default list, or they can be configured manually. Each schema parser needs to conform to `Raml\Schema\SchemaParserInterface` and will return a instance of `Raml\Schema\SchemaDefinitionInterface`.

Additional parsers and schema definitions can be created and passed into the `Raml\Parser` constructor

### Exporting routes

[](#exporting-routes)

It is also possible to export the entire RAML file to an array of the full endpoints. For example, considering a [basic RAML](https://github.com/raml-org/raml-php-parser/blob/master/tests/fixture/simple.raml), this can be returned using:

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

$routes = $api->getResourcesAsUri();
```

To return:

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

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

#### Route Formatters

[](#route-formatters)

There are two Route Formatters included in the package:

- `NoRouteFormatter` which does nothing and simply echoes the result
- `SymfonyRouteFormatter` which adds the routes to a Symfony `RouteCollection`

### Contributing

[](#contributing)

```
composer run-static-analysis
composer check-code-style
composer run-tests
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~54 days

Recently: every ~186 days

Total

50

Last Release

1683d ago

Major Versions

0.6.3 → 1.0.02015-03-26

1.1.1 → 2.0.02015-08-17

v2.3.4 → 3.0.02018-04-28

3.0.1 → 4.0.02018-05-18

v2.x-dev → v4.4.02019-08-03

PHP version history (4 changes)2.1.1PHP &gt;=5.4

2.2.0PHP &gt;=5.5.9

v4.3.0PHP ^5.6|^7.0

v4.8.0PHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/1f7457ca41f3ffc690f41a6035fdeb4ab8eced3871a3061a638fd8dc80343588?d=identicon)[arthurkushman](/maintainers/arthurkushman)

---

Top Contributors

[![alecsammon](https://avatars.githubusercontent.com/u/304636?v=4)](https://github.com/alecsammon "alecsammon (117 commits)")[![martin-georgiev](https://avatars.githubusercontent.com/u/4849482?v=4)](https://github.com/martin-georgiev "martin-georgiev (62 commits)")[![arheyy](https://avatars.githubusercontent.com/u/3725761?v=4)](https://github.com/arheyy "arheyy (41 commits)")[![qpautrat](https://avatars.githubusercontent.com/u/1844413?v=4)](https://github.com/qpautrat "qpautrat (20 commits)")[![pies](https://avatars.githubusercontent.com/u/37940?v=4)](https://github.com/pies "pies (18 commits)")[![akostylev0](https://avatars.githubusercontent.com/u/971482?v=4)](https://github.com/akostylev0 "akostylev0 (11 commits)")[![InfopactMLoos](https://avatars.githubusercontent.com/u/22300844?v=4)](https://github.com/InfopactMLoos "InfopactMLoos (8 commits)")[![Toflar](https://avatars.githubusercontent.com/u/481937?v=4)](https://github.com/Toflar "Toflar (5 commits)")[![dice4x4](https://avatars.githubusercontent.com/u/3447911?v=4)](https://github.com/dice4x4 "dice4x4 (4 commits)")[![h4cc](https://avatars.githubusercontent.com/u/2981491?v=4)](https://github.com/h4cc "h4cc (3 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (3 commits)")[![titomiguelcosta](https://avatars.githubusercontent.com/u/192639?v=4)](https://github.com/titomiguelcosta "titomiguelcosta (3 commits)")[![rgzp](https://avatars.githubusercontent.com/u/54394965?v=4)](https://github.com/rgzp "rgzp (3 commits)")[![cozylife](https://avatars.githubusercontent.com/u/81341241?v=4)](https://github.com/cozylife "cozylife (3 commits)")[![nofirg](https://avatars.githubusercontent.com/u/2039820?v=4)](https://github.com/nofirg "nofirg (3 commits)")[![vbartusevicius](https://avatars.githubusercontent.com/u/7325630?v=4)](https://github.com/vbartusevicius "vbartusevicius (2 commits)")[![arthurkushman](https://avatars.githubusercontent.com/u/2669610?v=4)](https://github.com/arthurkushman "arthurkushman (2 commits)")[![DenisovMaksim](https://avatars.githubusercontent.com/u/31407327?v=4)](https://github.com/DenisovMaksim "DenisovMaksim (2 commits)")[![RETFU](https://avatars.githubusercontent.com/u/9899838?v=4)](https://github.com/RETFU "RETFU (2 commits)")[![lstrojny](https://avatars.githubusercontent.com/u/79707?v=4)](https://github.com/lstrojny "lstrojny (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/arthurkushman-raml-php-parser/health.svg)

```
[![Health](https://phpackages.com/badges/arthurkushman-raml-php-parser/health.svg)](https://phpackages.com/packages/arthurkushman-raml-php-parser)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[wikimedia/parsoid

Parsoid, a bidirectional parser between wikitext and HTML5

171524.3k1](/packages/wikimedia-parsoid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
