1 | <?php |
||
9 | class Generator |
||
10 | { |
||
11 | protected $amount = 1; |
||
12 | protected $uses = 1; |
||
13 | protected $email = null; |
||
14 | protected $expiry; |
||
15 | |||
16 | /** |
||
17 | * @var \Clarkeash\Doorman\DoormanManager |
||
18 | */ |
||
19 | protected $manager; |
||
20 | |||
21 | 8 | public function __construct(DoormanManager $manager) |
|
25 | |||
26 | /** |
||
27 | * @param int $amount |
||
28 | * |
||
29 | * @return $this |
||
30 | */ |
||
31 | 2 | public function times(int $amount = 1) |
|
37 | |||
38 | /** |
||
39 | * @param int $amount |
||
40 | * |
||
41 | * @return $this |
||
42 | */ |
||
43 | 1 | public function uses(int $amount = 1) |
|
49 | |||
50 | /** |
||
51 | * @param string $email |
||
52 | * |
||
53 | * @return $this |
||
54 | * @throws \Clarkeash\Doorman\Exceptions\DuplicateException |
||
55 | */ |
||
56 | 3 | public function for(string $email) |
|
66 | |||
67 | /** |
||
68 | * @param \Carbon\Carbon $date |
||
69 | * |
||
70 | * @return $this |
||
71 | */ |
||
72 | public function expiresOn(Carbon $date) |
||
73 | { |
||
74 | $this->expiry = $date; |
||
75 | |||
76 | return $this; |
||
77 | } |
||
78 | |||
79 | /** |
||
80 | * @param int $days |
||
81 | * |
||
82 | * @return $this |
||
83 | */ |
||
84 | public function expiresIn($days = 14) |
||
85 | { |
||
86 | $this->expiry = Carbon::now(config('app.timezone'))->addDays($days)->endOfDay(); |
||
87 | |||
88 | return $this; |
||
89 | } |
||
90 | |||
91 | /** |
||
92 | * @return \Clarkeash\Doorman\Models\Invite |
||
93 | */ |
||
94 | 6 | protected function build(): Invite |
|
104 | |||
105 | /** |
||
106 | * @return \Illuminate\Support\Collection |
||
107 | */ |
||
108 | 7 | public function make() |
|
126 | } |
||
127 |
Since your code implements the magic setter
_set
, this function will be called for any write access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write 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.