Completed
Branch FET-10486-add-timestamp-checki... (611b15)
by
unknown
136:24 queued 121:17
created
core/services/commands/middleware/AddActionHook.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -20,24 +20,24 @@
 block discarded – undo
20 20
 class AddActionHook implements CommandBusMiddlewareInterface
21 21
 {
22 22
 
23
-    /**
24
-     * @param CommandInterface $command
25
-     * @param Closure         $next
26
-     * @return mixed
27
-     */
28
-    public function handle(CommandInterface $command, Closure $next)
29
-    {
30
-        do_action(
31
-            'AHEE__EventEspresso_core_services_commands_middleware_AddActionHook__handle__before',
32
-            $command
33
-        );
34
-        $results = $next($command);
35
-        do_action(
36
-            'AHEE__EventEspresso_core_services_commands_middleware_AddActionHook__handle__after',
37
-            $command
38
-        );
39
-        return $results;
40
-    }
23
+	/**
24
+	 * @param CommandInterface $command
25
+	 * @param Closure         $next
26
+	 * @return mixed
27
+	 */
28
+	public function handle(CommandInterface $command, Closure $next)
29
+	{
30
+		do_action(
31
+			'AHEE__EventEspresso_core_services_commands_middleware_AddActionHook__handle__before',
32
+			$command
33
+		);
34
+		$results = $next($command);
35
+		do_action(
36
+			'AHEE__EventEspresso_core_services_commands_middleware_AddActionHook__handle__after',
37
+			$command
38
+		);
39
+		return $results;
40
+	}
41 41
 }
42 42
 // End of file AddActionHook.php
43 43
 // Location: EventEspresso\core\services\commands\middleware/AddActionHook.php
44 44
\ No newline at end of file
Please login to merge, or discard this patch.
core/services/commands/CompositeCommandHandler.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 namespace EventEspresso\core\services\commands;
4 4
 
5
-if (! defined('EVENT_ESPRESSO_VERSION')) {
5
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
6 6
     exit('No direct script access allowed');
7 7
 }
8 8
 
Please login to merge, or discard this patch.
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 namespace EventEspresso\core\services\commands;
4 4
 
5 5
 if (! defined('EVENT_ESPRESSO_VERSION')) {
6
-    exit('No direct script access allowed');
6
+	exit('No direct script access allowed');
7 7
 }
8 8
 
9 9
 
@@ -21,59 +21,59 @@  discard block
 block discarded – undo
21 21
 abstract class CompositeCommandHandler extends CommandHandler
22 22
 {
23 23
 
24
-    /**
25
-     * @type CommandBusInterface $command_bus
26
-     */
27
-    private $command_bus;
24
+	/**
25
+	 * @type CommandBusInterface $command_bus
26
+	 */
27
+	private $command_bus;
28 28
 
29
-    /**
30
-     * @type CommandFactoryInterface $command_factory
31
-     */
32
-    private $command_factory;
29
+	/**
30
+	 * @type CommandFactoryInterface $command_factory
31
+	 */
32
+	private $command_factory;
33 33
 
34 34
 
35 35
 
36
-    /**
37
-     * CompositeCommandHandler constructor.
38
-     *
39
-     * @param CommandBusInterface     $command_bus
40
-     * @param CommandFactoryInterface $command_factory
41
-     */
42
-    public function __construct(CommandBusInterface $command_bus, CommandFactoryInterface $command_factory)
43
-    {
44
-        $this->command_bus = $command_bus;
45
-        $this->command_factory = $command_factory;
46
-    }
36
+	/**
37
+	 * CompositeCommandHandler constructor.
38
+	 *
39
+	 * @param CommandBusInterface     $command_bus
40
+	 * @param CommandFactoryInterface $command_factory
41
+	 */
42
+	public function __construct(CommandBusInterface $command_bus, CommandFactoryInterface $command_factory)
43
+	{
44
+		$this->command_bus = $command_bus;
45
+		$this->command_factory = $command_factory;
46
+	}
47 47
 
48 48
 
49 49
 
50
-    /**
51
-     * @param CommandBusInterface $command_bus
52
-     */
53
-    public function setCommandBus(CommandBusInterface $command_bus)
54
-    {
55
-        $this->command_bus = $command_bus;
56
-    }
50
+	/**
51
+	 * @param CommandBusInterface $command_bus
52
+	 */
53
+	public function setCommandBus(CommandBusInterface $command_bus)
54
+	{
55
+		$this->command_bus = $command_bus;
56
+	}
57 57
 
58 58
 
59 59
 
60
-    /**
61
-     * @return CommandBusInterface
62
-     */
63
-    public function commandBus()
64
-    {
65
-        return $this->command_bus;
66
-    }
60
+	/**
61
+	 * @return CommandBusInterface
62
+	 */
63
+	public function commandBus()
64
+	{
65
+		return $this->command_bus;
66
+	}
67 67
 
68 68
 
69 69
 
70
-    /**
71
-     * @return CommandFactoryInterface
72
-     */
73
-    public function commandFactory()
74
-    {
75
-        return $this->command_factory;
76
-    }
70
+	/**
71
+	 * @return CommandFactoryInterface
72
+	 */
73
+	public function commandFactory()
74
+	{
75
+		return $this->command_factory;
76
+	}
77 77
 
78 78
 
79 79
 
Please login to merge, or discard this patch.
core/domain/ConstantsAbstract.php 2 patches
Indentation   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -14,72 +14,72 @@
 block discarded – undo
14 14
  */
15 15
 abstract class ConstantsAbstract
16 16
 {
17
-    /**
18
-     * Equivalent to `__FILE__` for main plugin file.
19
-     * @var string
20
-     */
21
-    private static $plugin_file ='';
22
-
23
-
24
-    /**
25
-     * String indicating version for plugin
26
-     * @var string
27
-     */
28
-    private static $version = '';
29
-
30
-
31
-    /**
32
-     * Initializes internal static properties.
33
-     * @param $plugin_file
34
-     * @param $version
35
-     */
36
-    public static function init($plugin_file, $version)
37
-    {
38
-        self::$plugin_file = $plugin_file;
39
-        self::$version     = $version;
40
-    }
41
-
42
-
43
-    /**
44
-     * @return string
45
-     */
46
-    public static function pluginFile()
47
-    {
48
-        return self::$plugin_file;
49
-    }
50
-
51
-    /**
52
-     * @return string
53
-     */
54
-    public static function pluginBasename()
55
-    {
56
-        return plugin_basename(self::$plugin_file);
57
-    }
58
-
59
-    /**
60
-     * @return string
61
-     */
62
-    public static function pluginPath()
63
-    {
64
-        return plugin_dir_path(self::$plugin_file);
65
-    }
66
-
67
-
68
-    /**
69
-     * @return string
70
-     */
71
-    public static function pluginUrl()
72
-    {
73
-        return plugin_dir_url(self::$plugin_file);
74
-    }
75
-
76
-
77
-    /**
78
-     * @return string
79
-     */
80
-    public static function version()
81
-    {
82
-        return self::$version;
83
-    }
17
+	/**
18
+	 * Equivalent to `__FILE__` for main plugin file.
19
+	 * @var string
20
+	 */
21
+	private static $plugin_file ='';
22
+
23
+
24
+	/**
25
+	 * String indicating version for plugin
26
+	 * @var string
27
+	 */
28
+	private static $version = '';
29
+
30
+
31
+	/**
32
+	 * Initializes internal static properties.
33
+	 * @param $plugin_file
34
+	 * @param $version
35
+	 */
36
+	public static function init($plugin_file, $version)
37
+	{
38
+		self::$plugin_file = $plugin_file;
39
+		self::$version     = $version;
40
+	}
41
+
42
+
43
+	/**
44
+	 * @return string
45
+	 */
46
+	public static function pluginFile()
47
+	{
48
+		return self::$plugin_file;
49
+	}
50
+
51
+	/**
52
+	 * @return string
53
+	 */
54
+	public static function pluginBasename()
55
+	{
56
+		return plugin_basename(self::$plugin_file);
57
+	}
58
+
59
+	/**
60
+	 * @return string
61
+	 */
62
+	public static function pluginPath()
63
+	{
64
+		return plugin_dir_path(self::$plugin_file);
65
+	}
66
+
67
+
68
+	/**
69
+	 * @return string
70
+	 */
71
+	public static function pluginUrl()
72
+	{
73
+		return plugin_dir_url(self::$plugin_file);
74
+	}
75
+
76
+
77
+	/**
78
+	 * @return string
79
+	 */
80
+	public static function version()
81
+	{
82
+		return self::$version;
83
+	}
84 84
 
85 85
 }
86 86
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
      * Equivalent to `__FILE__` for main plugin file.
19 19
      * @var string
20 20
      */
21
-    private static $plugin_file ='';
21
+    private static $plugin_file = '';
22 22
 
23 23
 
24 24
     /**
Please login to merge, or discard this patch.
core/domain/services/capabilities/CapabilitiesCheckerInterface.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -20,26 +20,26 @@
 block discarded – undo
20 20
 interface CapabilitiesCheckerInterface
21 21
 {
22 22
 
23
-    /**
24
-     * Verifies that the current user has ALL of the capabilities listed in the CapCheck DTO.
25
-     * If any of the individual capability checks fails, then the command will NOT be executed.
26
-     *
27
-     * @param CapCheckInterface|CapCheckInterface[] $cap_check
28
-     * @return bool
29
-     * @throws InvalidClassException
30
-     * @throws InsufficientPermissionsException
31
-     */
32
-    public function processCapCheck($cap_check);
33
-
34
-
35
-
36
-    /**
37
-     * @param string $capability - the capability to be checked, like: 'ee_edit_registrations'
38
-     * @param string $context    - what the user is attempting to do, like: 'Edit Registration'
39
-     * @param int    $ID         - (optional) ID for item where current_user_can is being called from
40
-     * @return bool
41
-     * @throws InsufficientPermissionsException
42
-     * @throws InvalidClassException
43
-     */
44
-    public function process($capability, $context, $ID = 0);
23
+	/**
24
+	 * Verifies that the current user has ALL of the capabilities listed in the CapCheck DTO.
25
+	 * If any of the individual capability checks fails, then the command will NOT be executed.
26
+	 *
27
+	 * @param CapCheckInterface|CapCheckInterface[] $cap_check
28
+	 * @return bool
29
+	 * @throws InvalidClassException
30
+	 * @throws InsufficientPermissionsException
31
+	 */
32
+	public function processCapCheck($cap_check);
33
+
34
+
35
+
36
+	/**
37
+	 * @param string $capability - the capability to be checked, like: 'ee_edit_registrations'
38
+	 * @param string $context    - what the user is attempting to do, like: 'Edit Registration'
39
+	 * @param int    $ID         - (optional) ID for item where current_user_can is being called from
40
+	 * @return bool
41
+	 * @throws InsufficientPermissionsException
42
+	 * @throws InvalidClassException
43
+	 */
44
+	public function process($capability, $context, $ID = 0);
45 45
 }
Please login to merge, or discard this patch.
core/domain/services/capabilities/CapabilitiesChecker.php 2 patches
Indentation   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 use EventEspresso\core\exceptions\InvalidDataTypeException;
9 9
 
10 10
 if (! defined('EVENT_ESPRESSO_VERSION')) {
11
-    exit('No direct script access allowed');
11
+	exit('No direct script access allowed');
12 12
 }
13 13
 
14 14
 
@@ -24,92 +24,92 @@  discard block
 block discarded – undo
24 24
 class CapabilitiesChecker implements CapabilitiesCheckerInterface
25 25
 {
26 26
 
27
-    /**
28
-     * @type EE_Capabilities $capabilities
29
-     */
30
-    private $capabilities;
31
-
32
-
33
-
34
-    /**
35
-     * CapabilitiesChecker constructor
36
-     *
37
-     * @param EE_Capabilities $capabilities
38
-     */
39
-    public function __construct(EE_Capabilities $capabilities)
40
-    {
41
-        $this->capabilities = $capabilities;
42
-    }
43
-
44
-
45
-
46
-    /**
47
-     * @return EE_Capabilities
48
-     */
49
-    protected function capabilities()
50
-    {
51
-        return $this->capabilities;
52
-    }
53
-
54
-
55
-
56
-    /**
57
-     * Verifies that the current user has ALL of the capabilities listed in the CapCheck DTO.
58
-     * If any of the individual capability checks fails, then the command will NOT be executed.
59
-     *
60
-     * @param CapCheckInterface|CapCheckInterface[] $cap_check
61
-     * @return bool
62
-     * @throws InvalidClassException
63
-     * @throws InsufficientPermissionsException
64
-     */
65
-    public function processCapCheck($cap_check)
66
-    {
67
-        if (is_array($cap_check)) {
68
-            foreach ($cap_check as $check) {
69
-                $this->processCapCheck($check);
70
-            }
71
-            return true;
72
-        }
73
-        // at this point, $cap_check should be an individual instance of CapCheck
74
-        if (! $cap_check instanceof CapCheckInterface) {
75
-            throw new InvalidClassException(
76
-                '\EventEspresso\core\domain\services\capabilities\CapCheckInterface'
77
-            );
78
-        }
79
-        // sometimes cap checks are conditional, and no capabilities are required
80
-        if ($cap_check instanceof PublicCapabilities) {
81
-            return true;
82
-        }
83
-        $capabilities = (array)$cap_check->capability();
84
-        foreach ($capabilities as $capability) {
85
-            if (
86
-            ! $this->capabilities()->current_user_can(
87
-                $capability,
88
-                $cap_check->context(),
89
-                $cap_check->ID()
90
-            )
91
-            ) {
92
-                throw new InsufficientPermissionsException($cap_check->context());
93
-            }
94
-        }
95
-        return true;
96
-    }
97
-
98
-
99
-
100
-    /**
101
-     * @param string $capability - the capability to be checked, like: 'ee_edit_registrations'
102
-     * @param string $context    - what the user is attempting to do, like: 'Edit Registration'
103
-     * @param int    $ID         - (optional) ID for item where current_user_can is being called from
104
-     * @return bool
105
-     * @throws InvalidDataTypeException
106
-     * @throws InsufficientPermissionsException
107
-     * @throws InvalidClassException
108
-     */
109
-    public function process($capability, $context, $ID = 0)
110
-    {
111
-        return $this->processCapCheck(new CapCheck($capability, $context, $ID));
112
-    }
27
+	/**
28
+	 * @type EE_Capabilities $capabilities
29
+	 */
30
+	private $capabilities;
31
+
32
+
33
+
34
+	/**
35
+	 * CapabilitiesChecker constructor
36
+	 *
37
+	 * @param EE_Capabilities $capabilities
38
+	 */
39
+	public function __construct(EE_Capabilities $capabilities)
40
+	{
41
+		$this->capabilities = $capabilities;
42
+	}
43
+
44
+
45
+
46
+	/**
47
+	 * @return EE_Capabilities
48
+	 */
49
+	protected function capabilities()
50
+	{
51
+		return $this->capabilities;
52
+	}
53
+
54
+
55
+
56
+	/**
57
+	 * Verifies that the current user has ALL of the capabilities listed in the CapCheck DTO.
58
+	 * If any of the individual capability checks fails, then the command will NOT be executed.
59
+	 *
60
+	 * @param CapCheckInterface|CapCheckInterface[] $cap_check
61
+	 * @return bool
62
+	 * @throws InvalidClassException
63
+	 * @throws InsufficientPermissionsException
64
+	 */
65
+	public function processCapCheck($cap_check)
66
+	{
67
+		if (is_array($cap_check)) {
68
+			foreach ($cap_check as $check) {
69
+				$this->processCapCheck($check);
70
+			}
71
+			return true;
72
+		}
73
+		// at this point, $cap_check should be an individual instance of CapCheck
74
+		if (! $cap_check instanceof CapCheckInterface) {
75
+			throw new InvalidClassException(
76
+				'\EventEspresso\core\domain\services\capabilities\CapCheckInterface'
77
+			);
78
+		}
79
+		// sometimes cap checks are conditional, and no capabilities are required
80
+		if ($cap_check instanceof PublicCapabilities) {
81
+			return true;
82
+		}
83
+		$capabilities = (array)$cap_check->capability();
84
+		foreach ($capabilities as $capability) {
85
+			if (
86
+			! $this->capabilities()->current_user_can(
87
+				$capability,
88
+				$cap_check->context(),
89
+				$cap_check->ID()
90
+			)
91
+			) {
92
+				throw new InsufficientPermissionsException($cap_check->context());
93
+			}
94
+		}
95
+		return true;
96
+	}
97
+
98
+
99
+
100
+	/**
101
+	 * @param string $capability - the capability to be checked, like: 'ee_edit_registrations'
102
+	 * @param string $context    - what the user is attempting to do, like: 'Edit Registration'
103
+	 * @param int    $ID         - (optional) ID for item where current_user_can is being called from
104
+	 * @return bool
105
+	 * @throws InvalidDataTypeException
106
+	 * @throws InsufficientPermissionsException
107
+	 * @throws InvalidClassException
108
+	 */
109
+	public function process($capability, $context, $ID = 0)
110
+	{
111
+		return $this->processCapCheck(new CapCheck($capability, $context, $ID));
112
+	}
113 113
 
114 114
 
115 115
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 use EventEspresso\core\exceptions\InvalidClassException;
8 8
 use EventEspresso\core\exceptions\InvalidDataTypeException;
9 9
 
10
-if (! defined('EVENT_ESPRESSO_VERSION')) {
10
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
11 11
     exit('No direct script access allowed');
12 12
 }
13 13
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
             return true;
72 72
         }
73 73
         // at this point, $cap_check should be an individual instance of CapCheck
74
-        if (! $cap_check instanceof CapCheckInterface) {
74
+        if ( ! $cap_check instanceof CapCheckInterface) {
75 75
             throw new InvalidClassException(
76 76
                 '\EventEspresso\core\domain\services\capabilities\CapCheckInterface'
77 77
             );
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         if ($cap_check instanceof PublicCapabilities) {
81 81
             return true;
82 82
         }
83
-        $capabilities = (array)$cap_check->capability();
83
+        $capabilities = (array) $cap_check->capability();
84 84
         foreach ($capabilities as $capability) {
85 85
             if (
86 86
             ! $this->capabilities()->current_user_can(
Please login to merge, or discard this patch.
core/EE_Load_Espresso_Core.core.php 2 patches
Indentation   +223 added lines, -223 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 use EventEspresso\core\services\loaders\LoaderInterface;
5 5
 
6 6
 if (! defined('EVENT_ESPRESSO_VERSION')) {
7
-    exit('No direct script access allowed');
7
+	exit('No direct script access allowed');
8 8
 }
9 9
 
10 10
 
@@ -24,228 +24,228 @@  discard block
 block discarded – undo
24 24
 class EE_Load_Espresso_Core implements EEI_Request_Decorator, EEI_Request_Stack_Core_App
25 25
 {
26 26
 
27
-    /**
28
-     * @type LoaderInterface $loader
29
-     */
30
-    protected $loader;
31
-
32
-    /**
33
-     * @var EE_Request $request
34
-     */
35
-    protected $request;
36
-
37
-    /**
38
-     * @var EE_Response $response
39
-     */
40
-    protected $response;
41
-
42
-    /**
43
-     * @var EE_Dependency_Map $dependency_map
44
-     */
45
-    protected $dependency_map;
46
-
47
-    /**
48
-     * @var EE_Registry $registry
49
-     */
50
-    protected $registry;
51
-
52
-
53
-
54
-    /**
55
-     * EE_Load_Espresso_Core constructor
56
-     */
57
-    public function __construct()
58
-    {
59
-        espresso_load_required('EventEspresso\core\Factory', EE_CORE . 'Factory.php');
60
-    }
61
-
62
-
63
-
64
-    /**
65
-     * handle
66
-     * sets hooks for running rest of system
67
-     * provides "AHEE__EE_System__construct__complete" hook for EE Addons to use as their starting point
68
-     * starting EE Addons from any other point may lead to problems
69
-     *
70
-     * @param EE_Request  $request
71
-     * @param EE_Response $response
72
-     * @return EE_Response
73
-     * @throws EE_Error
74
-     * @throws InvalidDataTypeException
75
-     * @throws InvalidInterfaceException
76
-     * @throws InvalidArgumentException
77
-     */
78
-    public function handle_request(EE_Request $request, EE_Response $response)
79
-    {
80
-        $this->request = $request;
81
-        $this->response = $response;
82
-        // info about how to load classes required by other classes
83
-        $this->dependency_map = $this->_load_dependency_map();
84
-        // central repository for classes
85
-        $this->registry = $this->_load_registry();
86
-        do_action('EE_Load_Espresso_Core__handle_request__initialize_core_loading');
87
-        // PSR4 Autoloaders
88
-        $this->registry->load_core('EE_Psr4AutoloaderInit');
89
-        $this->loader = $this->registry->create('EventEspresso\core\services\loaders\Loader');
90
-        $this->dependency_map->setLoader($this->loader);
91
-        // build DI container
92
-        $OpenCoffeeShop = new EventEspresso\core\services\container\OpenCoffeeShop();
93
-        $OpenCoffeeShop->addRecipes();
94
-        // $CoffeeShop = $OpenCoffeeShop->CoffeeShop();
95
-        // create and cache the CommandBus, and also add middleware
96
-        $this->registry->create(
97
-            'CommandBusInterface',
98
-            array(
99
-                null,
100
-                apply_filters(
101
-                    'FHEE__EE_Load_Espresso_Core__handle_request__CommandBus_middleware',
102
-                    array(
103
-                        $this->registry->create('CapChecker'),
104
-                        $this->registry->create('AddActionHook'),
105
-                    )
106
-                ),
107
-            ),
108
-            true
109
-        );
110
-        // workarounds for PHP < 5.3
111
-        $this->_load_class_tools();
112
-        // load interfaces
113
-        espresso_load_required('EEI_Payment_Method_Interfaces',
114
-            EE_LIBRARIES . 'payment_methods' . DS . 'EEI_Payment_Method_Interfaces.php');
115
-        // deprecated functions
116
-        espresso_load_required('EE_Deprecated', EE_CORE . 'EE_Deprecated.core.php');
117
-        // WP cron jobs
118
-        $this->registry->load_core('Cron_Tasks');
119
-        $this->registry->load_core('EE_Request_Handler');
120
-        $this->registry->load_core('EE_System');
121
-        return $this->response;
122
-    }
123
-
124
-
125
-
126
-    /**
127
-     * @return EE_Request
128
-     */
129
-    public function request()
130
-    {
131
-        return $this->request;
132
-    }
133
-
134
-
135
-
136
-    /**
137
-     * @return EE_Response
138
-     */
139
-    public function response()
140
-    {
141
-        return $this->response;
142
-    }
143
-
144
-
145
-
146
-    /**
147
-     * @return EE_Dependency_Map
148
-     * @throws EE_Error
149
-     */
150
-    public function dependency_map()
151
-    {
152
-        if (! $this->dependency_map instanceof EE_Dependency_Map) {
153
-            throw new EE_Error(
154
-                sprintf(
155
-                    __('Invalid EE_Dependency_Map: "%1$s"', 'event_espresso'),
156
-                    print_r($this->dependency_map, true)
157
-                )
158
-            );
159
-        }
160
-        return $this->dependency_map;
161
-    }
162
-
163
-
164
-
165
-    /**
166
-     * @return EE_Registry
167
-     * @throws EE_Error
168
-     */
169
-    public function registry()
170
-    {
171
-        if (! $this->registry instanceof EE_Registry) {
172
-            throw new EE_Error(
173
-                sprintf(
174
-                    __('Invalid EE_Registry: "%1$s"', 'event_espresso'),
175
-                    print_r($this->registry, true)
176
-                )
177
-            );
178
-        }
179
-        return $this->registry;
180
-    }
181
-
182
-
183
-
184
-    /**
185
-     * @return EE_Dependency_Map
186
-     */
187
-    private function _load_dependency_map()
188
-    {
189
-        if (! is_readable(EE_CORE . 'EE_Dependency_Map.core.php')) {
190
-            EE_Error::add_error(
191
-                __('The EE_Dependency_Map core class could not be loaded.', 'event_espresso'),
192
-                __FILE__, __FUNCTION__, __LINE__
193
-            );
194
-            wp_die(EE_Error::get_notices());
195
-        }
196
-        require_once(EE_CORE . 'EE_Dependency_Map.core.php');
197
-        return EE_Dependency_Map::instance($this->request, $this->response);
198
-    }
199
-
200
-
201
-
202
-    /**
203
-     * @return EE_Registry
204
-     */
205
-    private function _load_registry()
206
-    {
207
-        if (! is_readable(EE_CORE . 'EE_Registry.core.php')) {
208
-            EE_Error::add_error(
209
-                __('The EE_Registry core class could not be loaded.', 'event_espresso'),
210
-                __FILE__, __FUNCTION__, __LINE__
211
-            );
212
-            wp_die(EE_Error::get_notices());
213
-        }
214
-        require_once(EE_CORE . 'EE_Registry.core.php');
215
-        return EE_Registry::instance($this->dependency_map);
216
-    }
217
-
218
-
219
-
220
-    /**
221
-     * @return void
222
-     */
223
-    private function _load_class_tools()
224
-    {
225
-        if (! is_readable(EE_HELPERS . 'EEH_Class_Tools.helper.php')) {
226
-            EE_Error::add_error(
227
-                __('The EEH_Class_Tools helper could not be loaded.', 'event_espresso'),
228
-                __FILE__, __FUNCTION__, __LINE__
229
-            );
230
-        }
231
-        require_once(EE_HELPERS . 'EEH_Class_Tools.helper.php');
232
-    }
233
-
234
-
235
-
236
-    /**
237
-     * called after the request stack has been fully processed
238
-     * if any of the middleware apps has requested the plugin be deactivated, then we do that now
239
-     *
240
-     * @param EE_Request  $request
241
-     * @param EE_Response $response
242
-     */
243
-    public function handle_response(EE_Request $request, EE_Response $response)
244
-    {
245
-        if ($response->plugin_deactivated()) {
246
-            espresso_deactivate_plugin(EE_PLUGIN_BASENAME);
247
-        }
248
-    }
27
+	/**
28
+	 * @type LoaderInterface $loader
29
+	 */
30
+	protected $loader;
31
+
32
+	/**
33
+	 * @var EE_Request $request
34
+	 */
35
+	protected $request;
36
+
37
+	/**
38
+	 * @var EE_Response $response
39
+	 */
40
+	protected $response;
41
+
42
+	/**
43
+	 * @var EE_Dependency_Map $dependency_map
44
+	 */
45
+	protected $dependency_map;
46
+
47
+	/**
48
+	 * @var EE_Registry $registry
49
+	 */
50
+	protected $registry;
51
+
52
+
53
+
54
+	/**
55
+	 * EE_Load_Espresso_Core constructor
56
+	 */
57
+	public function __construct()
58
+	{
59
+		espresso_load_required('EventEspresso\core\Factory', EE_CORE . 'Factory.php');
60
+	}
61
+
62
+
63
+
64
+	/**
65
+	 * handle
66
+	 * sets hooks for running rest of system
67
+	 * provides "AHEE__EE_System__construct__complete" hook for EE Addons to use as their starting point
68
+	 * starting EE Addons from any other point may lead to problems
69
+	 *
70
+	 * @param EE_Request  $request
71
+	 * @param EE_Response $response
72
+	 * @return EE_Response
73
+	 * @throws EE_Error
74
+	 * @throws InvalidDataTypeException
75
+	 * @throws InvalidInterfaceException
76
+	 * @throws InvalidArgumentException
77
+	 */
78
+	public function handle_request(EE_Request $request, EE_Response $response)
79
+	{
80
+		$this->request = $request;
81
+		$this->response = $response;
82
+		// info about how to load classes required by other classes
83
+		$this->dependency_map = $this->_load_dependency_map();
84
+		// central repository for classes
85
+		$this->registry = $this->_load_registry();
86
+		do_action('EE_Load_Espresso_Core__handle_request__initialize_core_loading');
87
+		// PSR4 Autoloaders
88
+		$this->registry->load_core('EE_Psr4AutoloaderInit');
89
+		$this->loader = $this->registry->create('EventEspresso\core\services\loaders\Loader');
90
+		$this->dependency_map->setLoader($this->loader);
91
+		// build DI container
92
+		$OpenCoffeeShop = new EventEspresso\core\services\container\OpenCoffeeShop();
93
+		$OpenCoffeeShop->addRecipes();
94
+		// $CoffeeShop = $OpenCoffeeShop->CoffeeShop();
95
+		// create and cache the CommandBus, and also add middleware
96
+		$this->registry->create(
97
+			'CommandBusInterface',
98
+			array(
99
+				null,
100
+				apply_filters(
101
+					'FHEE__EE_Load_Espresso_Core__handle_request__CommandBus_middleware',
102
+					array(
103
+						$this->registry->create('CapChecker'),
104
+						$this->registry->create('AddActionHook'),
105
+					)
106
+				),
107
+			),
108
+			true
109
+		);
110
+		// workarounds for PHP < 5.3
111
+		$this->_load_class_tools();
112
+		// load interfaces
113
+		espresso_load_required('EEI_Payment_Method_Interfaces',
114
+			EE_LIBRARIES . 'payment_methods' . DS . 'EEI_Payment_Method_Interfaces.php');
115
+		// deprecated functions
116
+		espresso_load_required('EE_Deprecated', EE_CORE . 'EE_Deprecated.core.php');
117
+		// WP cron jobs
118
+		$this->registry->load_core('Cron_Tasks');
119
+		$this->registry->load_core('EE_Request_Handler');
120
+		$this->registry->load_core('EE_System');
121
+		return $this->response;
122
+	}
123
+
124
+
125
+
126
+	/**
127
+	 * @return EE_Request
128
+	 */
129
+	public function request()
130
+	{
131
+		return $this->request;
132
+	}
133
+
134
+
135
+
136
+	/**
137
+	 * @return EE_Response
138
+	 */
139
+	public function response()
140
+	{
141
+		return $this->response;
142
+	}
143
+
144
+
145
+
146
+	/**
147
+	 * @return EE_Dependency_Map
148
+	 * @throws EE_Error
149
+	 */
150
+	public function dependency_map()
151
+	{
152
+		if (! $this->dependency_map instanceof EE_Dependency_Map) {
153
+			throw new EE_Error(
154
+				sprintf(
155
+					__('Invalid EE_Dependency_Map: "%1$s"', 'event_espresso'),
156
+					print_r($this->dependency_map, true)
157
+				)
158
+			);
159
+		}
160
+		return $this->dependency_map;
161
+	}
162
+
163
+
164
+
165
+	/**
166
+	 * @return EE_Registry
167
+	 * @throws EE_Error
168
+	 */
169
+	public function registry()
170
+	{
171
+		if (! $this->registry instanceof EE_Registry) {
172
+			throw new EE_Error(
173
+				sprintf(
174
+					__('Invalid EE_Registry: "%1$s"', 'event_espresso'),
175
+					print_r($this->registry, true)
176
+				)
177
+			);
178
+		}
179
+		return $this->registry;
180
+	}
181
+
182
+
183
+
184
+	/**
185
+	 * @return EE_Dependency_Map
186
+	 */
187
+	private function _load_dependency_map()
188
+	{
189
+		if (! is_readable(EE_CORE . 'EE_Dependency_Map.core.php')) {
190
+			EE_Error::add_error(
191
+				__('The EE_Dependency_Map core class could not be loaded.', 'event_espresso'),
192
+				__FILE__, __FUNCTION__, __LINE__
193
+			);
194
+			wp_die(EE_Error::get_notices());
195
+		}
196
+		require_once(EE_CORE . 'EE_Dependency_Map.core.php');
197
+		return EE_Dependency_Map::instance($this->request, $this->response);
198
+	}
199
+
200
+
201
+
202
+	/**
203
+	 * @return EE_Registry
204
+	 */
205
+	private function _load_registry()
206
+	{
207
+		if (! is_readable(EE_CORE . 'EE_Registry.core.php')) {
208
+			EE_Error::add_error(
209
+				__('The EE_Registry core class could not be loaded.', 'event_espresso'),
210
+				__FILE__, __FUNCTION__, __LINE__
211
+			);
212
+			wp_die(EE_Error::get_notices());
213
+		}
214
+		require_once(EE_CORE . 'EE_Registry.core.php');
215
+		return EE_Registry::instance($this->dependency_map);
216
+	}
217
+
218
+
219
+
220
+	/**
221
+	 * @return void
222
+	 */
223
+	private function _load_class_tools()
224
+	{
225
+		if (! is_readable(EE_HELPERS . 'EEH_Class_Tools.helper.php')) {
226
+			EE_Error::add_error(
227
+				__('The EEH_Class_Tools helper could not be loaded.', 'event_espresso'),
228
+				__FILE__, __FUNCTION__, __LINE__
229
+			);
230
+		}
231
+		require_once(EE_HELPERS . 'EEH_Class_Tools.helper.php');
232
+	}
233
+
234
+
235
+
236
+	/**
237
+	 * called after the request stack has been fully processed
238
+	 * if any of the middleware apps has requested the plugin be deactivated, then we do that now
239
+	 *
240
+	 * @param EE_Request  $request
241
+	 * @param EE_Response $response
242
+	 */
243
+	public function handle_response(EE_Request $request, EE_Response $response)
244
+	{
245
+		if ($response->plugin_deactivated()) {
246
+			espresso_deactivate_plugin(EE_PLUGIN_BASENAME);
247
+		}
248
+	}
249 249
 
250 250
 
251 251
 
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 use EventEspresso\core\exceptions\InvalidInterfaceException;
4 4
 use EventEspresso\core\services\loaders\LoaderInterface;
5 5
 
6
-if (! defined('EVENT_ESPRESSO_VERSION')) {
6
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
7 7
     exit('No direct script access allowed');
8 8
 }
9 9
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      */
57 57
     public function __construct()
58 58
     {
59
-        espresso_load_required('EventEspresso\core\Factory', EE_CORE . 'Factory.php');
59
+        espresso_load_required('EventEspresso\core\Factory', EE_CORE.'Factory.php');
60 60
     }
61 61
 
62 62
 
@@ -111,9 +111,9 @@  discard block
 block discarded – undo
111 111
         $this->_load_class_tools();
112 112
         // load interfaces
113 113
         espresso_load_required('EEI_Payment_Method_Interfaces',
114
-            EE_LIBRARIES . 'payment_methods' . DS . 'EEI_Payment_Method_Interfaces.php');
114
+            EE_LIBRARIES.'payment_methods'.DS.'EEI_Payment_Method_Interfaces.php');
115 115
         // deprecated functions
116
-        espresso_load_required('EE_Deprecated', EE_CORE . 'EE_Deprecated.core.php');
116
+        espresso_load_required('EE_Deprecated', EE_CORE.'EE_Deprecated.core.php');
117 117
         // WP cron jobs
118 118
         $this->registry->load_core('Cron_Tasks');
119 119
         $this->registry->load_core('EE_Request_Handler');
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
      */
150 150
     public function dependency_map()
151 151
     {
152
-        if (! $this->dependency_map instanceof EE_Dependency_Map) {
152
+        if ( ! $this->dependency_map instanceof EE_Dependency_Map) {
153 153
             throw new EE_Error(
154 154
                 sprintf(
155 155
                     __('Invalid EE_Dependency_Map: "%1$s"', 'event_espresso'),
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
      */
169 169
     public function registry()
170 170
     {
171
-        if (! $this->registry instanceof EE_Registry) {
171
+        if ( ! $this->registry instanceof EE_Registry) {
172 172
             throw new EE_Error(
173 173
                 sprintf(
174 174
                     __('Invalid EE_Registry: "%1$s"', 'event_espresso'),
@@ -186,14 +186,14 @@  discard block
 block discarded – undo
186 186
      */
187 187
     private function _load_dependency_map()
188 188
     {
189
-        if (! is_readable(EE_CORE . 'EE_Dependency_Map.core.php')) {
189
+        if ( ! is_readable(EE_CORE.'EE_Dependency_Map.core.php')) {
190 190
             EE_Error::add_error(
191 191
                 __('The EE_Dependency_Map core class could not be loaded.', 'event_espresso'),
192 192
                 __FILE__, __FUNCTION__, __LINE__
193 193
             );
194 194
             wp_die(EE_Error::get_notices());
195 195
         }
196
-        require_once(EE_CORE . 'EE_Dependency_Map.core.php');
196
+        require_once(EE_CORE.'EE_Dependency_Map.core.php');
197 197
         return EE_Dependency_Map::instance($this->request, $this->response);
198 198
     }
199 199
 
@@ -204,14 +204,14 @@  discard block
 block discarded – undo
204 204
      */
205 205
     private function _load_registry()
206 206
     {
207
-        if (! is_readable(EE_CORE . 'EE_Registry.core.php')) {
207
+        if ( ! is_readable(EE_CORE.'EE_Registry.core.php')) {
208 208
             EE_Error::add_error(
209 209
                 __('The EE_Registry core class could not be loaded.', 'event_espresso'),
210 210
                 __FILE__, __FUNCTION__, __LINE__
211 211
             );
212 212
             wp_die(EE_Error::get_notices());
213 213
         }
214
-        require_once(EE_CORE . 'EE_Registry.core.php');
214
+        require_once(EE_CORE.'EE_Registry.core.php');
215 215
         return EE_Registry::instance($this->dependency_map);
216 216
     }
217 217
 
@@ -222,13 +222,13 @@  discard block
 block discarded – undo
222 222
      */
223 223
     private function _load_class_tools()
224 224
     {
225
-        if (! is_readable(EE_HELPERS . 'EEH_Class_Tools.helper.php')) {
225
+        if ( ! is_readable(EE_HELPERS.'EEH_Class_Tools.helper.php')) {
226 226
             EE_Error::add_error(
227 227
                 __('The EEH_Class_Tools helper could not be loaded.', 'event_espresso'),
228 228
                 __FILE__, __FUNCTION__, __LINE__
229 229
             );
230 230
         }
231
-        require_once(EE_HELPERS . 'EEH_Class_Tools.helper.php');
231
+        require_once(EE_HELPERS.'EEH_Class_Tools.helper.php');
232 232
     }
233 233
 
234 234
 
Please login to merge, or discard this patch.
core/services/commands/CommandBus.php 2 patches
Indentation   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 use EventEspresso\core\services\commands\middleware\InvalidCommandBusMiddlewareException;
8 8
 
9 9
 if (! defined('EVENT_ESPRESSO_VERSION')) {
10
-    exit('No direct script access allowed');
10
+	exit('No direct script access allowed');
11 11
 }
12 12
 
13 13
 
@@ -40,78 +40,78 @@  discard block
 block discarded – undo
40 40
 class CommandBus implements CommandBusInterface
41 41
 {
42 42
 
43
-    /**
44
-     * @type CommandHandlerManagerInterface $command_handler_manager
45
-     */
46
-    private $command_handler_manager;
47
-
48
-    /**
49
-     * @type CommandBusMiddlewareInterface[] $command_bus_middleware
50
-     */
51
-    private $command_bus_middleware;
52
-
53
-
54
-
55
-    /**
56
-     * CommandBus constructor
57
-     *
58
-     * @param CommandHandlerManagerInterface  $command_handler_manager
59
-     * @param CommandBusMiddlewareInterface[] $command_bus_middleware
60
-     */
61
-    public function __construct(
62
-        CommandHandlerManagerInterface $command_handler_manager,
63
-        $command_bus_middleware = array()
64
-    ) {
65
-        $this->command_handler_manager = $command_handler_manager;
66
-        $this->command_bus_middleware = is_array($command_bus_middleware)
67
-            ? $command_bus_middleware
68
-            : array($command_bus_middleware);
69
-    }
70
-
71
-
72
-
73
-    /**
74
-     * @return CommandHandlerManagerInterface
75
-     */
76
-    public function getCommandHandlerManager()
77
-    {
78
-        return $this->command_handler_manager;
79
-    }
80
-
81
-
82
-
83
-    /**
84
-     * @param CommandInterface $command
85
-     * @return mixed
86
-     * @throws InvalidDataTypeException
87
-     * @throws InvalidCommandBusMiddlewareException
88
-     */
89
-    public function execute($command)
90
-    {
91
-        if (! $command instanceof CommandInterface) {
92
-            throw new InvalidDataTypeException(__METHOD__ . '( $command )', $command, 'CommandInterface');
93
-        }
94
-        // we're going to add the Command Handler as a callable
95
-        // that will get run at the end of our middleware stack
96
-        // can't pass $this to a Closure, so use a named variable
97
-        $command_bus = $this;
98
-        $middleware = function ($command) use ($command_bus) {
99
-            return $command_bus->getCommandHandlerManager()
100
-                ->getCommandHandler($command, $command_bus)
101
-                ->handle($command);
102
-        };
103
-        // now build the rest of the middleware stack
104
-        while ($command_bus_middleware = array_pop($this->command_bus_middleware)) {
105
-            if (! $command_bus_middleware instanceof CommandBusMiddlewareInterface) {
106
-                throw new InvalidCommandBusMiddlewareException($command_bus_middleware);
107
-            }
108
-            $middleware = function ($command) use ($command_bus_middleware, $middleware) {
109
-                return $command_bus_middleware->handle($command, $middleware);
110
-            };
111
-        }
112
-        // and finally, pass the command into the stack and return the results
113
-        return $middleware($command);
114
-    }
43
+	/**
44
+	 * @type CommandHandlerManagerInterface $command_handler_manager
45
+	 */
46
+	private $command_handler_manager;
47
+
48
+	/**
49
+	 * @type CommandBusMiddlewareInterface[] $command_bus_middleware
50
+	 */
51
+	private $command_bus_middleware;
52
+
53
+
54
+
55
+	/**
56
+	 * CommandBus constructor
57
+	 *
58
+	 * @param CommandHandlerManagerInterface  $command_handler_manager
59
+	 * @param CommandBusMiddlewareInterface[] $command_bus_middleware
60
+	 */
61
+	public function __construct(
62
+		CommandHandlerManagerInterface $command_handler_manager,
63
+		$command_bus_middleware = array()
64
+	) {
65
+		$this->command_handler_manager = $command_handler_manager;
66
+		$this->command_bus_middleware = is_array($command_bus_middleware)
67
+			? $command_bus_middleware
68
+			: array($command_bus_middleware);
69
+	}
70
+
71
+
72
+
73
+	/**
74
+	 * @return CommandHandlerManagerInterface
75
+	 */
76
+	public function getCommandHandlerManager()
77
+	{
78
+		return $this->command_handler_manager;
79
+	}
80
+
81
+
82
+
83
+	/**
84
+	 * @param CommandInterface $command
85
+	 * @return mixed
86
+	 * @throws InvalidDataTypeException
87
+	 * @throws InvalidCommandBusMiddlewareException
88
+	 */
89
+	public function execute($command)
90
+	{
91
+		if (! $command instanceof CommandInterface) {
92
+			throw new InvalidDataTypeException(__METHOD__ . '( $command )', $command, 'CommandInterface');
93
+		}
94
+		// we're going to add the Command Handler as a callable
95
+		// that will get run at the end of our middleware stack
96
+		// can't pass $this to a Closure, so use a named variable
97
+		$command_bus = $this;
98
+		$middleware = function ($command) use ($command_bus) {
99
+			return $command_bus->getCommandHandlerManager()
100
+				->getCommandHandler($command, $command_bus)
101
+				->handle($command);
102
+		};
103
+		// now build the rest of the middleware stack
104
+		while ($command_bus_middleware = array_pop($this->command_bus_middleware)) {
105
+			if (! $command_bus_middleware instanceof CommandBusMiddlewareInterface) {
106
+				throw new InvalidCommandBusMiddlewareException($command_bus_middleware);
107
+			}
108
+			$middleware = function ($command) use ($command_bus_middleware, $middleware) {
109
+				return $command_bus_middleware->handle($command, $middleware);
110
+			};
111
+		}
112
+		// and finally, pass the command into the stack and return the results
113
+		return $middleware($command);
114
+	}
115 115
 
116 116
 
117 117
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 use EventEspresso\core\services\commands\middleware\CommandBusMiddlewareInterface;
7 7
 use EventEspresso\core\services\commands\middleware\InvalidCommandBusMiddlewareException;
8 8
 
9
-if (! defined('EVENT_ESPRESSO_VERSION')) {
9
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
10 10
     exit('No direct script access allowed');
11 11
 }
12 12
 
@@ -88,24 +88,24 @@  discard block
 block discarded – undo
88 88
      */
89 89
     public function execute($command)
90 90
     {
91
-        if (! $command instanceof CommandInterface) {
92
-            throw new InvalidDataTypeException(__METHOD__ . '( $command )', $command, 'CommandInterface');
91
+        if ( ! $command instanceof CommandInterface) {
92
+            throw new InvalidDataTypeException(__METHOD__.'( $command )', $command, 'CommandInterface');
93 93
         }
94 94
         // we're going to add the Command Handler as a callable
95 95
         // that will get run at the end of our middleware stack
96 96
         // can't pass $this to a Closure, so use a named variable
97 97
         $command_bus = $this;
98
-        $middleware = function ($command) use ($command_bus) {
98
+        $middleware = function($command) use ($command_bus) {
99 99
             return $command_bus->getCommandHandlerManager()
100 100
                 ->getCommandHandler($command, $command_bus)
101 101
                 ->handle($command);
102 102
         };
103 103
         // now build the rest of the middleware stack
104 104
         while ($command_bus_middleware = array_pop($this->command_bus_middleware)) {
105
-            if (! $command_bus_middleware instanceof CommandBusMiddlewareInterface) {
105
+            if ( ! $command_bus_middleware instanceof CommandBusMiddlewareInterface) {
106 106
                 throw new InvalidCommandBusMiddlewareException($command_bus_middleware);
107 107
             }
108
-            $middleware = function ($command) use ($command_bus_middleware, $middleware) {
108
+            $middleware = function($command) use ($command_bus_middleware, $middleware) {
109 109
                 return $command_bus_middleware->handle($command, $middleware);
110 110
             };
111 111
         }
Please login to merge, or discard this patch.
core/services/commands/CommandFactory.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -24,40 +24,40 @@
 block discarded – undo
24 24
 
25 25
 
26 26
 
27
-    /**
28
-     * @var LoaderInterface $loader
29
-     */
30
-    private $loader;
31
-
32
-
33
-
34
-    /**
35
-     * CommandFactory constructor
36
-     *
37
-     * @param LoaderInterface $loader
38
-     * @throws InvalidDataTypeException
39
-     * @throws InvalidInterfaceException
40
-     * @throws InvalidArgumentException
41
-     */
42
-    public function __construct(LoaderInterface $loader = null)
43
-    {
44
-       $this->loader = $loader;
45
-    }
46
-
47
-
48
-
49
-    /**
50
-     * @param string $command_fqcn
51
-     * @param array  $arguments
52
-     * @return mixed
53
-     * @throws InvalidArgumentException
54
-     * @throws InvalidDataTypeException
55
-     * @throws InvalidInterfaceException
56
-     */
57
-    public function getNew($command_fqcn, $arguments = array())
58
-    {
59
-        return $this->loader->getNew($command_fqcn, $arguments);
60
-    }
27
+	/**
28
+	 * @var LoaderInterface $loader
29
+	 */
30
+	private $loader;
31
+
32
+
33
+
34
+	/**
35
+	 * CommandFactory constructor
36
+	 *
37
+	 * @param LoaderInterface $loader
38
+	 * @throws InvalidDataTypeException
39
+	 * @throws InvalidInterfaceException
40
+	 * @throws InvalidArgumentException
41
+	 */
42
+	public function __construct(LoaderInterface $loader = null)
43
+	{
44
+	   $this->loader = $loader;
45
+	}
46
+
47
+
48
+
49
+	/**
50
+	 * @param string $command_fqcn
51
+	 * @param array  $arguments
52
+	 * @return mixed
53
+	 * @throws InvalidArgumentException
54
+	 * @throws InvalidDataTypeException
55
+	 * @throws InvalidInterfaceException
56
+	 */
57
+	public function getNew($command_fqcn, $arguments = array())
58
+	{
59
+		return $this->loader->getNew($command_fqcn, $arguments);
60
+	}
61 61
 
62 62
 
63 63
 
Please login to merge, or discard this patch.
core/services/commands/CommandFactoryInterface.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -13,15 +13,15 @@
 block discarded – undo
13 13
 interface CommandFactoryInterface
14 14
 {
15 15
 
16
-    /**
17
-     * @param string $command_fqcn
18
-     * @param array  $arguments
19
-     * @return mixed
20
-     * @throws InvalidArgumentException
21
-     * @throws InvalidDataTypeException
22
-     * @throws InvalidInterfaceException
23
-     */
24
-    public function getNew($command_fqcn, $arguments = array());
16
+	/**
17
+	 * @param string $command_fqcn
18
+	 * @param array  $arguments
19
+	 * @return mixed
20
+	 * @throws InvalidArgumentException
21
+	 * @throws InvalidDataTypeException
22
+	 * @throws InvalidInterfaceException
23
+	 */
24
+	public function getNew($command_fqcn, $arguments = array());
25 25
 
26 26
 }
27 27
 // End of file CommandFactoryInterface.php
Please login to merge, or discard this patch.