1 | <?php |
||
8 | class FilesystemIterator implements \Iterator { |
||
9 | |||
10 | /** |
||
11 | * @var EncoderInterface |
||
12 | */ |
||
13 | protected $encoder; |
||
14 | |||
15 | 5 | public function __construct(EncoderInterface $encoder, $path) |
|
20 | |||
21 | 1 | public function current() |
|
27 | |||
28 | 1 | public function key() |
|
32 | |||
33 | 1 | public function next() |
|
37 | |||
38 | 1 | public function rewind() |
|
42 | |||
43 | 1 | public function valid() |
|
47 | |||
48 | 5 | public function setIterator(\Iterator $iterator) |
|
52 | } |
||
53 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: