| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function run( |
||
| 31 | string $user, |
||
| 32 | string $organization |
||
| 33 | ) { |
||
| 34 | if (null === ($user = $this->findUser($user))) { |
||
| 35 | return $this->handleNotFoundResponse(); |
||
| 36 | } |
||
| 37 | |||
| 38 | if (null === ($organization = $this->findOrganization($organization))) { |
||
| 39 | return $this->handleNotFoundResponse(); |
||
| 40 | } |
||
| 41 | |||
| 42 | return $this->runInternal( |
||
| 43 | $organization->getUsers()->findOrCreate($user) |
||
| 44 | ); |
||
| 45 | } |
||
| 46 | |||
| 58 |