| Conditions | 4 |
| Paths | 4 |
| Total Lines | 23 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | public function createApiDocs($type = 'psfs') |
||
| 32 | { |
||
| 33 | $doc = $endpoints = []; |
||
| 34 | $modules = $this->srv->getModules(); |
||
| 35 | ini_set('memory_limit', -1); |
||
| 36 | ini_set('max_execution_time', -1); |
||
| 37 | if (count($modules)) { |
||
| 38 | foreach ($modules as $module) { |
||
| 39 | $endpoints = array_merge($endpoints, $this->srv->extractApiEndpoints($module)); |
||
| 40 | } |
||
| 41 | } |
||
| 42 | ini_restore('max_execution_time'); |
||
| 43 | ini_restore('memory_limit'); |
||
| 44 | |||
| 45 | switch (strtolower($type)) { |
||
| 46 | default: |
||
| 47 | case self::PSFS_DOC: |
||
| 48 | $doc = $endpoints; |
||
| 49 | break; |
||
| 50 | } |
||
| 51 | |||
| 52 | return $this->json($doc, 200); |
||
| 53 | } |
||
| 54 | } |
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.