| 1 | <?php |
||
| 21 | class DelegateTokenFactory implements TokenFactoryInterface |
||
| 22 | { |
||
| 23 | private $_callable; |
||
| 24 | private $_factory; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * DelegateTokenFactory constructor. |
||
| 28 | * |
||
| 29 | * @param callable (TokenFactoryInterface $factory, array $params) $function |
||
| 30 | * @param TokenFactoryInterface|null $factory |
||
| 31 | */ |
||
| 32 | 2 | public function __construct(callable $function, TokenFactoryInterface $factory = null) { |
|
| 36 | |||
| 37 | /** |
||
| 38 | * @param $params |
||
| 39 | * |
||
| 40 | * @return Token|null |
||
| 41 | */ |
||
| 42 | 1 | public function create($params) |
|
| 47 | |||
| 48 | 1 | public function setRule($rule) |
|
| 52 | |||
| 53 | 1 | public function setClass($class) |
|
| 57 | |||
| 58 | 1 | public function setBase($base) |
|
| 62 | |||
| 63 | 1 | public function setOffset($offset) |
|
| 67 | |||
| 68 | 1 | public function setType($type) |
|
| 72 | } |