| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 27 | public function execute(ScanHeadersRequest $request): ScanHeadersResponse |
||
| 28 | { |
||
| 29 | $outputOptions = new OutputOptions(); |
||
| 30 | $outputOptions->setShowAllHeaders($request->showAllHeaders); |
||
| 31 | |||
| 32 | $scanResults = $this->securityScanner->scanHeaders($request->headers); |
||
| 33 | $outputPrinter = $this->resultPrinterFactory->createFromFormat($request->outputFormat, $outputOptions); |
||
| 34 | |||
| 35 | $result = new ScanHeadersResponse(); |
||
| 36 | $result->output = $outputPrinter->getOutput($scanResults); |
||
| 37 | $result->score = $scanResults->getScore(); |
||
| 38 | $result->hitTargetScore = $scanResults->getScore() >= $request->targetScore; |
||
| 39 | |||
| 40 | return $result; |
||
| 41 | } |
||
| 43 |