1 | <?php |
||
18 | trait UserAffiliate |
||
19 | { |
||
20 | /** |
||
21 | * @param string $path |
||
22 | * @param array $parameters |
||
23 | * @param null $secure |
||
24 | * |
||
25 | * @return string |
||
26 | */ |
||
27 | public function getAffiliateLink($path = '/', $parameters = [], $secure = null) |
||
33 | |||
34 | /** |
||
35 | * @return mixed |
||
36 | */ |
||
37 | public function referrals() |
||
41 | |||
42 | protected static function bootUserAffiliate() |
||
55 | |||
56 | /** |
||
57 | * Generate an affiliate id. |
||
58 | * |
||
59 | * @return \Ramsey\Uuid\UuidInterface |
||
60 | * |
||
61 | * @throws \Exception |
||
62 | */ |
||
63 | protected static function generateAffiliateId() |
||
67 | } |
||
68 |
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: