| Total Complexity | 3 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | class FormFactory |
||
| 23 | { |
||
| 24 | /** |
||
| 25 | * |
||
| 26 | * A map of form names to factory callables. |
||
| 27 | * |
||
| 28 | * @var array |
||
| 29 | * |
||
| 30 | */ |
||
| 31 | protected $map = []; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * |
||
| 35 | * Constructor. |
||
| 36 | * |
||
| 37 | * @param array $map A map of form names to factory callables. |
||
| 38 | * |
||
| 39 | */ |
||
| 40 | public function __construct($map = []) |
||
| 41 | { |
||
| 42 | $this->map = $map; |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * |
||
| 47 | * Returns a new instance of a named form. |
||
| 48 | * |
||
| 49 | * @param string $name The name of the form to create. |
||
| 50 | * |
||
| 51 | * @param mixed $options |
||
| 52 | * |
||
| 53 | * @return Form |
||
| 54 | * |
||
| 55 | * @throws Exception\NoSuchForm When the named form does not exist. |
||
| 56 | */ |
||
| 57 | public function newInstance($name, $options = null) |
||
| 66 | } |
||
| 67 | } |
||
| 68 |