Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public function execute($command, callable $next) |
||
29 | { |
||
30 | $repository = Manager::getRepository(User::class); |
||
31 | |||
32 | if (!$user = $repository->findOneBy(['lineUserId' => $command->input->userId])) { |
||
33 | $user = new User(); |
||
34 | } |
||
35 | |||
36 | $command->storage = $user; |
||
37 | $command->merge((array) $user->getLineCommandData()); |
||
38 | |||
39 | $user->setLineUserId($command->input->userId); |
||
40 | |||
41 | return $next($command); |
||
42 | } |
||
44 |