1 | <?php |
||
8 | class Backup |
||
9 | { |
||
10 | /** @var \Illuminate\Contracts\Filesystem\Filesystem */ |
||
11 | protected $disk; |
||
12 | |||
13 | /** @var string */ |
||
14 | protected $path; |
||
15 | |||
16 | /** @var bool */ |
||
17 | protected $exists; |
||
18 | |||
19 | /** @var Carbon */ |
||
20 | protected $date; |
||
21 | |||
22 | /** @var int */ |
||
23 | protected $size; |
||
24 | |||
25 | public function __construct(Filesystem $disk, string $path) |
||
31 | |||
32 | public function disk(): Filesystem |
||
36 | |||
37 | public function path(): string |
||
41 | |||
42 | public function exists(): bool |
||
50 | |||
51 | public function date(): Carbon |
||
59 | |||
60 | /** |
||
61 | * Get the size in bytes. |
||
62 | */ |
||
63 | public function size(): int |
||
75 | |||
76 | public function stream() |
||
80 | |||
81 | public function delete() |
||
89 | } |
||
90 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: