| Conditions | 7 |
| Paths | 6 |
| Total Lines | 29 |
| Code Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 56 |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | public function createApiDocs($type = Api::PSFS_DOC) |
||
| 34 | { |
||
| 35 | ini_set('memory_limit', -1); |
||
| 36 | ini_set('max_execution_time', -1); |
||
| 37 | |||
| 38 | $endpoints = []; |
||
| 39 | $modules = $this->srv->getModules(); |
||
| 40 | |||
| 41 | switch (strtolower($type)) { |
||
| 42 | case self::SWAGGER_DOC: |
||
| 43 | $doc = DocumentorService::swaggerFormatter($modules); |
||
| 44 | break; |
||
| 45 | default: |
||
| 46 | case self::HTML_DOC: |
||
|
1 ignored issue
–
show
|
|||
| 47 | case self::PSFS_DOC: |
||
| 48 | if (count($modules)) { |
||
| 49 | foreach ($modules as $module) { |
||
| 50 | $endpoints = array_merge($endpoints, $this->srv->extractApiEndpoints($module)); |
||
| 51 | } |
||
| 52 | } |
||
| 53 | $doc = $endpoints; |
||
| 54 | break; |
||
| 55 | } |
||
| 56 | |||
| 57 | ini_restore('max_execution_time'); |
||
| 58 | ini_restore('memory_limit'); |
||
| 59 | |||
| 60 | return ($type === self::HTML_DOC) ? $this->render('documentation.html.twig', ["data" => json_encode($doc)]) : $this->json($doc, 200); |
||
| 61 | } |
||
| 62 | } |
This check compares the return type specified in the
@returnannotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.