| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | 6 | public function createSystemMember(): Member |
|
| 37 | { |
||
| 38 | 6 | if ($this->userRepository->isAny()) { |
|
| 39 | 2 | throw new \OverflowException('Already Initialized'); |
|
| 40 | } |
||
| 41 | 4 | $user = new User(); |
|
| 42 | 4 | $user->setEmail(ApplicationEnum::SYSTEM_MEMBER_EMAIL); |
|
| 43 | 4 | $this->assertIsValidObject($this->validator, $user); |
|
|
|
|||
| 44 | 4 | $member = new Member( |
|
| 45 | 4 | ApplicationEnum::SYSTEM_MEMBER_NAME, |
|
| 46 | 4 | RoleEnum::SYSTEM(), |
|
| 47 | $user |
||
| 48 | ); |
||
| 49 | 4 | $this->assertIsValidObject($this->validator, $member); |
|
| 50 | |||
| 51 | 4 | $this->userRepository->saveAllInTransaction($user, $member); |
|
| 52 | |||
| 53 | 4 | return $member; |
|
| 54 | } |
||
| 55 | } |
||
| 56 |
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: