Failed Conditions
Branch refactor/kernels (cc9370)
by Atanas
02:23
created

src/Input/OldInputServiceProvider.php (1 issue)

Labels
Severity
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
The method facade() does not exist on WPEmerge\Facades\Application. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

43
		Application::/** @scrutinizer ignore-call */ 
44
               facade( 'OldInput', \WPEmerge\Facades\OldInput::class );
Loading history...
44
	}
45
46
	/**
47
	 * {@inheritDoc}
48
	 */
49
	public function bootstrap( $container ) {
50
		// Nothing to bootstrap.
51
	}
52
}
53