1 | <?php |
||
8 | class File implements ResultInterface |
||
9 | { |
||
10 | |||
11 | /** |
||
12 | * Array containing the details of the uploaded file: |
||
13 | * - name (uploaded name) |
||
14 | * - original name |
||
15 | * - tmp_name |
||
16 | * etc |
||
17 | * |
||
18 | * @var array |
||
19 | */ |
||
20 | protected $file; |
||
21 | |||
22 | /** |
||
23 | * The container to which this file belongs to |
||
24 | * @var ContainerInterface |
||
25 | */ |
||
26 | protected $container; |
||
27 | |||
28 | /** |
||
29 | * @param $file |
||
30 | * @param ContainerInterface $container |
||
31 | 11 | */ |
|
32 | public function __construct($file, ContainerInterface $container) |
||
37 | |||
38 | /** |
||
39 | * Returns if the uploaded file is valid |
||
40 | * |
||
41 | * @return bool |
||
42 | 1 | */ |
|
43 | public function isValid():bool |
||
47 | |||
48 | /** |
||
49 | * Returns the validation error messages |
||
50 | * |
||
51 | * @return array |
||
52 | 3 | */ |
|
53 | public function getMessages():array |
||
61 | |||
62 | /** |
||
63 | * The file that was saved during process() and has a .lock file attached |
||
64 | * will be cleared, in case the form processing fails |
||
65 | 2 | */ |
|
66 | public function clear() |
||
72 | |||
73 | /** |
||
74 | * Remove the .lock file attached to the file that was saved during process() |
||
75 | * This should happen if the form fails validation/processing |
||
76 | 3 | */ |
|
77 | public function confirm() |
||
81 | |||
82 | /** |
||
83 | * File attribute getter |
||
84 | * |
||
85 | * @param $name |
||
86 | * @return mixed |
||
87 | 8 | */ |
|
88 | public function __get($name) |
||
96 | } |
||
97 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.