Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2.0116 |
Changes | 0 |
1 | <?php |
||
12 | 2 | public function connect(Application $app) |
|
13 | { |
||
14 | // ensure that SchemaControllerProvider is called once |
||
15 | 2 | if( isset($app['schema.controller'])){ |
|
16 | $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 | 2 | $controllers = $app["controllers_factory"]; |
|
24 | |||
25 | 2 | $controllers->get("/{id}", 'schema.controller:read')->bind("schema") |
|
26 | 2 | ->after(new DescribedBySchemaHandler) |
|
27 | ; |
||
28 | |||
29 | 2 | return $controllers; |
|
30 | } |
||
31 | } |
||
32 |