| Conditions | 3 |
| Paths | 3 |
| Total Lines | 9 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | 6 | public function __construct($request, FormInterface $form = null) |
|
| 26 | { |
||
| 27 | 6 | $this->form = $form; |
|
| 28 | 6 | if ($request instanceof RequestStack) { |
|
| 29 | 1 | $this->request = $request->getCurrentRequest(); |
|
| 30 | 5 | } elseif ($request instanceof Request) { |
|
| 31 | 4 | $this->request = $request; |
|
| 32 | } else { |
||
| 33 | 1 | throw new \InvalidArgumentException('$request must be either a Request or a RequestStack'); |
|
| 34 | } |
||
| 59 |