Conditions | 5 |
Paths | 5 |
Total Lines | 24 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
51 | 8 | public function create($extension, $content) |
|
52 | { |
||
53 | switch ($extension) { |
||
54 | /** |
||
55 | * Create JSON Content |
||
56 | */ |
||
57 | 8 | case static::EXT_JSON: |
|
58 | 1 | return new JsonContent($content); |
|
59 | break; |
||
60 | /** |
||
61 | * Create YAML Content |
||
62 | */ |
||
63 | 7 | case static::EXT_YAML: |
|
64 | 7 | case static::EXT_YML: |
|
65 | 1 | return new YamlContent($content); |
|
66 | break; |
||
67 | /** |
||
68 | * Default TXT Content |
||
69 | */ |
||
70 | 6 | case static::EXT_TXT: |
|
71 | default: |
||
72 | 6 | return new Content($content); |
|
73 | } |
||
74 | } |
||
75 | } |
||
76 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.