| 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 The form wrappers collection |
||
| 34 | */ |
||
| 35 | public function __construct(array $formWrappers = []) |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Gets a form wrapper by form name. |
||
| 44 | * |
||
| 45 | * @param string $formName The form name |
||
| 46 | * |
||
| 47 | * @throw \InvalidArgumentException if wrapper not found |
||
| 48 | * |
||
| 49 | * @return FormWrapper |
||
| 50 | */ |
||
| 51 | public function get($formName) |
||
| 65 | |||
| 66 | /** |
||
| 67 | * Adds a form wrapper to the registry. |
||
| 68 | * |
||
| 69 | * @param FormWrapper $formWrapper The form wrapper |
||
| 70 | */ |
||
| 71 | public function add(FormWrapper $formWrapper) |
||
| 75 | } |
||
| 76 |