| Conditions | 1 |
| Paths | 1 |
| Total Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 1.008 |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | 18 | public function __construct($config = []) |
|
| 15 | { |
||
| 16 | 18 | parent::__construct($config); |
|
| 17 | 18 | ErrorHandler::register(); |
|
| 18 | |||
| 19 | // JSON/REST application |
||
| 20 | 18 | $this->register(new ContentNegotiationServiceProvider(), [ |
|
| 21 | 18 | "conneg.responseFormats" => ["json"], |
|
| 22 | "conneg.requestFormats" => ["json"], |
||
| 23 | "conneg.defaultFormat" => "json", |
||
| 24 | ]); |
||
| 25 | 18 | $this->register(new CorsServiceProvider()); |
|
| 26 | |||
| 27 | // JSON Schema application |
||
| 28 | 18 | $this->register(new JsonSchemaServiceProvider()); |
|
| 29 | |||
| 30 | // Error Handling |
||
| 31 | 18 | $this->error(new JsonErrorHandler($this)); |
|
| 32 | |||
| 33 | // CreateResourceController |
||
| 34 | $this["uniqid"] = function () { |
||
| 35 | return uniqid(); |
||
| 36 | }; |
||
| 37 | } |
||
| 38 | } |
||
| 39 |