| @@ 34-51 (lines=18) @@ | ||
| 31 | * | |
| 32 | * @author Adam Kadlec <[email protected]> | |
| 33 | */ | |
| 34 | final class FormPhoneExtension extends DI\CompilerExtension | |
| 35 | { | |
| 36 | /** | |
| 37 | 	 * {@inheritdoc} | |
| 38 | */ | |
| 39 | public function afterCompile(Code\ClassType $class) | |
| 40 | 	{ | |
| 41 | parent::afterCompile($class); | |
| 42 | ||
| 43 | $builder = $this->getContainerBuilder(); | |
| 44 | ||
| 45 | /** @var Code\Method $initialize */ | |
| 46 | $initialize = $class->methods['initialize']; | |
| 47 | 		$initialize->addBody('IPub\FormPhone\Controls\Phone::register($this->getService(?));', [ | |
| 48 | $builder->getByType(Phone\Phone::class) | |
| 49 | ]); | |
| 50 | } | |
| 51 | } | |
| 52 | ||
| @@ 32-50 (lines=19) @@ | ||
| 29 | * | |
| 30 | * @author Adam Kadlec <[email protected]> | |
| 31 | */ | |
| 32 | final class FormSlugExtension extends DI\CompilerExtension | |
| 33 | { | |
| 34 | /** | |
| 35 | * @param Code\ClassType $class | |
| 36 | * | |
| 37 | * @return void | |
| 38 | */ | |
| 39 | public function afterCompile(Code\ClassType $class) | |
| 40 | 	{ | |
| 41 | parent::afterCompile($class); | |
| 42 | ||
| 43 | $builder = $this->getContainerBuilder(); | |
| 44 | ||
| 45 | $initialize = $class->methods['initialize']; | |
| 46 | 		$initialize->addBody('IPub\FormSlug\Controls\Slug::register($this->getService(?));', [ | |
| 47 | $builder->getByType(UI\ITemplateFactory::class) | |
| 48 | ]); | |
| 49 | } | |
| 50 | } | |
| 51 | ||