| Total Complexity | 6 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | class UploadAnnotation extends AbstractAnnotation |
||
| 28 | { |
||
| 29 | /** |
||
| 30 | * The name of the upload field |
||
| 31 | * |
||
| 32 | * @var string |
||
| 33 | */ |
||
| 34 | protected $sField = ''; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @inheritDoc |
||
| 38 | * @throws AnnotationException |
||
| 39 | */ |
||
| 40 | public function initAnnotation(array $properties) |
||
| 41 | { |
||
| 42 | if(count($properties) != 1 || !isset($properties['field']) || !is_string($properties['field'])) |
||
| 43 | { |
||
| 44 | throw new AnnotationException('The @upload annotation requires a property "field" of type string'); |
||
| 45 | } |
||
| 46 | $this->sField = $properties['field']; |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @inheritDoc |
||
| 51 | */ |
||
| 52 | public function getName(): string |
||
| 53 | { |
||
| 54 | return 'upload'; |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @inheritDoc |
||
| 59 | */ |
||
| 60 | public function getValue() |
||
| 63 | } |
||
| 64 | } |
||
| 65 |