| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | 4 | public function connect(Application $app) |
|
| 13 | { |
||
| 14 | // ensure that SchemaControllerProvider is called once |
||
| 15 | 4 | if( isset($app['schema.controller'])){ |
|
| 16 | 1 | $app->abort(501,'Sorry, you can create only one schema endpoint'); |
|
| 17 | } else { |
||
| 18 | $app['schema.controller'] = function(){ |
||
| 19 | return new ReadResourceController('schema'); |
||
| 20 | }; |
||
| 21 | } |
||
| 22 | |||
| 23 | 4 | $controllers = $app["controllers_factory"]; |
|
| 24 | |||
| 25 | 4 | $controllers->get("/{id}", 'schema.controller:read')->bind("schema") |
|
| 26 | 4 | ->after(new DescribedBySchemaHandler) |
|
| 27 | ; |
||
| 28 | |||
| 29 | 4 | return $controllers; |
|
| 30 | } |
||
| 31 | } |
||
| 32 |