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