1 | <?php |
||
15 | class SignupProviderForm extends \yii\base\Model |
||
16 | { |
||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | public $email; |
||
21 | /** |
||
22 | * @var \app\models\User |
||
23 | */ |
||
24 | private $user = null; |
||
25 | |||
26 | /** |
||
27 | * @param User $user |
||
28 | */ |
||
29 | public function __construct($user, $email) |
||
34 | |||
35 | /** |
||
36 | * @inheritdoc |
||
37 | */ |
||
38 | public function rules() |
||
51 | |||
52 | /** |
||
53 | * @inheritdoc |
||
54 | */ |
||
55 | public function attributeLabels() |
||
61 | |||
62 | /** |
||
63 | * Create manually UploadedFile instance by file path |
||
64 | * |
||
65 | * @param string $path file path |
||
66 | * @return UploadedFile |
||
67 | */ |
||
68 | private function makeUploadedFile(string $path): UploadedFile |
||
82 | |||
83 | /** |
||
84 | * Save photo |
||
85 | * |
||
86 | * @param \app\models\UserProfile $profile |
||
87 | * @param string $photo |
||
88 | * @return void |
||
89 | */ |
||
90 | private function savePhoto(UserProfile $profile, string $photo): void |
||
101 | |||
102 | /** |
||
103 | * Login |
||
104 | */ |
||
105 | public function login(): void |
||
110 | |||
111 | /** |
||
112 | * Signs user up |
||
113 | * |
||
114 | * @throws Exception |
||
115 | * @return \app\models\User |
||
116 | */ |
||
117 | public function signup(): User |
||
136 | |||
137 | /** |
||
138 | * Sends an email with a link, for confirm the email |
||
139 | * |
||
140 | * @throws UserException |
||
141 | */ |
||
142 | public function sendEmail(): void |
||
164 | } |
||
165 |
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: