1 | <?php |
||
28 | class Login extends Component |
||
29 | { |
||
30 | use AssertionTrait; |
||
31 | |||
32 | const EVENT_BEFORE_RESPONSE_TO_USER = 'eventBeforeResponseToUser'; |
||
33 | const EVENT_AFTER_RESPONSE_TO_USER = 'eventAfterResponseToUser'; |
||
34 | |||
35 | public function transformToUser( |
||
36 | User $user, |
||
37 | SamlResponse $response, |
||
38 | ProviderRecord $idp, |
||
39 | ProviderRecord $sp, |
||
40 | Settings $settings |
||
41 | ) { |
||
42 | /** |
||
43 | * Before user transformation |
||
44 | */ |
||
45 | $event = new UserLogin(); |
||
46 | $event->response = $response; |
||
47 | $event->user = $user; |
||
48 | |||
49 | $this->trigger( |
||
50 | static::EVENT_BEFORE_RESPONSE_TO_USER, |
||
51 | $event |
||
52 | ); |
||
53 | |||
54 | // Sync |
||
55 | Saml::getInstance()->getUser()->sync( |
||
56 | $user, |
||
57 | $response, |
||
58 | $idp, |
||
59 | $sp, |
||
60 | $settings |
||
61 | ); |
||
62 | |||
63 | /** |
||
64 | * After user save |
||
65 | */ |
||
66 | $event = new UserLogin(); |
||
67 | $event->response = $response; |
||
68 | $event->user = $user; |
||
69 | |||
70 | $this->trigger( |
||
71 | static::EVENT_AFTER_RESPONSE_TO_USER, |
||
72 | $event |
||
73 | ); |
||
74 | |||
75 | return $user; |
||
76 | } |
||
77 | |||
78 | /** |
||
79 | * @param ProviderIdentityRecord $identityRecord |
||
80 | * @throws UserException |
||
81 | * @throws \Throwable |
||
82 | */ |
||
83 | public function byIdentity(ProviderIdentityRecord $identityRecord) |
||
100 | } |
||
101 |
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.