1 | <?php |
||
28 | class FileStorageData implements PayloadInterface |
||
29 | { |
||
30 | /** |
||
31 | * The path to persistant storage |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $path; |
||
35 | |||
36 | /** |
||
37 | * Initialize $this |
||
38 | * @param string $path to persistant storage |
||
39 | * @return void |
||
|
|||
40 | */ |
||
41 | public function __construct($path) |
||
46 | |||
47 | /** |
||
48 | * Get the path attribute. |
||
49 | * |
||
50 | * @return string |
||
51 | */ |
||
52 | public function getPath() |
||
56 | |||
57 | /** |
||
58 | * Implements PayloadInterface |
||
59 | * emit json payload. |
||
60 | * @return string |
||
61 | */ |
||
62 | public function toJson() |
||
66 | |||
67 | /** |
||
68 | * Implements PayloadInterface |
||
69 | * emit array payload. |
||
70 | * @return string |
||
71 | */ |
||
72 | public function toArray() |
||
76 | } |
||
77 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.