|
4 | 4 |
|
5 | 5 | namespace Ray\WebFormModule; |
6 | 6 |
|
7 | | -use Aura\Filter\FilterFactory; |
8 | | -use Aura\Html\HelperLocatorFactory; |
9 | | -use Aura\Input\AntiCsrfInterface; |
10 | | -use Aura\Input\Builder; |
11 | | -use Aura\Input\BuilderInterface; |
12 | | -use Aura\Input\Filter; |
13 | | -use Aura\Input\FilterInterface; |
14 | | -use Ray\AuraSessionModule\AuraSessionModule; |
15 | | -use Ray\Di\AbstractModule; |
16 | | -use Ray\Di\Scope; |
17 | | -use Ray\WebFormModule\Annotation\FormValidation; |
18 | | -use Ray\WebFormModule\Annotation\InputValidation; |
19 | | - |
20 | | -/** @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ |
21 | | -class AuraInputModule extends AbstractModule |
| 7 | +/** |
| 8 | + * Backwards-compatible alias for {@see WebFormModule}. |
| 9 | + * |
| 10 | + * Use {@see WebFormModule} in new code. This class is kept so existing |
| 11 | + * applications that install `new AuraInputModule()` continue to work |
| 12 | + * without changes. |
| 13 | + */ |
| 14 | +class AuraInputModule extends WebFormModule |
22 | 15 | { |
23 | | - /** {@inheritDoc} */ |
24 | | - protected function configure() |
25 | | - { |
26 | | - $this->install(new AuraSessionModule()); |
27 | | - $this->bind(BuilderInterface::class)->to(Builder::class); |
28 | | - $this->bind(FilterInterface::class)->to(Filter::class); |
29 | | - $this->bind(AntiCsrfInterface::class)->to(AntiCsrf::class)->in(Scope::SINGLETON); |
30 | | - $this->bind(FailureHandlerInterface::class)->to(OnFailureMethodHandler::class); |
31 | | - $this->bind(FailureHandlerInterface::class) |
32 | | - ->annotatedWith('vnd_error')->to(VndErrorHandler::class)->in(Scope::SINGLETON); |
33 | | - $this->bind(HelperLocatorFactory::class); |
34 | | - $this->bind(FilterFactory::class); |
35 | | - $this->bindInterceptor( |
36 | | - $this->matcher->any(), |
37 | | - $this->matcher->annotatedWith(InputValidation::class), |
38 | | - [InputValidationInterceptor::class], |
39 | | - ); |
40 | | - $this->bindInterceptor( |
41 | | - $this->matcher->any(), |
42 | | - $this->matcher->annotatedWith(FormValidation::class), |
43 | | - [AuraInputInterceptor::class], |
44 | | - ); |
45 | | - } |
46 | 16 | } |
0 commit comments