1 | <?php |
||
21 | class FormWrapperRegistry |
||
22 | { |
||
23 | /** |
||
24 | * Collection of form wrappers. |
||
25 | * |
||
26 | * @var FormWrapper[] |
||
27 | */ |
||
28 | private $formWrappers; |
||
29 | |||
30 | /** |
||
31 | * Initializes the registry with an array of wrappers. |
||
32 | * |
||
33 | * @param FormWrapper[] $formWrappers |
||
34 | * |
||
35 | * @throws \InvalidArgumentException |
||
36 | */ |
||
37 | public function __construct($formWrappers = []) |
||
60 | |||
61 | /** |
||
62 | * Gets a form wrapper by form name. |
||
63 | * |
||
64 | * @param string $formName The form name |
||
65 | * |
||
66 | * @throw \InvalidArgumentException if wrapper not found |
||
67 | * |
||
68 | * @return \LIN3S\WPSymfonyForm\Wrapper\FormWrapper |
||
69 | */ |
||
70 | public function get($formName) |
||
84 | |||
85 | /** |
||
86 | * Adds a form wrapper to the registry. |
||
87 | * |
||
88 | * @param FormWrapper $formWrapper The form wrapper |
||
89 | */ |
||
90 | public function add(FormWrapper $formWrapper) |
||
94 | } |
||
95 |