| 1 | <?php |
||
| 5 | class Language |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * Application Object |
||
| 9 | * |
||
| 10 | * @var \System\Application |
||
| 11 | */ |
||
| 12 | private $app; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Constructor |
||
| 16 | * |
||
| 17 | * @param \System\Application $app |
||
| 18 | */ |
||
| 19 | public function __construct(Application $app) |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Get the language from cookies |
||
| 26 | * if not exists get it from .ENV |
||
| 27 | * |
||
| 28 | * @return string $language |
||
| 29 | */ |
||
| 30 | public function get() |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Set language in cookies |
||
| 43 | * |
||
| 44 | * @return string $lang |
||
| 45 | */ |
||
| 46 | public function set($value) |
||
| 50 | } |
||
| 51 |
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@propertyannotation 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.