| Conditions | 1 |
| Paths | 1 |
| Total Lines | 38 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function initialize() |
||
| 25 | { |
||
| 26 | $this->add( |
||
| 27 | (new Text('login', [ |
||
|
|
|||
| 28 | 'required' => true, |
||
| 29 | ]))->setLabel('Login') |
||
| 30 | ); |
||
| 31 | |||
| 32 | $this->add( |
||
| 33 | (new Email('email', [ |
||
| 34 | 'required' => true, |
||
| 35 | ])) |
||
| 36 | ->addValidator(new ValidatorEmail([ |
||
| 37 | 'message' => 'Email format is invalid', |
||
| 38 | ])) |
||
| 39 | ->setLabel('Email') |
||
| 40 | ); |
||
| 41 | |||
| 42 | $this->add( |
||
| 43 | (new Text('name')) |
||
| 44 | ->setLabel('Name') |
||
| 45 | ); |
||
| 46 | |||
| 47 | $this->add( |
||
| 48 | (new Select('role', AdminUser::$roles)) |
||
| 49 | ->setLabel('Role') |
||
| 50 | ); |
||
| 51 | |||
| 52 | $this->add( |
||
| 53 | (new Password('password')) |
||
| 54 | ->setLabel('Password') |
||
| 55 | ); |
||
| 56 | |||
| 57 | $this->add( |
||
| 58 | (new Check('active')) |
||
| 59 | ->setLabel('Active') |
||
| 60 | ); |
||
| 61 | } |
||
| 62 | |||
| 74 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: