1 | <?php |
||
21 | class ConfigFile extends \hidev\base\Component implements \yii\base\Arrayable, \ArrayAccess, \IteratorAggregate |
||
22 | { |
||
23 | use \hiqdev\yii2\collection\ObjectTrait; |
||
24 | |||
25 | /** |
||
26 | * @var string specifies handler to be used |
||
27 | */ |
||
28 | public $fileType; |
||
29 | |||
30 | /** |
||
31 | * @var array|File the file to be handled |
||
32 | */ |
||
33 | protected $_file; |
||
34 | |||
35 | /** |
||
36 | * @var string path to copy from |
||
37 | */ |
||
38 | protected $_copy; |
||
39 | |||
40 | /** |
||
41 | * @var string the path to the file |
||
42 | */ |
||
43 | protected $_path; |
||
44 | |||
45 | /** |
||
46 | * @var string the template name |
||
47 | */ |
||
48 | protected $_template; |
||
49 | |||
50 | public function init() |
||
54 | |||
55 | /** |
||
56 | * Template setter. |
||
57 | * @param string $template name |
||
58 | */ |
||
59 | public function setTemplate($template) |
||
63 | |||
64 | /** |
||
65 | * Template getter. |
||
66 | */ |
||
67 | public function getTemplate() |
||
71 | |||
72 | /** |
||
73 | * Returns the file object. |
||
74 | * Instantiates it if necessary. |
||
75 | * @return File |
||
76 | */ |
||
77 | public function getFile() |
||
93 | |||
94 | /** |
||
95 | * Sets file with given info. |
||
96 | * @param mixed $info could be anything that is good for File::create |
||
97 | */ |
||
98 | public function setFile($info) |
||
102 | |||
103 | /** |
||
104 | * Sets the path to the file, but file info has precendence. |
||
105 | * @param string $value |
||
106 | */ |
||
107 | public function setPath($value) |
||
111 | |||
112 | /** |
||
113 | * Copy getter. Processes aliases. |
||
114 | */ |
||
115 | public function getCopy() |
||
119 | |||
120 | /** |
||
121 | * Dirname getter. |
||
122 | */ |
||
123 | public function getDirname() |
||
127 | |||
128 | /** |
||
129 | * Path getter. |
||
130 | */ |
||
131 | public function getPath() |
||
135 | |||
136 | /** |
||
137 | * Checks if the file exists. |
||
138 | */ |
||
139 | public function exists() |
||
143 | |||
144 | /** |
||
145 | * Read the file. |
||
146 | */ |
||
147 | public function read() |
||
151 | |||
152 | /** |
||
153 | * Read the file into array. |
||
154 | * @return array |
||
155 | */ |
||
156 | public function readArray() |
||
160 | |||
161 | public function load() |
||
170 | |||
171 | /** |
||
172 | * Save the file. |
||
173 | */ |
||
174 | public function save() |
||
182 | } |
||
183 |
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.