| 1 | <?php |
||
| 23 | class ContentFactory |
||
| 24 | { |
||
| 25 | /** |
||
| 26 | * @const string |
||
| 27 | */ |
||
| 28 | const EXT_TXT = 'txt'; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @const string |
||
| 32 | */ |
||
| 33 | const EXT_JSON = 'json'; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @const string |
||
| 37 | */ |
||
| 38 | const EXT_YAML = 'yaml'; |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @const string |
||
| 42 | */ |
||
| 43 | const EXT_YML = 'yml'; |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Create a ContentInterface based on the extension and string content |
||
| 47 | * @param string $extension |
||
| 48 | * @param string $content |
||
| 49 | * @return \NeedleProject\FileIo\Content\ContentInterface |
||
|
|
|||
| 50 | */ |
||
| 51 | 8 | public function create($extension, $content) |
|
| 75 | } |
||
| 76 |
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.