1 | <?php |
||
8 | trait FilesTransformer |
||
9 | { |
||
10 | /** |
||
11 | * Transforms file array to instance of File object. |
||
12 | * |
||
13 | * @param array $file File array. |
||
14 | * |
||
15 | * @return \ArgentCrusade\Selectel\CloudStorage\Contracts\FileContract |
||
16 | */ |
||
17 | public function getFileFromArray(array $file) |
||
21 | |||
22 | /** |
||
23 | * Transforms Collection of file arrays (or plain array) to Collection of File objects. |
||
24 | * Warning: converting a lot of files to `File` instances may result in performance loss. |
||
25 | * |
||
26 | * @param array|\ArgentCrusade\Selectel\CloudStorage\Collections\Collection $files |
||
27 | * |
||
28 | * @return \ArgentCrusade\Selectel\CloudStorage\Collections\Collection |
||
29 | */ |
||
30 | public function getFilesCollectionFromArrays($files) |
||
40 | } |
||
41 |
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: