| @@ 45-59 (lines=15) @@ | ||
| 42 | * @param Command $command |
|
| 43 | * @return JsonResponse |
|
| 44 | */ |
|
| 45 | private function handleCommand(Request $request, Command $command) |
|
| 46 | { |
|
| 47 | /** @var \Surfnet\StepupMiddleware\CommandHandlingBundle\Pipeline\Pipeline $pipeline */ |
|
| 48 | $pipeline = $this->get('pipeline'); |
|
| 49 | $pipeline->process($command); |
|
| 50 | ||
| 51 | $serverName = $request->server->get('SERVER_NAME') ?: $request->server->get('SERVER_ADDR'); |
|
| 52 | $response = new JsonResponse([ |
|
| 53 | 'status' => 'OK', |
|
| 54 | 'processed_by' => $serverName, |
|
| 55 | 'applied_at' => (new DateTime())->format(DateTime::ISO8601) |
|
| 56 | ]); |
|
| 57 | ||
| 58 | return $response; |
|
| 59 | } |
|
| 60 | } |
|
| 61 | ||
| @@ 65-79 (lines=15) @@ | ||
| 62 | * @param Command $command |
|
| 63 | * @return JsonResponse |
|
| 64 | */ |
|
| 65 | private function handleCommand(Request $request, Command $command) |
|
| 66 | { |
|
| 67 | /** @var \Surfnet\StepupMiddleware\CommandHandlingBundle\Pipeline\Pipeline $pipeline */ |
|
| 68 | $pipeline = $this->get('pipeline'); |
|
| 69 | $pipeline->process($command); |
|
| 70 | ||
| 71 | $serverName = $request->server->get('SERVER_NAME') ?: $request->server->get('SERVER_ADDR'); |
|
| 72 | $response = new JsonResponse([ |
|
| 73 | 'status' => 'OK', |
|
| 74 | 'processed_by' => $serverName, |
|
| 75 | 'applied_at' => (new DateTime())->format(DateTime::ISO8601) |
|
| 76 | ]); |
|
| 77 | ||
| 78 | return $response; |
|
| 79 | } |
|
| 80 | ||
| 81 | /** |
|
| 82 | * @param NameId $nameId |
|