1 | <?php |
||
2 | /** |
||
3 | * @package WPEmerge |
||
4 | * @author Atanas Angelov <[email protected]> |
||
5 | * @copyright 2018 Atanas Angelov |
||
6 | * @license https://www.gnu.org/licenses/gpl-2.0.html GPL-2.0 |
||
7 | * @link https://wpemerge.com/ |
||
8 | */ |
||
9 | |||
10 | namespace WPEmerge\Input; |
||
11 | |||
12 | use WPEmerge\Facades\Application; |
||
13 | use WPEmerge\ServiceProviders\ServiceProviderInterface; |
||
14 | |||
15 | /** |
||
16 | * Provide old input dependencies. |
||
17 | * |
||
18 | * @codeCoverageIgnore |
||
19 | */ |
||
20 | class OldInputServiceProvider implements ServiceProviderInterface { |
||
21 | /** |
||
22 | * {@inheritDoc} |
||
23 | */ |
||
24 | public function register( $container ) { |
||
25 | $container[ WPEMERGE_ROUTING_GLOBAL_MIDDLEWARE_KEY ] = array_merge( |
||
26 | $container[ WPEMERGE_ROUTING_GLOBAL_MIDDLEWARE_KEY ], |
||
27 | [ |
||
28 | \WPEmerge\Input\OldInputMiddleware::class, |
||
29 | ] |
||
30 | ); |
||
31 | |||
32 | $container[ WPEMERGE_ROUTING_MIDDLEWARE_PRIORITY_KEY ] = array_merge( |
||
33 | $container[ WPEMERGE_ROUTING_MIDDLEWARE_PRIORITY_KEY ], |
||
34 | [ |
||
35 | \WPEmerge\Input\OldInputMiddleware::class => 15, |
||
36 | ] |
||
37 | ); |
||
38 | |||
39 | $container[ WPEMERGE_OLD_INPUT_KEY ] = function ( $c ) { |
||
40 | return new \WPEmerge\Input\OldInput( $c[ WPEMERGE_FLASH_KEY ] ); |
||
41 | }; |
||
42 | |||
43 | Application::facade( 'OldInput', \WPEmerge\Facades\OldInput::class ); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
44 | } |
||
45 | |||
46 | /** |
||
47 | * {@inheritDoc} |
||
48 | */ |
||
49 | public function bootstrap( $container ) { |
||
50 | // Nothing to bootstrap. |
||
51 | } |
||
52 | } |
||
53 |