Completed
Branch EDTR/barista (ea23a2)
by
unknown
09:50 queued 34s
created
core/services/assets/Barista.php 1 patch
Indentation   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -10,85 +10,85 @@
 block discarded – undo
10 10
 class Barista
11 11
 {
12 12
 
13
-    const DEPENDENCY_LIST_REGISTERED = 'registered';
13
+	const DEPENDENCY_LIST_REGISTERED = 'registered';
14 14
 
15 15
 
16
-    /**
17
-     * @var AssetManifest
18
-     */
19
-    private $asset_manifest;
16
+	/**
17
+	 * @var AssetManifest
18
+	 */
19
+	private $asset_manifest;
20 20
 
21
-    /**
22
-     * @var bool
23
-     */
24
-    protected $initialized = false;
21
+	/**
22
+	 * @var bool
23
+	 */
24
+	protected $initialized = false;
25 25
 
26 26
 
27
-    /**
28
-     * Barista constructor.
29
-     *
30
-     * @param AssetManifest   $asset_manifest
31
-     */
32
-    public function __construct(AssetManifest $asset_manifest)
33
-    {
34
-        $this->asset_manifest = $asset_manifest;
35
-    }
27
+	/**
28
+	 * Barista constructor.
29
+	 *
30
+	 * @param AssetManifest   $asset_manifest
31
+	 */
32
+	public function __construct(AssetManifest $asset_manifest)
33
+	{
34
+		$this->asset_manifest = $asset_manifest;
35
+	}
36 36
 
37 37
 
38
-    /**
39
-     * @return void
40
-     */
41
-    public function initialize()
42
-    {
43
-        if (! $this->initialized) {
44
-            add_action('wp_enqueue_scripts', [$this, 'registerScripts'], 0);
45
-            add_action('admin_enqueue_scripts', [$this, 'registerScripts'], 0);
46
-            add_action('wp_enqueue_scripts', [$this, 'registerPackagesStyles'], 0);
47
-            add_action('admin_enqueue_scripts', [$this, 'registerPackagesStyles'], 0);
48
-            add_action('wp_enqueue_scripts', [$this, 'addInlineData'], 10);
49
-            add_action('admin_enqueue_scripts', [$this, 'addInlineData'], 10);
50
-            $this->initialized = true;
51
-        }
52
-    }
38
+	/**
39
+	 * @return void
40
+	 */
41
+	public function initialize()
42
+	{
43
+		if (! $this->initialized) {
44
+			add_action('wp_enqueue_scripts', [$this, 'registerScripts'], 0);
45
+			add_action('admin_enqueue_scripts', [$this, 'registerScripts'], 0);
46
+			add_action('wp_enqueue_scripts', [$this, 'registerPackagesStyles'], 0);
47
+			add_action('admin_enqueue_scripts', [$this, 'registerPackagesStyles'], 0);
48
+			add_action('wp_enqueue_scripts', [$this, 'addInlineData'], 10);
49
+			add_action('admin_enqueue_scripts', [$this, 'addInlineData'], 10);
50
+			$this->initialized = true;
51
+		}
52
+	}
53 53
 
54 54
 
55
-    /**
56
-     * Registers all the WordPress packages scripts that are in the standardized
57
-     * `build/` location.
58
-     *
59
-     * @return void
60
-     */
61
-    public function registerScripts()
62
-    {
63
-        $entry_points = $this->asset_manifest->getEntryPoints();
64
-        foreach ($entry_points as $entry_point) {
65
-            if ($this->asset_manifest->hasAsset($entry_point)) {
66
-                $handle = $this->asset_manifest->getAssetHandle($entry_point);
67
-                $source = $this->asset_manifest->getAssetUrl($entry_point);
68
-                $dependencies = $this->asset_manifest->getAssetDependencies($entry_point);
69
-                $version = $this->asset_manifest->getAssetVersion($entry_point);
70
-                wp_register_script($handle, $source, $dependencies, $version, true);
71
-            }
72
-        }
73
-    }
55
+	/**
56
+	 * Registers all the WordPress packages scripts that are in the standardized
57
+	 * `build/` location.
58
+	 *
59
+	 * @return void
60
+	 */
61
+	public function registerScripts()
62
+	{
63
+		$entry_points = $this->asset_manifest->getEntryPoints();
64
+		foreach ($entry_points as $entry_point) {
65
+			if ($this->asset_manifest->hasAsset($entry_point)) {
66
+				$handle = $this->asset_manifest->getAssetHandle($entry_point);
67
+				$source = $this->asset_manifest->getAssetUrl($entry_point);
68
+				$dependencies = $this->asset_manifest->getAssetDependencies($entry_point);
69
+				$version = $this->asset_manifest->getAssetVersion($entry_point);
70
+				wp_register_script($handle, $source, $dependencies, $version, true);
71
+			}
72
+		}
73
+	}
74 74
 
75 75
 
76
-    /**
77
-     * Registers all the packages and domain styles that are in the build folder.
78
-     *
79
-     * @return void
80
-     */
81
-    public function registerPackagesStyles()
82
-    {
83
-        $entry_points = $this->asset_manifest->getEntryPoints();
84
-        foreach ($entry_points as $entry_point) {
85
-            if ($this->asset_manifest->hasAsset($entry_point, AssetManifest::ASSET_EXT_CSS)) {
86
-                $handle = $this->asset_manifest->getAssetHandle($entry_point);
87
-                $source = $this->asset_manifest->getAssetUrl($entry_point, AssetManifest::ASSET_EXT_CSS);
88
-                $dependencies = $this->asset_manifest->getAssetDependencies($entry_point, AssetManifest::ASSET_EXT_CSS);
89
-                $version = $this->asset_manifest->getAssetVersion($entry_point, AssetManifest::ASSET_EXT_CSS);
90
-                wp_register_style($handle, $source, $dependencies, $version, 'all');
91
-            }
92
-        }
93
-    }
76
+	/**
77
+	 * Registers all the packages and domain styles that are in the build folder.
78
+	 *
79
+	 * @return void
80
+	 */
81
+	public function registerPackagesStyles()
82
+	{
83
+		$entry_points = $this->asset_manifest->getEntryPoints();
84
+		foreach ($entry_points as $entry_point) {
85
+			if ($this->asset_manifest->hasAsset($entry_point, AssetManifest::ASSET_EXT_CSS)) {
86
+				$handle = $this->asset_manifest->getAssetHandle($entry_point);
87
+				$source = $this->asset_manifest->getAssetUrl($entry_point, AssetManifest::ASSET_EXT_CSS);
88
+				$dependencies = $this->asset_manifest->getAssetDependencies($entry_point, AssetManifest::ASSET_EXT_CSS);
89
+				$version = $this->asset_manifest->getAssetVersion($entry_point, AssetManifest::ASSET_EXT_CSS);
90
+				wp_register_style($handle, $source, $dependencies, $version, 'all');
91
+			}
92
+		}
93
+	}
94 94
 }
Please login to merge, or discard this patch.
core/EE_Dependency_Map.core.php 1 patch
Indentation   +992 added lines, -992 removed lines patch added patch discarded remove patch
@@ -21,996 +21,996 @@
 block discarded – undo
21 21
 class EE_Dependency_Map
22 22
 {
23 23
 
24
-    /**
25
-     * This means that the requested class dependency is not present in the dependency map
26
-     */
27
-    const not_registered = 0;
28
-
29
-    /**
30
-     * This instructs class loaders to ALWAYS return a newly instantiated object for the requested class.
31
-     */
32
-    const load_new_object = 1;
33
-
34
-    /**
35
-     * This instructs class loaders to return a previously instantiated and cached object for the requested class.
36
-     * IF a previously instantiated object does not exist, a new one will be created and added to the cache.
37
-     */
38
-    const load_from_cache = 2;
39
-
40
-    /**
41
-     * When registering a dependency,
42
-     * this indicates to keep any existing dependencies that already exist,
43
-     * and simply discard any new dependencies declared in the incoming data
44
-     */
45
-    const KEEP_EXISTING_DEPENDENCIES = 0;
46
-
47
-    /**
48
-     * When registering a dependency,
49
-     * this indicates to overwrite any existing dependencies that already exist using the incoming data
50
-     */
51
-    const OVERWRITE_DEPENDENCIES = 1;
52
-
53
-    /**
54
-     * @type EE_Dependency_Map $_instance
55
-     */
56
-    protected static $_instance;
57
-
58
-    /**
59
-     * @var ClassInterfaceCache $class_cache
60
-     */
61
-    private $class_cache;
62
-
63
-    /**
64
-     * @type RequestInterface $request
65
-     */
66
-    protected $request;
67
-
68
-    /**
69
-     * @type LegacyRequestInterface $legacy_request
70
-     */
71
-    protected $legacy_request;
72
-
73
-    /**
74
-     * @type ResponseInterface $response
75
-     */
76
-    protected $response;
77
-
78
-    /**
79
-     * @type LoaderInterface $loader
80
-     */
81
-    protected $loader;
82
-
83
-    /**
84
-     * @type array $_dependency_map
85
-     */
86
-    protected $_dependency_map = [];
87
-
88
-    /**
89
-     * @type array $_class_loaders
90
-     */
91
-    protected $_class_loaders = [];
92
-
93
-
94
-    /**
95
-     * EE_Dependency_Map constructor.
96
-     *
97
-     * @param ClassInterfaceCache $class_cache
98
-     */
99
-    protected function __construct(ClassInterfaceCache $class_cache)
100
-    {
101
-        $this->class_cache = $class_cache;
102
-        do_action('EE_Dependency_Map____construct', $this);
103
-    }
104
-
105
-
106
-    /**
107
-     * @return void
108
-     * @throws InvalidAliasException
109
-     */
110
-    public function initialize()
111
-    {
112
-        $this->_register_core_dependencies();
113
-        $this->_register_core_class_loaders();
114
-        $this->_register_core_aliases();
115
-    }
116
-
117
-
118
-    /**
119
-     * @singleton method used to instantiate class object
120
-     * @param ClassInterfaceCache|null $class_cache
121
-     * @return EE_Dependency_Map
122
-     */
123
-    public static function instance(ClassInterfaceCache $class_cache = null)
124
-    {
125
-        // check if class object is instantiated, and instantiated properly
126
-        if (! EE_Dependency_Map::$_instance instanceof EE_Dependency_Map
127
-            && $class_cache instanceof ClassInterfaceCache
128
-        ) {
129
-            EE_Dependency_Map::$_instance = new EE_Dependency_Map($class_cache);
130
-        }
131
-        return EE_Dependency_Map::$_instance;
132
-    }
133
-
134
-
135
-    /**
136
-     * @param RequestInterface $request
137
-     */
138
-    public function setRequest(RequestInterface $request)
139
-    {
140
-        $this->request = $request;
141
-    }
142
-
143
-
144
-    /**
145
-     * @param LegacyRequestInterface $legacy_request
146
-     */
147
-    public function setLegacyRequest(LegacyRequestInterface $legacy_request)
148
-    {
149
-        $this->legacy_request = $legacy_request;
150
-    }
151
-
152
-
153
-    /**
154
-     * @param ResponseInterface $response
155
-     */
156
-    public function setResponse(ResponseInterface $response)
157
-    {
158
-        $this->response = $response;
159
-    }
160
-
161
-
162
-    /**
163
-     * @param LoaderInterface $loader
164
-     */
165
-    public function setLoader(LoaderInterface $loader)
166
-    {
167
-        $this->loader = $loader;
168
-    }
169
-
170
-
171
-    /**
172
-     * @param string $class
173
-     * @param array  $dependencies
174
-     * @param int    $overwrite
175
-     * @return bool
176
-     */
177
-    public static function register_dependencies(
178
-        $class,
179
-        array $dependencies,
180
-        $overwrite = EE_Dependency_Map::KEEP_EXISTING_DEPENDENCIES
181
-    ) {
182
-        return EE_Dependency_Map::$_instance->registerDependencies($class, $dependencies, $overwrite);
183
-    }
184
-
185
-
186
-    /**
187
-     * Assigns an array of class names and corresponding load sources (new or cached)
188
-     * to the class specified by the first parameter.
189
-     * IMPORTANT !!!
190
-     * The order of elements in the incoming $dependencies array MUST match
191
-     * the order of the constructor parameters for the class in question.
192
-     * This is especially important when overriding any existing dependencies that are registered.
193
-     * the third parameter controls whether any duplicate dependencies are overwritten or not.
194
-     *
195
-     * @param string $class
196
-     * @param array  $dependencies
197
-     * @param int    $overwrite
198
-     * @return bool
199
-     */
200
-    public function registerDependencies(
201
-        $class,
202
-        array $dependencies,
203
-        $overwrite = EE_Dependency_Map::KEEP_EXISTING_DEPENDENCIES
204
-    ) {
205
-        $class = trim($class, '\\');
206
-        $registered = false;
207
-        if (empty(EE_Dependency_Map::$_instance->_dependency_map[ $class ])) {
208
-            EE_Dependency_Map::$_instance->_dependency_map[ $class ] = [];
209
-        }
210
-        // we need to make sure that any aliases used when registering a dependency
211
-        // get resolved to the correct class name
212
-        foreach ($dependencies as $dependency => $load_source) {
213
-            $alias = EE_Dependency_Map::$_instance->getFqnForAlias($dependency);
214
-            if ($overwrite === EE_Dependency_Map::OVERWRITE_DEPENDENCIES
215
-                || ! isset(EE_Dependency_Map::$_instance->_dependency_map[ $class ][ $alias ])
216
-            ) {
217
-                unset($dependencies[ $dependency ]);
218
-                $dependencies[ $alias ] = $load_source;
219
-                $registered = true;
220
-            }
221
-        }
222
-        // now add our two lists of dependencies together.
223
-        // using Union (+=) favours the arrays in precedence from left to right,
224
-        // so $dependencies is NOT overwritten because it is listed first
225
-        // ie: with A = B + C, entries in B take precedence over duplicate entries in C
226
-        // Union is way faster than array_merge() but should be used with caution...
227
-        // especially with numerically indexed arrays
228
-        $dependencies += EE_Dependency_Map::$_instance->_dependency_map[ $class ];
229
-        // now we need to ensure that the resulting dependencies
230
-        // array only has the entries that are required for the class
231
-        // so first count how many dependencies were originally registered for the class
232
-        $dependency_count = count(EE_Dependency_Map::$_instance->_dependency_map[ $class ]);
233
-        // if that count is non-zero (meaning dependencies were already registered)
234
-        EE_Dependency_Map::$_instance->_dependency_map[ $class ] = $dependency_count
235
-            // then truncate the  final array to match that count
236
-            ? array_slice($dependencies, 0, $dependency_count)
237
-            // otherwise just take the incoming array because nothing previously existed
238
-            : $dependencies;
239
-        return $registered;
240
-    }
241
-
242
-
243
-    /**
244
-     * @param string $class_name
245
-     * @param string $loader
246
-     * @return bool
247
-     * @throws DomainException
248
-     */
249
-    public static function register_class_loader($class_name, $loader = 'load_core')
250
-    {
251
-        return EE_Dependency_Map::$_instance->registerClassLoader($class_name, $loader);
252
-    }
253
-
254
-
255
-    /**
256
-     * @param string $class_name
257
-     * @param string $loader
258
-     * @return bool
259
-     * @throws DomainException
260
-     */
261
-    public function registerClassLoader($class_name, $loader = 'load_core')
262
-    {
263
-        if (! $loader instanceof Closure && strpos($class_name, '\\') !== false) {
264
-            throw new DomainException(
265
-                esc_html__('Don\'t use class loaders for FQCNs.', 'event_espresso')
266
-            );
267
-        }
268
-        // check that loader is callable or method starts with "load_" and exists in EE_Registry
269
-        if (! is_callable($loader)
270
-            && (
271
-                strpos($loader, 'load_') !== 0
272
-                || ! method_exists('EE_Registry', $loader)
273
-            )
274
-        ) {
275
-            throw new DomainException(
276
-                sprintf(
277
-                    esc_html__(
278
-                        '"%1$s" is not a valid loader method on EE_Registry.',
279
-                        'event_espresso'
280
-                    ),
281
-                    $loader
282
-                )
283
-            );
284
-        }
285
-        $class_name = EE_Dependency_Map::$_instance->getFqnForAlias($class_name);
286
-        if (! isset(EE_Dependency_Map::$_instance->_class_loaders[ $class_name ])) {
287
-            EE_Dependency_Map::$_instance->_class_loaders[ $class_name ] = $loader;
288
-            return true;
289
-        }
290
-        return false;
291
-    }
292
-
293
-
294
-    /**
295
-     * @return array
296
-     */
297
-    public function dependency_map()
298
-    {
299
-        return $this->_dependency_map;
300
-    }
301
-
302
-
303
-    /**
304
-     * returns TRUE if dependency map contains a listing for the provided class name
305
-     *
306
-     * @param string $class_name
307
-     * @return boolean
308
-     */
309
-    public function has($class_name = '')
310
-    {
311
-        // all legacy models have the same dependencies
312
-        if (strpos($class_name, 'EEM_') === 0) {
313
-            $class_name = 'LEGACY_MODELS';
314
-        }
315
-        return isset($this->_dependency_map[ $class_name ]);
316
-    }
317
-
318
-
319
-    /**
320
-     * returns TRUE if dependency map contains a listing for the provided class name AND dependency
321
-     *
322
-     * @param string $class_name
323
-     * @param string $dependency
324
-     * @return bool
325
-     */
326
-    public function has_dependency_for_class($class_name = '', $dependency = '')
327
-    {
328
-        // all legacy models have the same dependencies
329
-        if (strpos($class_name, 'EEM_') === 0) {
330
-            $class_name = 'LEGACY_MODELS';
331
-        }
332
-        $dependency = $this->getFqnForAlias($dependency, $class_name);
333
-        return isset($this->_dependency_map[ $class_name ][ $dependency ]);
334
-    }
335
-
336
-
337
-    /**
338
-     * returns loading strategy for whether a previously cached dependency should be loaded or a new instance returned
339
-     *
340
-     * @param string $class_name
341
-     * @param string $dependency
342
-     * @return int
343
-     */
344
-    public function loading_strategy_for_class_dependency($class_name = '', $dependency = '')
345
-    {
346
-        // all legacy models have the same dependencies
347
-        if (strpos($class_name, 'EEM_') === 0) {
348
-            $class_name = 'LEGACY_MODELS';
349
-        }
350
-        $dependency = $this->getFqnForAlias($dependency);
351
-        return $this->has_dependency_for_class($class_name, $dependency)
352
-            ? $this->_dependency_map[ $class_name ][ $dependency ]
353
-            : EE_Dependency_Map::not_registered;
354
-    }
355
-
356
-
357
-    /**
358
-     * @param string $class_name
359
-     * @return string | Closure
360
-     */
361
-    public function class_loader($class_name)
362
-    {
363
-        // all legacy models use load_model()
364
-        if (strpos($class_name, 'EEM_') === 0) {
365
-            return 'load_model';
366
-        }
367
-        // EE_CPT_*_Strategy classes like EE_CPT_Event_Strategy, EE_CPT_Venue_Strategy, etc
368
-        // perform strpos() first to avoid loading regex every time we load a class
369
-        if (strpos($class_name, 'EE_CPT_') === 0
370
-            && preg_match('/^EE_CPT_([a-zA-Z]+)_Strategy$/', $class_name)
371
-        ) {
372
-            return 'load_core';
373
-        }
374
-        $class_name = $this->getFqnForAlias($class_name);
375
-        return isset($this->_class_loaders[ $class_name ]) ? $this->_class_loaders[ $class_name ] : '';
376
-    }
377
-
378
-
379
-    /**
380
-     * @return array
381
-     */
382
-    public function class_loaders()
383
-    {
384
-        return $this->_class_loaders;
385
-    }
386
-
387
-
388
-    /**
389
-     * adds an alias for a classname
390
-     *
391
-     * @param string $fqcn      the class name that should be used (concrete class to replace interface)
392
-     * @param string $alias     the class name that would be type hinted for (abstract parent or interface)
393
-     * @param string $for_class the class that has the dependency (is type hinting for the interface)
394
-     * @throws InvalidAliasException
395
-     */
396
-    public function add_alias($fqcn, $alias, $for_class = '')
397
-    {
398
-        $this->class_cache->addAlias($fqcn, $alias, $for_class);
399
-    }
400
-
401
-
402
-    /**
403
-     * Returns TRUE if the provided fully qualified name IS an alias
404
-     * WHY?
405
-     * Because if a class is type hinting for a concretion,
406
-     * then why would we need to find another class to supply it?
407
-     * ie: if a class asks for `Fully/Qualified/Namespace/SpecificClassName`,
408
-     * then give it an instance of `Fully/Qualified/Namespace/SpecificClassName`.
409
-     * Don't go looking for some substitute.
410
-     * Whereas if a class is type hinting for an interface...
411
-     * then we need to find an actual class to use.
412
-     * So the interface IS the alias for some other FQN,
413
-     * and we need to find out if `Fully/Qualified/Namespace/SomeInterface`
414
-     * represents some other class.
415
-     *
416
-     * @param string $fqn
417
-     * @param string $for_class
418
-     * @return bool
419
-     */
420
-    public function isAlias($fqn = '', $for_class = '')
421
-    {
422
-        return $this->class_cache->isAlias($fqn, $for_class);
423
-    }
424
-
425
-
426
-    /**
427
-     * Returns a FQN for provided alias if one exists, otherwise returns the original $alias
428
-     * functions recursively, so that multiple aliases can be used to drill down to a FQN
429
-     *  for example:
430
-     *      if the following two entries were added to the _aliases array:
431
-     *          array(
432
-     *              'interface_alias'           => 'some\namespace\interface'
433
-     *              'some\namespace\interface'  => 'some\namespace\classname'
434
-     *          )
435
-     *      then one could use EE_Registry::instance()->create( 'interface_alias' )
436
-     *      to load an instance of 'some\namespace\classname'
437
-     *
438
-     * @param string $alias
439
-     * @param string $for_class
440
-     * @return string
441
-     */
442
-    public function getFqnForAlias($alias = '', $for_class = '')
443
-    {
444
-        return (string) $this->class_cache->getFqnForAlias($alias, $for_class);
445
-    }
446
-
447
-
448
-    /**
449
-     * Registers the core dependencies and whether a previously instantiated object should be loaded from the cache,
450
-     * if one exists, or whether a new object should be generated every time the requested class is loaded.
451
-     * This is done by using the following class constants:
452
-     *        EE_Dependency_Map::load_from_cache - loads previously instantiated object
453
-     *        EE_Dependency_Map::load_new_object - generates a new object every time
454
-     */
455
-    protected function _register_core_dependencies()
456
-    {
457
-        $this->_dependency_map = [
458
-            'EE_Request_Handler'                                                                                          => [
459
-                'EE_Request' => EE_Dependency_Map::load_from_cache,
460
-            ],
461
-            'EE_System'                                                                                                   => [
462
-                'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
463
-                'EE_Maintenance_Mode'                         => EE_Dependency_Map::load_from_cache,
464
-                'EE_Registry'                                 => EE_Dependency_Map::load_from_cache,
465
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
466
-                'EventEspresso\core\services\routing\Router'  => EE_Dependency_Map::load_from_cache,
467
-            ],
468
-            'EE_Admin'                                                                                                    => [
469
-                'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
470
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
471
-            ],
472
-            'EE_Cart'                                                                                                     => [
473
-                'EE_Session' => EE_Dependency_Map::load_from_cache,
474
-            ],
475
-            'EE_Messenger_Collection_Loader'                                                                              => [
476
-                'EE_Messenger_Collection' => EE_Dependency_Map::load_new_object,
477
-            ],
478
-            'EE_Message_Type_Collection_Loader'                                                                           => [
479
-                'EE_Message_Type_Collection' => EE_Dependency_Map::load_new_object,
480
-            ],
481
-            'EE_Message_Resource_Manager'                                                                                 => [
482
-                'EE_Messenger_Collection_Loader'    => EE_Dependency_Map::load_new_object,
483
-                'EE_Message_Type_Collection_Loader' => EE_Dependency_Map::load_new_object,
484
-                'EEM_Message_Template_Group'        => EE_Dependency_Map::load_from_cache,
485
-            ],
486
-            'EE_Message_Factory'                                                                                          => [
487
-                'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
488
-            ],
489
-            'EE_messages'                                                                                                 => [
490
-                'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
491
-            ],
492
-            'EE_Messages_Generator'                                                                                       => [
493
-                'EE_Messages_Queue'                    => EE_Dependency_Map::load_new_object,
494
-                'EE_Messages_Data_Handler_Collection'  => EE_Dependency_Map::load_new_object,
495
-                'EE_Message_Template_Group_Collection' => EE_Dependency_Map::load_new_object,
496
-                'EEH_Parse_Shortcodes'                 => EE_Dependency_Map::load_from_cache,
497
-            ],
498
-            'EE_Messages_Processor'                                                                                       => [
499
-                'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
500
-            ],
501
-            'EE_Messages_Queue'                                                                                           => [
502
-                'EE_Message_Repository' => EE_Dependency_Map::load_new_object,
503
-            ],
504
-            'EE_Messages_Template_Defaults'                                                                               => [
505
-                'EEM_Message_Template_Group' => EE_Dependency_Map::load_from_cache,
506
-                'EEM_Message_Template'       => EE_Dependency_Map::load_from_cache,
507
-            ],
508
-            'EE_Message_To_Generate_From_Request'                                                                         => [
509
-                'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
510
-                'EE_Request_Handler'          => EE_Dependency_Map::load_from_cache,
511
-            ],
512
-            'EventEspresso\core\services\commands\CommandBus'                                                             => [
513
-                'EventEspresso\core\services\commands\CommandHandlerManager' => EE_Dependency_Map::load_from_cache,
514
-            ],
515
-            'EventEspresso\services\commands\CommandHandler'                                                              => [
516
-                'EE_Registry'         => EE_Dependency_Map::load_from_cache,
517
-                'CommandBusInterface' => EE_Dependency_Map::load_from_cache,
518
-            ],
519
-            'EventEspresso\core\services\commands\CommandHandlerManager'                                                  => [
520
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
521
-            ],
522
-            'EventEspresso\core\services\commands\CompositeCommandHandler'                                                => [
523
-                'EventEspresso\core\services\commands\CommandBus'     => EE_Dependency_Map::load_from_cache,
524
-                'EventEspresso\core\services\commands\CommandFactory' => EE_Dependency_Map::load_from_cache,
525
-            ],
526
-            'EventEspresso\core\services\commands\CommandFactory'                                                         => [
527
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
528
-            ],
529
-            'EventEspresso\core\services\commands\middleware\CapChecker'                                                  => [
530
-                'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache,
531
-            ],
532
-            'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker'                                         => [
533
-                'EE_Capabilities' => EE_Dependency_Map::load_from_cache,
534
-            ],
535
-            'EventEspresso\core\domain\services\capabilities\RegistrationsCapChecker'                                     => [
536
-                'EE_Capabilities' => EE_Dependency_Map::load_from_cache,
537
-            ],
538
-            'EventEspresso\core\services\commands\registration\CreateRegistrationCommandHandler'                          => [
539
-                'EventEspresso\core\domain\services\registration\CreateRegistrationService' => EE_Dependency_Map::load_from_cache,
540
-            ],
541
-            'EventEspresso\core\services\commands\registration\CopyRegistrationDetailsCommandHandler'                     => [
542
-                'EventEspresso\core\domain\services\registration\CopyRegistrationService' => EE_Dependency_Map::load_from_cache,
543
-            ],
544
-            'EventEspresso\core\services\commands\registration\CopyRegistrationPaymentsCommandHandler'                    => [
545
-                'EventEspresso\core\domain\services\registration\CopyRegistrationService' => EE_Dependency_Map::load_from_cache,
546
-            ],
547
-            'EventEspresso\core\services\commands\registration\CancelRegistrationAndTicketLineItemCommandHandler'         => [
548
-                'EventEspresso\core\domain\services\registration\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
549
-            ],
550
-            'EventEspresso\core\services\commands\registration\UpdateRegistrationAndTransactionAfterChangeCommandHandler' => [
551
-                'EventEspresso\core\domain\services\registration\UpdateRegistrationService' => EE_Dependency_Map::load_from_cache,
552
-            ],
553
-            'EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommandHandler'                              => [
554
-                'EventEspresso\core\domain\services\ticket\CreateTicketLineItemService' => EE_Dependency_Map::load_from_cache,
555
-            ],
556
-            'EventEspresso\core\services\commands\ticket\CancelTicketLineItemCommandHandler'                              => [
557
-                'EventEspresso\core\domain\services\ticket\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
558
-            ],
559
-            'EventEspresso\core\domain\services\registration\CancelRegistrationService'                                   => [
560
-                'EventEspresso\core\domain\services\ticket\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
561
-            ],
562
-            'EventEspresso\core\services\commands\attendee\CreateAttendeeCommandHandler'                                  => [
563
-                'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
564
-            ],
565
-            'EventEspresso\core\services\database\TableManager'                                                           => [
566
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
567
-            ],
568
-            'EE_Data_Migration_Class_Base'                                                                                => [
569
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
570
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
571
-            ],
572
-            'EE_DMS_Core_4_1_0'                                                                                           => [
573
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
574
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
575
-            ],
576
-            'EE_DMS_Core_4_2_0'                                                                                           => [
577
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
578
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
579
-            ],
580
-            'EE_DMS_Core_4_3_0'                                                                                           => [
581
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
582
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
583
-            ],
584
-            'EE_DMS_Core_4_4_0'                                                                                           => [
585
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
586
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
587
-            ],
588
-            'EE_DMS_Core_4_5_0'                                                                                           => [
589
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
590
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
591
-            ],
592
-            'EE_DMS_Core_4_6_0'                                                                                           => [
593
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
594
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
595
-            ],
596
-            'EE_DMS_Core_4_7_0'                                                                                           => [
597
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
598
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
599
-            ],
600
-            'EE_DMS_Core_4_8_0'                                                                                           => [
601
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
602
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
603
-            ],
604
-            'EE_DMS_Core_4_9_0'                                                                                           => [
605
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
606
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
607
-            ],
608
-            'EE_DMS_Core_4_10_0'                                                                                          => [
609
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
610
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
611
-                'EE_DMS_Core_4_9_0'                                  => EE_Dependency_Map::load_from_cache,
612
-            ],
613
-            'EventEspresso\core\services\assets\I18nRegistry'                                                             => [
614
-                'EventEspresso\core\domain\Domain'                 => EE_Dependency_Map::load_from_cache,
615
-                'EventEspresso\core\services\assets\JedLocaleData' => EE_Dependency_Map::load_from_cache,
616
-                [],
617
-            ],
618
-            'EventEspresso\core\services\assets\Registry'                                                                 => [
619
-                'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_new_object,
620
-                'EventEspresso\core\services\assets\AssetManifest'   => EE_Dependency_Map::load_from_cache,
621
-                'EventEspresso\core\services\assets\I18nRegistry'    => EE_Dependency_Map::load_from_cache,
622
-            ],
623
-            'EventEspresso\core\services\cache\BasicCacheManager'                                                         => [
624
-                'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache,
625
-            ],
626
-            'EventEspresso\core\services\cache\PostRelatedCacheManager'                                                   => [
627
-                'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache,
628
-            ],
629
-            'EventEspresso\core\domain\services\validation\email\EmailValidationService'                                  => [
630
-                'EE_Registration_Config'                     => EE_Dependency_Map::load_from_cache,
631
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
632
-            ],
633
-            'EventEspresso\core\domain\values\EmailAddress'                                                               => [
634
-                null,
635
-                'EventEspresso\core\domain\services\validation\email\EmailValidationService' => EE_Dependency_Map::load_from_cache,
636
-            ],
637
-            'EventEspresso\core\services\orm\ModelFieldFactory'                                                           => [
638
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
639
-            ],
640
-            'LEGACY_MODELS'                                                                                               => [
641
-                null,
642
-                'EventEspresso\core\services\database\ModelFieldFactory' => EE_Dependency_Map::load_from_cache,
643
-            ],
644
-            'EE_Module_Request_Router'                                                                                    => [
645
-                'EE_Request' => EE_Dependency_Map::load_from_cache,
646
-            ],
647
-            'EE_Registration_Processor'                                                                                   => [
648
-                'EE_Request' => EE_Dependency_Map::load_from_cache,
649
-            ],
650
-            'EventEspresso\core\services\notifications\PersistentAdminNoticeManager'                                      => [
651
-                null,
652
-                'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache,
653
-                'EventEspresso\core\services\request\Request'                         => EE_Dependency_Map::load_from_cache,
654
-            ],
655
-            'EventEspresso\caffeinated\modules\recaptcha_invisible\InvisibleRecaptcha'                                    => [
656
-                'EE_Registration_Config' => EE_Dependency_Map::load_from_cache,
657
-                'EE_Session'             => EE_Dependency_Map::load_from_cache,
658
-            ],
659
-            'EventEspresso\modules\ticket_selector\ProcessTicketSelector'                                                 => [
660
-                'EE_Core_Config'                                                          => EE_Dependency_Map::load_from_cache,
661
-                'EventEspresso\core\services\request\Request'                             => EE_Dependency_Map::load_from_cache,
662
-                'EE_Session'                                                              => EE_Dependency_Map::load_from_cache,
663
-                'EEM_Ticket'                                                              => EE_Dependency_Map::load_from_cache,
664
-                'EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker' => EE_Dependency_Map::load_from_cache,
665
-            ],
666
-            'EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker'                                     => [
667
-                'EEM_Datetime' => EE_Dependency_Map::load_from_cache,
668
-            ],
669
-            'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions'                              => [
670
-                'EE_Core_Config'                             => EE_Dependency_Map::load_from_cache,
671
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
672
-            ],
673
-            'EventEspresso\core\domain\services\custom_post_types\RegisterCustomPostTypes'                                => [
674
-                'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => EE_Dependency_Map::load_from_cache,
675
-            ],
676
-            'EventEspresso\core\domain\services\custom_post_types\RegisterCustomTaxonomies'                               => [
677
-                'EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions' => EE_Dependency_Map::load_from_cache,
678
-            ],
679
-            'EE_CPT_Strategy'                                                                                             => [
680
-                'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => EE_Dependency_Map::load_from_cache,
681
-                'EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions' => EE_Dependency_Map::load_from_cache,
682
-            ],
683
-            'EventEspresso\core\services\loaders\ObjectIdentifier'                                                        => [
684
-                'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache,
685
-            ],
686
-            'EventEspresso\core\CPTs\CptQueryModifier'                                                                    => [
687
-                null,
688
-                null,
689
-                null,
690
-                'EE_Request_Handler'                          => EE_Dependency_Map::load_from_cache,
691
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
692
-                'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
693
-            ],
694
-            'EventEspresso\core\services\dependencies\DependencyResolver'                                                 => [
695
-                'EventEspresso\core\services\container\Mirror'            => EE_Dependency_Map::load_from_cache,
696
-                'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache,
697
-                'EE_Dependency_Map'                                       => EE_Dependency_Map::load_from_cache,
698
-            ],
699
-            'EventEspresso\core\services\routing\RouteMatchSpecificationDependencyResolver'                               => [
700
-                'EventEspresso\core\services\container\Mirror'            => EE_Dependency_Map::load_from_cache,
701
-                'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache,
702
-                'EE_Dependency_Map'                                       => EE_Dependency_Map::load_from_cache,
703
-            ],
704
-            'EventEspresso\core\services\routing\RouteMatchSpecificationFactory'                                          => [
705
-                'EventEspresso\core\services\routing\RouteMatchSpecificationDependencyResolver' => EE_Dependency_Map::load_from_cache,
706
-                'EventEspresso\core\services\loaders\Loader'                                    => EE_Dependency_Map::load_from_cache,
707
-            ],
708
-            'EventEspresso\core\services\routing\RouteMatchSpecificationManager'                                          => [
709
-                'EventEspresso\core\services\routing\RouteMatchSpecificationCollection' => EE_Dependency_Map::load_from_cache,
710
-                'EventEspresso\core\services\routing\RouteMatchSpecificationFactory'    => EE_Dependency_Map::load_from_cache,
711
-            ],
712
-            'EE_URL_Validation_Strategy'                                                                                  => [
713
-                null,
714
-                null,
715
-                'EventEspresso\core\services\validators\URLValidator' => EE_Dependency_Map::load_from_cache,
716
-            ],
717
-            'EventEspresso\core\services\request\files\FilesDataHandler'                                                  => [
718
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
719
-            ],
720
-            'EventEspressoBatchRequest\BatchRequestProcessor'                                                             => [
721
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
722
-            ],
723
-            'EventEspresso\core\domain\services\converters\RestApiSpoofer'                                                => [
724
-                'WP_REST_Server'                                               => EE_Dependency_Map::load_from_cache,
725
-                'EED_Core_Rest_Api'                                            => EE_Dependency_Map::load_from_cache,
726
-                'EventEspresso\core\libraries\rest_api\controllers\model\Read' => EE_Dependency_Map::load_from_cache,
727
-                null,
728
-            ],
729
-            'EventEspresso\core\services\routing\RouteHandler'                                                            => [
730
-                'EventEspresso\core\services\json\JsonDataNodeHandler' => EE_Dependency_Map::load_from_cache,
731
-                'EventEspresso\core\services\loaders\Loader'           => EE_Dependency_Map::load_from_cache,
732
-                'EventEspresso\core\services\request\Request'          => EE_Dependency_Map::load_from_cache,
733
-                'EventEspresso\core\services\routing\RouteCollection'  => EE_Dependency_Map::load_from_cache,
734
-            ],
735
-            'EventEspresso\core\services\json\JsonDataNodeHandler'                                                        => [
736
-                'EventEspresso\core\services\json\JsonDataNodeValidator' => EE_Dependency_Map::load_from_cache,
737
-            ],
738
-            'EventEspresso\core\services\routing\Router'                                                                  => [
739
-                'EE_Dependency_Map'                                => EE_Dependency_Map::load_from_cache,
740
-                'EventEspresso\core\services\loaders\Loader'       => EE_Dependency_Map::load_from_cache,
741
-                'EventEspresso\core\services\routing\RouteHandler' => EE_Dependency_Map::load_from_cache,
742
-            ],
743
-            'EventEspresso\core\services\assets\Barista' => [
744
-                'EventEspresso\core\services\assets\AssetManifest' => EE_Dependency_Map::load_from_cache,
745
-            ],
746
-            'EventEspresso\core\services\assets\AssetManifest' => [
747
-                'EventEspresso\core\domain\Domain'                 => EE_Dependency_Map::load_from_cache,
748
-            ],
749
-        ];
750
-    }
751
-
752
-
753
-    /**
754
-     * Registers how core classes are loaded.
755
-     * This can either be done by simply providing the name of one of the EE_Registry loader methods such as:
756
-     *        'EE_Request_Handler' => 'load_core'
757
-     *        'EE_Messages_Queue'  => 'load_lib'
758
-     *        'EEH_Debug_Tools'    => 'load_helper'
759
-     * or, if greater control is required, by providing a custom closure. For example:
760
-     *        'Some_Class' => function () {
761
-     *            return new Some_Class();
762
-     *        },
763
-     * This is required for instantiating dependencies
764
-     * where an interface has been type hinted in a class constructor. For example:
765
-     *        'Required_Interface' => function () {
766
-     *            return new A_Class_That_Implements_Required_Interface();
767
-     *        },
768
-     */
769
-    protected function _register_core_class_loaders()
770
-    {
771
-        $this->_class_loaders = [
772
-            // load_core
773
-            'EE_Dependency_Map'                            => function () {
774
-                return $this;
775
-            },
776
-            'EE_Capabilities'                              => 'load_core',
777
-            'EE_Encryption'                                => 'load_core',
778
-            'EE_Front_Controller'                          => 'load_core',
779
-            'EE_Module_Request_Router'                     => 'load_core',
780
-            'EE_Registry'                                  => 'load_core',
781
-            'EE_Request'                                   => function () {
782
-                return $this->legacy_request;
783
-            },
784
-            'EventEspresso\core\services\request\Request'  => function () {
785
-                return $this->request;
786
-            },
787
-            'EventEspresso\core\services\request\Response' => function () {
788
-                return $this->response;
789
-            },
790
-            'EE_Base'                                      => 'load_core',
791
-            'EE_Request_Handler'                           => 'load_core',
792
-            'EE_Session'                                   => 'load_core',
793
-            'EE_Cron_Tasks'                                => 'load_core',
794
-            'EE_System'                                    => 'load_core',
795
-            'EE_Maintenance_Mode'                          => 'load_core',
796
-            'EE_Register_CPTs'                             => 'load_core',
797
-            'EE_Admin'                                     => 'load_core',
798
-            'EE_CPT_Strategy'                              => 'load_core',
799
-            // load_class
800
-            'EE_Registration_Processor'                    => 'load_class',
801
-            // load_lib
802
-            'EE_Message_Resource_Manager'                  => 'load_lib',
803
-            'EE_Message_Type_Collection'                   => 'load_lib',
804
-            'EE_Message_Type_Collection_Loader'            => 'load_lib',
805
-            'EE_Messenger_Collection'                      => 'load_lib',
806
-            'EE_Messenger_Collection_Loader'               => 'load_lib',
807
-            'EE_Messages_Processor'                        => 'load_lib',
808
-            'EE_Message_Repository'                        => 'load_lib',
809
-            'EE_Messages_Queue'                            => 'load_lib',
810
-            'EE_Messages_Data_Handler_Collection'          => 'load_lib',
811
-            'EE_Message_Template_Group_Collection'         => 'load_lib',
812
-            'EE_Payment_Method_Manager'                    => 'load_lib',
813
-            'EE_DMS_Core_4_1_0'                            => 'load_dms',
814
-            'EE_DMS_Core_4_2_0'                            => 'load_dms',
815
-            'EE_DMS_Core_4_3_0'                            => 'load_dms',
816
-            'EE_DMS_Core_4_5_0'                            => 'load_dms',
817
-            'EE_DMS_Core_4_6_0'                            => 'load_dms',
818
-            'EE_DMS_Core_4_7_0'                            => 'load_dms',
819
-            'EE_DMS_Core_4_8_0'                            => 'load_dms',
820
-            'EE_DMS_Core_4_9_0'                            => 'load_dms',
821
-            'EE_DMS_Core_4_10_0'                           => 'load_dms',
822
-            'EE_Messages_Generator'                        => static function () {
823
-                return EE_Registry::instance()->load_lib(
824
-                    'Messages_Generator',
825
-                    [],
826
-                    false,
827
-                    false
828
-                );
829
-            },
830
-            'EE_Messages_Template_Defaults'                => static function ($arguments = []) {
831
-                return EE_Registry::instance()->load_lib(
832
-                    'Messages_Template_Defaults',
833
-                    $arguments,
834
-                    false,
835
-                    false
836
-                );
837
-            },
838
-            // load_helper
839
-            'EEH_Parse_Shortcodes'                         => static function () {
840
-                if (EE_Registry::instance()->load_helper('Parse_Shortcodes')) {
841
-                    return new EEH_Parse_Shortcodes();
842
-                }
843
-                return null;
844
-            },
845
-            'EE_Template_Config'                           => static function () {
846
-                return EE_Config::instance()->template_settings;
847
-            },
848
-            'EE_Currency_Config'                           => static function () {
849
-                return EE_Config::instance()->currency;
850
-            },
851
-            'EE_Registration_Config'                       => static function () {
852
-                return EE_Config::instance()->registration;
853
-            },
854
-            'EE_Core_Config'                               => static function () {
855
-                return EE_Config::instance()->core;
856
-            },
857
-            'EventEspresso\core\services\loaders\Loader'   => static function () {
858
-                return LoaderFactory::getLoader();
859
-            },
860
-            'EE_Network_Config'                            => static function () {
861
-                return EE_Network_Config::instance();
862
-            },
863
-            'EE_Config'                                    => static function () {
864
-                return EE_Config::instance();
865
-            },
866
-            'EventEspresso\core\domain\Domain'             => static function () {
867
-                return DomainFactory::getEventEspressoCoreDomain();
868
-            },
869
-            'EE_Admin_Config'                              => static function () {
870
-                return EE_Config::instance()->admin;
871
-            },
872
-            'EE_Organization_Config'                       => static function () {
873
-                return EE_Config::instance()->organization;
874
-            },
875
-            'EE_Network_Core_Config'                       => static function () {
876
-                return EE_Network_Config::instance()->core;
877
-            },
878
-            'EE_Environment_Config'                        => static function () {
879
-                return EE_Config::instance()->environment;
880
-            },
881
-            'EED_Core_Rest_Api'                            => static function () {
882
-                return EED_Core_Rest_Api::instance();
883
-            },
884
-            'WP_REST_Server'                               => static function () {
885
-                return rest_get_server();
886
-            },
887
-        ];
888
-    }
889
-
890
-
891
-    /**
892
-     * can be used for supplying alternate names for classes,
893
-     * or for connecting interface names to instantiable classes
894
-     *
895
-     * @throws InvalidAliasException
896
-     */
897
-    protected function _register_core_aliases()
898
-    {
899
-        $aliases = [
900
-            'CommandBusInterface'                                                          => 'EventEspresso\core\services\commands\CommandBusInterface',
901
-            'EventEspresso\core\services\commands\CommandBusInterface'                     => 'EventEspresso\core\services\commands\CommandBus',
902
-            'CommandHandlerManagerInterface'                                               => 'EventEspresso\core\services\commands\CommandHandlerManagerInterface',
903
-            'EventEspresso\core\services\commands\CommandHandlerManagerInterface'          => 'EventEspresso\core\services\commands\CommandHandlerManager',
904
-            'CapChecker'                                                                   => 'EventEspresso\core\services\commands\middleware\CapChecker',
905
-            'AddActionHook'                                                                => 'EventEspresso\core\services\commands\middleware\AddActionHook',
906
-            'CapabilitiesChecker'                                                          => 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker',
907
-            'CapabilitiesCheckerInterface'                                                 => 'EventEspresso\core\domain\services\capabilities\CapabilitiesCheckerInterface',
908
-            'EventEspresso\core\domain\services\capabilities\CapabilitiesCheckerInterface' => 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker',
909
-            'CreateRegistrationService'                                                    => 'EventEspresso\core\domain\services\registration\CreateRegistrationService',
910
-            'CreateRegistrationCommandHandler'                                             => 'EventEspresso\core\services\commands\registration\CreateRegistrationCommand',
911
-            'CopyRegistrationDetailsCommandHandler'                                        => 'EventEspresso\core\services\commands\registration\CopyRegistrationDetailsCommand',
912
-            'CopyRegistrationPaymentsCommandHandler'                                       => 'EventEspresso\core\services\commands\registration\CopyRegistrationPaymentsCommand',
913
-            'CancelRegistrationAndTicketLineItemCommandHandler'                            => 'EventEspresso\core\services\commands\registration\CancelRegistrationAndTicketLineItemCommandHandler',
914
-            'UpdateRegistrationAndTransactionAfterChangeCommandHandler'                    => 'EventEspresso\core\services\commands\registration\UpdateRegistrationAndTransactionAfterChangeCommandHandler',
915
-            'CreateTicketLineItemCommandHandler'                                           => 'EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommand',
916
-            'CreateTransactionCommandHandler'                                              => 'EventEspresso\core\services\commands\transaction\CreateTransactionCommandHandler',
917
-            'CreateAttendeeCommandHandler'                                                 => 'EventEspresso\core\services\commands\attendee\CreateAttendeeCommandHandler',
918
-            'TableManager'                                                                 => 'EventEspresso\core\services\database\TableManager',
919
-            'TableAnalysis'                                                                => 'EventEspresso\core\services\database\TableAnalysis',
920
-            'EspressoShortcode'                                                            => 'EventEspresso\core\services\shortcodes\EspressoShortcode',
921
-            'ShortcodeInterface'                                                           => 'EventEspresso\core\services\shortcodes\ShortcodeInterface',
922
-            'EventEspresso\core\services\shortcodes\ShortcodeInterface'                    => 'EventEspresso\core\services\shortcodes\EspressoShortcode',
923
-            'EventEspresso\core\services\cache\CacheStorageInterface'                      => 'EventEspresso\core\services\cache\TransientCacheStorage',
924
-            'LoaderInterface'                                                              => 'EventEspresso\core\services\loaders\LoaderInterface',
925
-            'EventEspresso\core\services\loaders\LoaderInterface'                          => 'EventEspresso\core\services\loaders\Loader',
926
-            'CommandFactoryInterface'                                                      => 'EventEspresso\core\services\commands\CommandFactoryInterface',
927
-            'EventEspresso\core\services\commands\CommandFactoryInterface'                 => 'EventEspresso\core\services\commands\CommandFactory',
928
-            'EmailValidatorInterface'                                                      => 'EventEspresso\core\domain\services\validation\email\EmailValidatorInterface',
929
-            'EventEspresso\core\domain\services\validation\email\EmailValidatorInterface'  => 'EventEspresso\core\domain\services\validation\email\EmailValidationService',
930
-            'NoticeConverterInterface'                                                     => 'EventEspresso\core\services\notices\NoticeConverterInterface',
931
-            'EventEspresso\core\services\notices\NoticeConverterInterface'                 => 'EventEspresso\core\services\notices\ConvertNoticesToEeErrors',
932
-            'NoticesContainerInterface'                                                    => 'EventEspresso\core\services\notices\NoticesContainerInterface',
933
-            'EventEspresso\core\services\notices\NoticesContainerInterface'                => 'EventEspresso\core\services\notices\NoticesContainer',
934
-            'EventEspresso\core\services\request\RequestInterface'                         => 'EventEspresso\core\services\request\Request',
935
-            'EventEspresso\core\services\request\ResponseInterface'                        => 'EventEspresso\core\services\request\Response',
936
-            'EventEspresso\core\domain\DomainInterface'                                    => 'EventEspresso\core\domain\Domain',
937
-            'Registration_Processor'                                                       => 'EE_Registration_Processor',
938
-        ];
939
-        foreach ($aliases as $alias => $fqn) {
940
-            if (is_array($fqn)) {
941
-                foreach ($fqn as $class => $for_class) {
942
-                    $this->class_cache->addAlias($class, $alias, $for_class);
943
-                }
944
-                continue;
945
-            }
946
-            $this->class_cache->addAlias($fqn, $alias);
947
-        }
948
-        if (! (defined('DOING_AJAX') && DOING_AJAX) && is_admin()) {
949
-            $this->class_cache->addAlias(
950
-                'EventEspresso\core\services\notices\ConvertNoticesToAdminNotices',
951
-                'EventEspresso\core\services\notices\NoticeConverterInterface'
952
-            );
953
-        }
954
-    }
955
-
956
-
957
-    /**
958
-     * This is used to reset the internal map and class_loaders to their original default state at the beginning of the
959
-     * request Primarily used by unit tests.
960
-     */
961
-    public function reset()
962
-    {
963
-        $this->_register_core_class_loaders();
964
-        $this->_register_core_dependencies();
965
-    }
966
-
967
-
968
-    /**
969
-     * PLZ NOTE: a better name for this method would be is_alias()
970
-     * because it returns TRUE if the provided fully qualified name IS an alias
971
-     * WHY?
972
-     * Because if a class is type hinting for a concretion,
973
-     * then why would we need to find another class to supply it?
974
-     * ie: if a class asks for `Fully/Qualified/Namespace/SpecificClassName`,
975
-     * then give it an instance of `Fully/Qualified/Namespace/SpecificClassName`.
976
-     * Don't go looking for some substitute.
977
-     * Whereas if a class is type hinting for an interface...
978
-     * then we need to find an actual class to use.
979
-     * So the interface IS the alias for some other FQN,
980
-     * and we need to find out if `Fully/Qualified/Namespace/SomeInterface`
981
-     * represents some other class.
982
-     *
983
-     * @param string $fqn
984
-     * @param string $for_class
985
-     * @return bool
986
-     * @deprecated 4.9.62.p
987
-     */
988
-    public function has_alias($fqn = '', $for_class = '')
989
-    {
990
-        return $this->isAlias($fqn, $for_class);
991
-    }
992
-
993
-
994
-    /**
995
-     * PLZ NOTE: a better name for this method would be get_fqn_for_alias()
996
-     * because it returns a FQN for provided alias if one exists, otherwise returns the original $alias
997
-     * functions recursively, so that multiple aliases can be used to drill down to a FQN
998
-     *  for example:
999
-     *      if the following two entries were added to the _aliases array:
1000
-     *          array(
1001
-     *              'interface_alias'           => 'some\namespace\interface'
1002
-     *              'some\namespace\interface'  => 'some\namespace\classname'
1003
-     *          )
1004
-     *      then one could use EE_Registry::instance()->create( 'interface_alias' )
1005
-     *      to load an instance of 'some\namespace\classname'
1006
-     *
1007
-     * @param string $alias
1008
-     * @param string $for_class
1009
-     * @return string
1010
-     * @deprecated 4.9.62.p
1011
-     */
1012
-    public function get_alias($alias = '', $for_class = '')
1013
-    {
1014
-        return $this->getFqnForAlias($alias, $for_class);
1015
-    }
24
+	/**
25
+	 * This means that the requested class dependency is not present in the dependency map
26
+	 */
27
+	const not_registered = 0;
28
+
29
+	/**
30
+	 * This instructs class loaders to ALWAYS return a newly instantiated object for the requested class.
31
+	 */
32
+	const load_new_object = 1;
33
+
34
+	/**
35
+	 * This instructs class loaders to return a previously instantiated and cached object for the requested class.
36
+	 * IF a previously instantiated object does not exist, a new one will be created and added to the cache.
37
+	 */
38
+	const load_from_cache = 2;
39
+
40
+	/**
41
+	 * When registering a dependency,
42
+	 * this indicates to keep any existing dependencies that already exist,
43
+	 * and simply discard any new dependencies declared in the incoming data
44
+	 */
45
+	const KEEP_EXISTING_DEPENDENCIES = 0;
46
+
47
+	/**
48
+	 * When registering a dependency,
49
+	 * this indicates to overwrite any existing dependencies that already exist using the incoming data
50
+	 */
51
+	const OVERWRITE_DEPENDENCIES = 1;
52
+
53
+	/**
54
+	 * @type EE_Dependency_Map $_instance
55
+	 */
56
+	protected static $_instance;
57
+
58
+	/**
59
+	 * @var ClassInterfaceCache $class_cache
60
+	 */
61
+	private $class_cache;
62
+
63
+	/**
64
+	 * @type RequestInterface $request
65
+	 */
66
+	protected $request;
67
+
68
+	/**
69
+	 * @type LegacyRequestInterface $legacy_request
70
+	 */
71
+	protected $legacy_request;
72
+
73
+	/**
74
+	 * @type ResponseInterface $response
75
+	 */
76
+	protected $response;
77
+
78
+	/**
79
+	 * @type LoaderInterface $loader
80
+	 */
81
+	protected $loader;
82
+
83
+	/**
84
+	 * @type array $_dependency_map
85
+	 */
86
+	protected $_dependency_map = [];
87
+
88
+	/**
89
+	 * @type array $_class_loaders
90
+	 */
91
+	protected $_class_loaders = [];
92
+
93
+
94
+	/**
95
+	 * EE_Dependency_Map constructor.
96
+	 *
97
+	 * @param ClassInterfaceCache $class_cache
98
+	 */
99
+	protected function __construct(ClassInterfaceCache $class_cache)
100
+	{
101
+		$this->class_cache = $class_cache;
102
+		do_action('EE_Dependency_Map____construct', $this);
103
+	}
104
+
105
+
106
+	/**
107
+	 * @return void
108
+	 * @throws InvalidAliasException
109
+	 */
110
+	public function initialize()
111
+	{
112
+		$this->_register_core_dependencies();
113
+		$this->_register_core_class_loaders();
114
+		$this->_register_core_aliases();
115
+	}
116
+
117
+
118
+	/**
119
+	 * @singleton method used to instantiate class object
120
+	 * @param ClassInterfaceCache|null $class_cache
121
+	 * @return EE_Dependency_Map
122
+	 */
123
+	public static function instance(ClassInterfaceCache $class_cache = null)
124
+	{
125
+		// check if class object is instantiated, and instantiated properly
126
+		if (! EE_Dependency_Map::$_instance instanceof EE_Dependency_Map
127
+			&& $class_cache instanceof ClassInterfaceCache
128
+		) {
129
+			EE_Dependency_Map::$_instance = new EE_Dependency_Map($class_cache);
130
+		}
131
+		return EE_Dependency_Map::$_instance;
132
+	}
133
+
134
+
135
+	/**
136
+	 * @param RequestInterface $request
137
+	 */
138
+	public function setRequest(RequestInterface $request)
139
+	{
140
+		$this->request = $request;
141
+	}
142
+
143
+
144
+	/**
145
+	 * @param LegacyRequestInterface $legacy_request
146
+	 */
147
+	public function setLegacyRequest(LegacyRequestInterface $legacy_request)
148
+	{
149
+		$this->legacy_request = $legacy_request;
150
+	}
151
+
152
+
153
+	/**
154
+	 * @param ResponseInterface $response
155
+	 */
156
+	public function setResponse(ResponseInterface $response)
157
+	{
158
+		$this->response = $response;
159
+	}
160
+
161
+
162
+	/**
163
+	 * @param LoaderInterface $loader
164
+	 */
165
+	public function setLoader(LoaderInterface $loader)
166
+	{
167
+		$this->loader = $loader;
168
+	}
169
+
170
+
171
+	/**
172
+	 * @param string $class
173
+	 * @param array  $dependencies
174
+	 * @param int    $overwrite
175
+	 * @return bool
176
+	 */
177
+	public static function register_dependencies(
178
+		$class,
179
+		array $dependencies,
180
+		$overwrite = EE_Dependency_Map::KEEP_EXISTING_DEPENDENCIES
181
+	) {
182
+		return EE_Dependency_Map::$_instance->registerDependencies($class, $dependencies, $overwrite);
183
+	}
184
+
185
+
186
+	/**
187
+	 * Assigns an array of class names and corresponding load sources (new or cached)
188
+	 * to the class specified by the first parameter.
189
+	 * IMPORTANT !!!
190
+	 * The order of elements in the incoming $dependencies array MUST match
191
+	 * the order of the constructor parameters for the class in question.
192
+	 * This is especially important when overriding any existing dependencies that are registered.
193
+	 * the third parameter controls whether any duplicate dependencies are overwritten or not.
194
+	 *
195
+	 * @param string $class
196
+	 * @param array  $dependencies
197
+	 * @param int    $overwrite
198
+	 * @return bool
199
+	 */
200
+	public function registerDependencies(
201
+		$class,
202
+		array $dependencies,
203
+		$overwrite = EE_Dependency_Map::KEEP_EXISTING_DEPENDENCIES
204
+	) {
205
+		$class = trim($class, '\\');
206
+		$registered = false;
207
+		if (empty(EE_Dependency_Map::$_instance->_dependency_map[ $class ])) {
208
+			EE_Dependency_Map::$_instance->_dependency_map[ $class ] = [];
209
+		}
210
+		// we need to make sure that any aliases used when registering a dependency
211
+		// get resolved to the correct class name
212
+		foreach ($dependencies as $dependency => $load_source) {
213
+			$alias = EE_Dependency_Map::$_instance->getFqnForAlias($dependency);
214
+			if ($overwrite === EE_Dependency_Map::OVERWRITE_DEPENDENCIES
215
+				|| ! isset(EE_Dependency_Map::$_instance->_dependency_map[ $class ][ $alias ])
216
+			) {
217
+				unset($dependencies[ $dependency ]);
218
+				$dependencies[ $alias ] = $load_source;
219
+				$registered = true;
220
+			}
221
+		}
222
+		// now add our two lists of dependencies together.
223
+		// using Union (+=) favours the arrays in precedence from left to right,
224
+		// so $dependencies is NOT overwritten because it is listed first
225
+		// ie: with A = B + C, entries in B take precedence over duplicate entries in C
226
+		// Union is way faster than array_merge() but should be used with caution...
227
+		// especially with numerically indexed arrays
228
+		$dependencies += EE_Dependency_Map::$_instance->_dependency_map[ $class ];
229
+		// now we need to ensure that the resulting dependencies
230
+		// array only has the entries that are required for the class
231
+		// so first count how many dependencies were originally registered for the class
232
+		$dependency_count = count(EE_Dependency_Map::$_instance->_dependency_map[ $class ]);
233
+		// if that count is non-zero (meaning dependencies were already registered)
234
+		EE_Dependency_Map::$_instance->_dependency_map[ $class ] = $dependency_count
235
+			// then truncate the  final array to match that count
236
+			? array_slice($dependencies, 0, $dependency_count)
237
+			// otherwise just take the incoming array because nothing previously existed
238
+			: $dependencies;
239
+		return $registered;
240
+	}
241
+
242
+
243
+	/**
244
+	 * @param string $class_name
245
+	 * @param string $loader
246
+	 * @return bool
247
+	 * @throws DomainException
248
+	 */
249
+	public static function register_class_loader($class_name, $loader = 'load_core')
250
+	{
251
+		return EE_Dependency_Map::$_instance->registerClassLoader($class_name, $loader);
252
+	}
253
+
254
+
255
+	/**
256
+	 * @param string $class_name
257
+	 * @param string $loader
258
+	 * @return bool
259
+	 * @throws DomainException
260
+	 */
261
+	public function registerClassLoader($class_name, $loader = 'load_core')
262
+	{
263
+		if (! $loader instanceof Closure && strpos($class_name, '\\') !== false) {
264
+			throw new DomainException(
265
+				esc_html__('Don\'t use class loaders for FQCNs.', 'event_espresso')
266
+			);
267
+		}
268
+		// check that loader is callable or method starts with "load_" and exists in EE_Registry
269
+		if (! is_callable($loader)
270
+			&& (
271
+				strpos($loader, 'load_') !== 0
272
+				|| ! method_exists('EE_Registry', $loader)
273
+			)
274
+		) {
275
+			throw new DomainException(
276
+				sprintf(
277
+					esc_html__(
278
+						'"%1$s" is not a valid loader method on EE_Registry.',
279
+						'event_espresso'
280
+					),
281
+					$loader
282
+				)
283
+			);
284
+		}
285
+		$class_name = EE_Dependency_Map::$_instance->getFqnForAlias($class_name);
286
+		if (! isset(EE_Dependency_Map::$_instance->_class_loaders[ $class_name ])) {
287
+			EE_Dependency_Map::$_instance->_class_loaders[ $class_name ] = $loader;
288
+			return true;
289
+		}
290
+		return false;
291
+	}
292
+
293
+
294
+	/**
295
+	 * @return array
296
+	 */
297
+	public function dependency_map()
298
+	{
299
+		return $this->_dependency_map;
300
+	}
301
+
302
+
303
+	/**
304
+	 * returns TRUE if dependency map contains a listing for the provided class name
305
+	 *
306
+	 * @param string $class_name
307
+	 * @return boolean
308
+	 */
309
+	public function has($class_name = '')
310
+	{
311
+		// all legacy models have the same dependencies
312
+		if (strpos($class_name, 'EEM_') === 0) {
313
+			$class_name = 'LEGACY_MODELS';
314
+		}
315
+		return isset($this->_dependency_map[ $class_name ]);
316
+	}
317
+
318
+
319
+	/**
320
+	 * returns TRUE if dependency map contains a listing for the provided class name AND dependency
321
+	 *
322
+	 * @param string $class_name
323
+	 * @param string $dependency
324
+	 * @return bool
325
+	 */
326
+	public function has_dependency_for_class($class_name = '', $dependency = '')
327
+	{
328
+		// all legacy models have the same dependencies
329
+		if (strpos($class_name, 'EEM_') === 0) {
330
+			$class_name = 'LEGACY_MODELS';
331
+		}
332
+		$dependency = $this->getFqnForAlias($dependency, $class_name);
333
+		return isset($this->_dependency_map[ $class_name ][ $dependency ]);
334
+	}
335
+
336
+
337
+	/**
338
+	 * returns loading strategy for whether a previously cached dependency should be loaded or a new instance returned
339
+	 *
340
+	 * @param string $class_name
341
+	 * @param string $dependency
342
+	 * @return int
343
+	 */
344
+	public function loading_strategy_for_class_dependency($class_name = '', $dependency = '')
345
+	{
346
+		// all legacy models have the same dependencies
347
+		if (strpos($class_name, 'EEM_') === 0) {
348
+			$class_name = 'LEGACY_MODELS';
349
+		}
350
+		$dependency = $this->getFqnForAlias($dependency);
351
+		return $this->has_dependency_for_class($class_name, $dependency)
352
+			? $this->_dependency_map[ $class_name ][ $dependency ]
353
+			: EE_Dependency_Map::not_registered;
354
+	}
355
+
356
+
357
+	/**
358
+	 * @param string $class_name
359
+	 * @return string | Closure
360
+	 */
361
+	public function class_loader($class_name)
362
+	{
363
+		// all legacy models use load_model()
364
+		if (strpos($class_name, 'EEM_') === 0) {
365
+			return 'load_model';
366
+		}
367
+		// EE_CPT_*_Strategy classes like EE_CPT_Event_Strategy, EE_CPT_Venue_Strategy, etc
368
+		// perform strpos() first to avoid loading regex every time we load a class
369
+		if (strpos($class_name, 'EE_CPT_') === 0
370
+			&& preg_match('/^EE_CPT_([a-zA-Z]+)_Strategy$/', $class_name)
371
+		) {
372
+			return 'load_core';
373
+		}
374
+		$class_name = $this->getFqnForAlias($class_name);
375
+		return isset($this->_class_loaders[ $class_name ]) ? $this->_class_loaders[ $class_name ] : '';
376
+	}
377
+
378
+
379
+	/**
380
+	 * @return array
381
+	 */
382
+	public function class_loaders()
383
+	{
384
+		return $this->_class_loaders;
385
+	}
386
+
387
+
388
+	/**
389
+	 * adds an alias for a classname
390
+	 *
391
+	 * @param string $fqcn      the class name that should be used (concrete class to replace interface)
392
+	 * @param string $alias     the class name that would be type hinted for (abstract parent or interface)
393
+	 * @param string $for_class the class that has the dependency (is type hinting for the interface)
394
+	 * @throws InvalidAliasException
395
+	 */
396
+	public function add_alias($fqcn, $alias, $for_class = '')
397
+	{
398
+		$this->class_cache->addAlias($fqcn, $alias, $for_class);
399
+	}
400
+
401
+
402
+	/**
403
+	 * Returns TRUE if the provided fully qualified name IS an alias
404
+	 * WHY?
405
+	 * Because if a class is type hinting for a concretion,
406
+	 * then why would we need to find another class to supply it?
407
+	 * ie: if a class asks for `Fully/Qualified/Namespace/SpecificClassName`,
408
+	 * then give it an instance of `Fully/Qualified/Namespace/SpecificClassName`.
409
+	 * Don't go looking for some substitute.
410
+	 * Whereas if a class is type hinting for an interface...
411
+	 * then we need to find an actual class to use.
412
+	 * So the interface IS the alias for some other FQN,
413
+	 * and we need to find out if `Fully/Qualified/Namespace/SomeInterface`
414
+	 * represents some other class.
415
+	 *
416
+	 * @param string $fqn
417
+	 * @param string $for_class
418
+	 * @return bool
419
+	 */
420
+	public function isAlias($fqn = '', $for_class = '')
421
+	{
422
+		return $this->class_cache->isAlias($fqn, $for_class);
423
+	}
424
+
425
+
426
+	/**
427
+	 * Returns a FQN for provided alias if one exists, otherwise returns the original $alias
428
+	 * functions recursively, so that multiple aliases can be used to drill down to a FQN
429
+	 *  for example:
430
+	 *      if the following two entries were added to the _aliases array:
431
+	 *          array(
432
+	 *              'interface_alias'           => 'some\namespace\interface'
433
+	 *              'some\namespace\interface'  => 'some\namespace\classname'
434
+	 *          )
435
+	 *      then one could use EE_Registry::instance()->create( 'interface_alias' )
436
+	 *      to load an instance of 'some\namespace\classname'
437
+	 *
438
+	 * @param string $alias
439
+	 * @param string $for_class
440
+	 * @return string
441
+	 */
442
+	public function getFqnForAlias($alias = '', $for_class = '')
443
+	{
444
+		return (string) $this->class_cache->getFqnForAlias($alias, $for_class);
445
+	}
446
+
447
+
448
+	/**
449
+	 * Registers the core dependencies and whether a previously instantiated object should be loaded from the cache,
450
+	 * if one exists, or whether a new object should be generated every time the requested class is loaded.
451
+	 * This is done by using the following class constants:
452
+	 *        EE_Dependency_Map::load_from_cache - loads previously instantiated object
453
+	 *        EE_Dependency_Map::load_new_object - generates a new object every time
454
+	 */
455
+	protected function _register_core_dependencies()
456
+	{
457
+		$this->_dependency_map = [
458
+			'EE_Request_Handler'                                                                                          => [
459
+				'EE_Request' => EE_Dependency_Map::load_from_cache,
460
+			],
461
+			'EE_System'                                                                                                   => [
462
+				'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
463
+				'EE_Maintenance_Mode'                         => EE_Dependency_Map::load_from_cache,
464
+				'EE_Registry'                                 => EE_Dependency_Map::load_from_cache,
465
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
466
+				'EventEspresso\core\services\routing\Router'  => EE_Dependency_Map::load_from_cache,
467
+			],
468
+			'EE_Admin'                                                                                                    => [
469
+				'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
470
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
471
+			],
472
+			'EE_Cart'                                                                                                     => [
473
+				'EE_Session' => EE_Dependency_Map::load_from_cache,
474
+			],
475
+			'EE_Messenger_Collection_Loader'                                                                              => [
476
+				'EE_Messenger_Collection' => EE_Dependency_Map::load_new_object,
477
+			],
478
+			'EE_Message_Type_Collection_Loader'                                                                           => [
479
+				'EE_Message_Type_Collection' => EE_Dependency_Map::load_new_object,
480
+			],
481
+			'EE_Message_Resource_Manager'                                                                                 => [
482
+				'EE_Messenger_Collection_Loader'    => EE_Dependency_Map::load_new_object,
483
+				'EE_Message_Type_Collection_Loader' => EE_Dependency_Map::load_new_object,
484
+				'EEM_Message_Template_Group'        => EE_Dependency_Map::load_from_cache,
485
+			],
486
+			'EE_Message_Factory'                                                                                          => [
487
+				'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
488
+			],
489
+			'EE_messages'                                                                                                 => [
490
+				'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
491
+			],
492
+			'EE_Messages_Generator'                                                                                       => [
493
+				'EE_Messages_Queue'                    => EE_Dependency_Map::load_new_object,
494
+				'EE_Messages_Data_Handler_Collection'  => EE_Dependency_Map::load_new_object,
495
+				'EE_Message_Template_Group_Collection' => EE_Dependency_Map::load_new_object,
496
+				'EEH_Parse_Shortcodes'                 => EE_Dependency_Map::load_from_cache,
497
+			],
498
+			'EE_Messages_Processor'                                                                                       => [
499
+				'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
500
+			],
501
+			'EE_Messages_Queue'                                                                                           => [
502
+				'EE_Message_Repository' => EE_Dependency_Map::load_new_object,
503
+			],
504
+			'EE_Messages_Template_Defaults'                                                                               => [
505
+				'EEM_Message_Template_Group' => EE_Dependency_Map::load_from_cache,
506
+				'EEM_Message_Template'       => EE_Dependency_Map::load_from_cache,
507
+			],
508
+			'EE_Message_To_Generate_From_Request'                                                                         => [
509
+				'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
510
+				'EE_Request_Handler'          => EE_Dependency_Map::load_from_cache,
511
+			],
512
+			'EventEspresso\core\services\commands\CommandBus'                                                             => [
513
+				'EventEspresso\core\services\commands\CommandHandlerManager' => EE_Dependency_Map::load_from_cache,
514
+			],
515
+			'EventEspresso\services\commands\CommandHandler'                                                              => [
516
+				'EE_Registry'         => EE_Dependency_Map::load_from_cache,
517
+				'CommandBusInterface' => EE_Dependency_Map::load_from_cache,
518
+			],
519
+			'EventEspresso\core\services\commands\CommandHandlerManager'                                                  => [
520
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
521
+			],
522
+			'EventEspresso\core\services\commands\CompositeCommandHandler'                                                => [
523
+				'EventEspresso\core\services\commands\CommandBus'     => EE_Dependency_Map::load_from_cache,
524
+				'EventEspresso\core\services\commands\CommandFactory' => EE_Dependency_Map::load_from_cache,
525
+			],
526
+			'EventEspresso\core\services\commands\CommandFactory'                                                         => [
527
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
528
+			],
529
+			'EventEspresso\core\services\commands\middleware\CapChecker'                                                  => [
530
+				'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache,
531
+			],
532
+			'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker'                                         => [
533
+				'EE_Capabilities' => EE_Dependency_Map::load_from_cache,
534
+			],
535
+			'EventEspresso\core\domain\services\capabilities\RegistrationsCapChecker'                                     => [
536
+				'EE_Capabilities' => EE_Dependency_Map::load_from_cache,
537
+			],
538
+			'EventEspresso\core\services\commands\registration\CreateRegistrationCommandHandler'                          => [
539
+				'EventEspresso\core\domain\services\registration\CreateRegistrationService' => EE_Dependency_Map::load_from_cache,
540
+			],
541
+			'EventEspresso\core\services\commands\registration\CopyRegistrationDetailsCommandHandler'                     => [
542
+				'EventEspresso\core\domain\services\registration\CopyRegistrationService' => EE_Dependency_Map::load_from_cache,
543
+			],
544
+			'EventEspresso\core\services\commands\registration\CopyRegistrationPaymentsCommandHandler'                    => [
545
+				'EventEspresso\core\domain\services\registration\CopyRegistrationService' => EE_Dependency_Map::load_from_cache,
546
+			],
547
+			'EventEspresso\core\services\commands\registration\CancelRegistrationAndTicketLineItemCommandHandler'         => [
548
+				'EventEspresso\core\domain\services\registration\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
549
+			],
550
+			'EventEspresso\core\services\commands\registration\UpdateRegistrationAndTransactionAfterChangeCommandHandler' => [
551
+				'EventEspresso\core\domain\services\registration\UpdateRegistrationService' => EE_Dependency_Map::load_from_cache,
552
+			],
553
+			'EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommandHandler'                              => [
554
+				'EventEspresso\core\domain\services\ticket\CreateTicketLineItemService' => EE_Dependency_Map::load_from_cache,
555
+			],
556
+			'EventEspresso\core\services\commands\ticket\CancelTicketLineItemCommandHandler'                              => [
557
+				'EventEspresso\core\domain\services\ticket\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
558
+			],
559
+			'EventEspresso\core\domain\services\registration\CancelRegistrationService'                                   => [
560
+				'EventEspresso\core\domain\services\ticket\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
561
+			],
562
+			'EventEspresso\core\services\commands\attendee\CreateAttendeeCommandHandler'                                  => [
563
+				'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
564
+			],
565
+			'EventEspresso\core\services\database\TableManager'                                                           => [
566
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
567
+			],
568
+			'EE_Data_Migration_Class_Base'                                                                                => [
569
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
570
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
571
+			],
572
+			'EE_DMS_Core_4_1_0'                                                                                           => [
573
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
574
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
575
+			],
576
+			'EE_DMS_Core_4_2_0'                                                                                           => [
577
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
578
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
579
+			],
580
+			'EE_DMS_Core_4_3_0'                                                                                           => [
581
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
582
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
583
+			],
584
+			'EE_DMS_Core_4_4_0'                                                                                           => [
585
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
586
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
587
+			],
588
+			'EE_DMS_Core_4_5_0'                                                                                           => [
589
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
590
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
591
+			],
592
+			'EE_DMS_Core_4_6_0'                                                                                           => [
593
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
594
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
595
+			],
596
+			'EE_DMS_Core_4_7_0'                                                                                           => [
597
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
598
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
599
+			],
600
+			'EE_DMS_Core_4_8_0'                                                                                           => [
601
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
602
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
603
+			],
604
+			'EE_DMS_Core_4_9_0'                                                                                           => [
605
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
606
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
607
+			],
608
+			'EE_DMS_Core_4_10_0'                                                                                          => [
609
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
610
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
611
+				'EE_DMS_Core_4_9_0'                                  => EE_Dependency_Map::load_from_cache,
612
+			],
613
+			'EventEspresso\core\services\assets\I18nRegistry'                                                             => [
614
+				'EventEspresso\core\domain\Domain'                 => EE_Dependency_Map::load_from_cache,
615
+				'EventEspresso\core\services\assets\JedLocaleData' => EE_Dependency_Map::load_from_cache,
616
+				[],
617
+			],
618
+			'EventEspresso\core\services\assets\Registry'                                                                 => [
619
+				'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_new_object,
620
+				'EventEspresso\core\services\assets\AssetManifest'   => EE_Dependency_Map::load_from_cache,
621
+				'EventEspresso\core\services\assets\I18nRegistry'    => EE_Dependency_Map::load_from_cache,
622
+			],
623
+			'EventEspresso\core\services\cache\BasicCacheManager'                                                         => [
624
+				'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache,
625
+			],
626
+			'EventEspresso\core\services\cache\PostRelatedCacheManager'                                                   => [
627
+				'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache,
628
+			],
629
+			'EventEspresso\core\domain\services\validation\email\EmailValidationService'                                  => [
630
+				'EE_Registration_Config'                     => EE_Dependency_Map::load_from_cache,
631
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
632
+			],
633
+			'EventEspresso\core\domain\values\EmailAddress'                                                               => [
634
+				null,
635
+				'EventEspresso\core\domain\services\validation\email\EmailValidationService' => EE_Dependency_Map::load_from_cache,
636
+			],
637
+			'EventEspresso\core\services\orm\ModelFieldFactory'                                                           => [
638
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
639
+			],
640
+			'LEGACY_MODELS'                                                                                               => [
641
+				null,
642
+				'EventEspresso\core\services\database\ModelFieldFactory' => EE_Dependency_Map::load_from_cache,
643
+			],
644
+			'EE_Module_Request_Router'                                                                                    => [
645
+				'EE_Request' => EE_Dependency_Map::load_from_cache,
646
+			],
647
+			'EE_Registration_Processor'                                                                                   => [
648
+				'EE_Request' => EE_Dependency_Map::load_from_cache,
649
+			],
650
+			'EventEspresso\core\services\notifications\PersistentAdminNoticeManager'                                      => [
651
+				null,
652
+				'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache,
653
+				'EventEspresso\core\services\request\Request'                         => EE_Dependency_Map::load_from_cache,
654
+			],
655
+			'EventEspresso\caffeinated\modules\recaptcha_invisible\InvisibleRecaptcha'                                    => [
656
+				'EE_Registration_Config' => EE_Dependency_Map::load_from_cache,
657
+				'EE_Session'             => EE_Dependency_Map::load_from_cache,
658
+			],
659
+			'EventEspresso\modules\ticket_selector\ProcessTicketSelector'                                                 => [
660
+				'EE_Core_Config'                                                          => EE_Dependency_Map::load_from_cache,
661
+				'EventEspresso\core\services\request\Request'                             => EE_Dependency_Map::load_from_cache,
662
+				'EE_Session'                                                              => EE_Dependency_Map::load_from_cache,
663
+				'EEM_Ticket'                                                              => EE_Dependency_Map::load_from_cache,
664
+				'EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker' => EE_Dependency_Map::load_from_cache,
665
+			],
666
+			'EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker'                                     => [
667
+				'EEM_Datetime' => EE_Dependency_Map::load_from_cache,
668
+			],
669
+			'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions'                              => [
670
+				'EE_Core_Config'                             => EE_Dependency_Map::load_from_cache,
671
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
672
+			],
673
+			'EventEspresso\core\domain\services\custom_post_types\RegisterCustomPostTypes'                                => [
674
+				'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => EE_Dependency_Map::load_from_cache,
675
+			],
676
+			'EventEspresso\core\domain\services\custom_post_types\RegisterCustomTaxonomies'                               => [
677
+				'EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions' => EE_Dependency_Map::load_from_cache,
678
+			],
679
+			'EE_CPT_Strategy'                                                                                             => [
680
+				'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => EE_Dependency_Map::load_from_cache,
681
+				'EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions' => EE_Dependency_Map::load_from_cache,
682
+			],
683
+			'EventEspresso\core\services\loaders\ObjectIdentifier'                                                        => [
684
+				'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache,
685
+			],
686
+			'EventEspresso\core\CPTs\CptQueryModifier'                                                                    => [
687
+				null,
688
+				null,
689
+				null,
690
+				'EE_Request_Handler'                          => EE_Dependency_Map::load_from_cache,
691
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
692
+				'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
693
+			],
694
+			'EventEspresso\core\services\dependencies\DependencyResolver'                                                 => [
695
+				'EventEspresso\core\services\container\Mirror'            => EE_Dependency_Map::load_from_cache,
696
+				'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache,
697
+				'EE_Dependency_Map'                                       => EE_Dependency_Map::load_from_cache,
698
+			],
699
+			'EventEspresso\core\services\routing\RouteMatchSpecificationDependencyResolver'                               => [
700
+				'EventEspresso\core\services\container\Mirror'            => EE_Dependency_Map::load_from_cache,
701
+				'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache,
702
+				'EE_Dependency_Map'                                       => EE_Dependency_Map::load_from_cache,
703
+			],
704
+			'EventEspresso\core\services\routing\RouteMatchSpecificationFactory'                                          => [
705
+				'EventEspresso\core\services\routing\RouteMatchSpecificationDependencyResolver' => EE_Dependency_Map::load_from_cache,
706
+				'EventEspresso\core\services\loaders\Loader'                                    => EE_Dependency_Map::load_from_cache,
707
+			],
708
+			'EventEspresso\core\services\routing\RouteMatchSpecificationManager'                                          => [
709
+				'EventEspresso\core\services\routing\RouteMatchSpecificationCollection' => EE_Dependency_Map::load_from_cache,
710
+				'EventEspresso\core\services\routing\RouteMatchSpecificationFactory'    => EE_Dependency_Map::load_from_cache,
711
+			],
712
+			'EE_URL_Validation_Strategy'                                                                                  => [
713
+				null,
714
+				null,
715
+				'EventEspresso\core\services\validators\URLValidator' => EE_Dependency_Map::load_from_cache,
716
+			],
717
+			'EventEspresso\core\services\request\files\FilesDataHandler'                                                  => [
718
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
719
+			],
720
+			'EventEspressoBatchRequest\BatchRequestProcessor'                                                             => [
721
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
722
+			],
723
+			'EventEspresso\core\domain\services\converters\RestApiSpoofer'                                                => [
724
+				'WP_REST_Server'                                               => EE_Dependency_Map::load_from_cache,
725
+				'EED_Core_Rest_Api'                                            => EE_Dependency_Map::load_from_cache,
726
+				'EventEspresso\core\libraries\rest_api\controllers\model\Read' => EE_Dependency_Map::load_from_cache,
727
+				null,
728
+			],
729
+			'EventEspresso\core\services\routing\RouteHandler'                                                            => [
730
+				'EventEspresso\core\services\json\JsonDataNodeHandler' => EE_Dependency_Map::load_from_cache,
731
+				'EventEspresso\core\services\loaders\Loader'           => EE_Dependency_Map::load_from_cache,
732
+				'EventEspresso\core\services\request\Request'          => EE_Dependency_Map::load_from_cache,
733
+				'EventEspresso\core\services\routing\RouteCollection'  => EE_Dependency_Map::load_from_cache,
734
+			],
735
+			'EventEspresso\core\services\json\JsonDataNodeHandler'                                                        => [
736
+				'EventEspresso\core\services\json\JsonDataNodeValidator' => EE_Dependency_Map::load_from_cache,
737
+			],
738
+			'EventEspresso\core\services\routing\Router'                                                                  => [
739
+				'EE_Dependency_Map'                                => EE_Dependency_Map::load_from_cache,
740
+				'EventEspresso\core\services\loaders\Loader'       => EE_Dependency_Map::load_from_cache,
741
+				'EventEspresso\core\services\routing\RouteHandler' => EE_Dependency_Map::load_from_cache,
742
+			],
743
+			'EventEspresso\core\services\assets\Barista' => [
744
+				'EventEspresso\core\services\assets\AssetManifest' => EE_Dependency_Map::load_from_cache,
745
+			],
746
+			'EventEspresso\core\services\assets\AssetManifest' => [
747
+				'EventEspresso\core\domain\Domain'                 => EE_Dependency_Map::load_from_cache,
748
+			],
749
+		];
750
+	}
751
+
752
+
753
+	/**
754
+	 * Registers how core classes are loaded.
755
+	 * This can either be done by simply providing the name of one of the EE_Registry loader methods such as:
756
+	 *        'EE_Request_Handler' => 'load_core'
757
+	 *        'EE_Messages_Queue'  => 'load_lib'
758
+	 *        'EEH_Debug_Tools'    => 'load_helper'
759
+	 * or, if greater control is required, by providing a custom closure. For example:
760
+	 *        'Some_Class' => function () {
761
+	 *            return new Some_Class();
762
+	 *        },
763
+	 * This is required for instantiating dependencies
764
+	 * where an interface has been type hinted in a class constructor. For example:
765
+	 *        'Required_Interface' => function () {
766
+	 *            return new A_Class_That_Implements_Required_Interface();
767
+	 *        },
768
+	 */
769
+	protected function _register_core_class_loaders()
770
+	{
771
+		$this->_class_loaders = [
772
+			// load_core
773
+			'EE_Dependency_Map'                            => function () {
774
+				return $this;
775
+			},
776
+			'EE_Capabilities'                              => 'load_core',
777
+			'EE_Encryption'                                => 'load_core',
778
+			'EE_Front_Controller'                          => 'load_core',
779
+			'EE_Module_Request_Router'                     => 'load_core',
780
+			'EE_Registry'                                  => 'load_core',
781
+			'EE_Request'                                   => function () {
782
+				return $this->legacy_request;
783
+			},
784
+			'EventEspresso\core\services\request\Request'  => function () {
785
+				return $this->request;
786
+			},
787
+			'EventEspresso\core\services\request\Response' => function () {
788
+				return $this->response;
789
+			},
790
+			'EE_Base'                                      => 'load_core',
791
+			'EE_Request_Handler'                           => 'load_core',
792
+			'EE_Session'                                   => 'load_core',
793
+			'EE_Cron_Tasks'                                => 'load_core',
794
+			'EE_System'                                    => 'load_core',
795
+			'EE_Maintenance_Mode'                          => 'load_core',
796
+			'EE_Register_CPTs'                             => 'load_core',
797
+			'EE_Admin'                                     => 'load_core',
798
+			'EE_CPT_Strategy'                              => 'load_core',
799
+			// load_class
800
+			'EE_Registration_Processor'                    => 'load_class',
801
+			// load_lib
802
+			'EE_Message_Resource_Manager'                  => 'load_lib',
803
+			'EE_Message_Type_Collection'                   => 'load_lib',
804
+			'EE_Message_Type_Collection_Loader'            => 'load_lib',
805
+			'EE_Messenger_Collection'                      => 'load_lib',
806
+			'EE_Messenger_Collection_Loader'               => 'load_lib',
807
+			'EE_Messages_Processor'                        => 'load_lib',
808
+			'EE_Message_Repository'                        => 'load_lib',
809
+			'EE_Messages_Queue'                            => 'load_lib',
810
+			'EE_Messages_Data_Handler_Collection'          => 'load_lib',
811
+			'EE_Message_Template_Group_Collection'         => 'load_lib',
812
+			'EE_Payment_Method_Manager'                    => 'load_lib',
813
+			'EE_DMS_Core_4_1_0'                            => 'load_dms',
814
+			'EE_DMS_Core_4_2_0'                            => 'load_dms',
815
+			'EE_DMS_Core_4_3_0'                            => 'load_dms',
816
+			'EE_DMS_Core_4_5_0'                            => 'load_dms',
817
+			'EE_DMS_Core_4_6_0'                            => 'load_dms',
818
+			'EE_DMS_Core_4_7_0'                            => 'load_dms',
819
+			'EE_DMS_Core_4_8_0'                            => 'load_dms',
820
+			'EE_DMS_Core_4_9_0'                            => 'load_dms',
821
+			'EE_DMS_Core_4_10_0'                           => 'load_dms',
822
+			'EE_Messages_Generator'                        => static function () {
823
+				return EE_Registry::instance()->load_lib(
824
+					'Messages_Generator',
825
+					[],
826
+					false,
827
+					false
828
+				);
829
+			},
830
+			'EE_Messages_Template_Defaults'                => static function ($arguments = []) {
831
+				return EE_Registry::instance()->load_lib(
832
+					'Messages_Template_Defaults',
833
+					$arguments,
834
+					false,
835
+					false
836
+				);
837
+			},
838
+			// load_helper
839
+			'EEH_Parse_Shortcodes'                         => static function () {
840
+				if (EE_Registry::instance()->load_helper('Parse_Shortcodes')) {
841
+					return new EEH_Parse_Shortcodes();
842
+				}
843
+				return null;
844
+			},
845
+			'EE_Template_Config'                           => static function () {
846
+				return EE_Config::instance()->template_settings;
847
+			},
848
+			'EE_Currency_Config'                           => static function () {
849
+				return EE_Config::instance()->currency;
850
+			},
851
+			'EE_Registration_Config'                       => static function () {
852
+				return EE_Config::instance()->registration;
853
+			},
854
+			'EE_Core_Config'                               => static function () {
855
+				return EE_Config::instance()->core;
856
+			},
857
+			'EventEspresso\core\services\loaders\Loader'   => static function () {
858
+				return LoaderFactory::getLoader();
859
+			},
860
+			'EE_Network_Config'                            => static function () {
861
+				return EE_Network_Config::instance();
862
+			},
863
+			'EE_Config'                                    => static function () {
864
+				return EE_Config::instance();
865
+			},
866
+			'EventEspresso\core\domain\Domain'             => static function () {
867
+				return DomainFactory::getEventEspressoCoreDomain();
868
+			},
869
+			'EE_Admin_Config'                              => static function () {
870
+				return EE_Config::instance()->admin;
871
+			},
872
+			'EE_Organization_Config'                       => static function () {
873
+				return EE_Config::instance()->organization;
874
+			},
875
+			'EE_Network_Core_Config'                       => static function () {
876
+				return EE_Network_Config::instance()->core;
877
+			},
878
+			'EE_Environment_Config'                        => static function () {
879
+				return EE_Config::instance()->environment;
880
+			},
881
+			'EED_Core_Rest_Api'                            => static function () {
882
+				return EED_Core_Rest_Api::instance();
883
+			},
884
+			'WP_REST_Server'                               => static function () {
885
+				return rest_get_server();
886
+			},
887
+		];
888
+	}
889
+
890
+
891
+	/**
892
+	 * can be used for supplying alternate names for classes,
893
+	 * or for connecting interface names to instantiable classes
894
+	 *
895
+	 * @throws InvalidAliasException
896
+	 */
897
+	protected function _register_core_aliases()
898
+	{
899
+		$aliases = [
900
+			'CommandBusInterface'                                                          => 'EventEspresso\core\services\commands\CommandBusInterface',
901
+			'EventEspresso\core\services\commands\CommandBusInterface'                     => 'EventEspresso\core\services\commands\CommandBus',
902
+			'CommandHandlerManagerInterface'                                               => 'EventEspresso\core\services\commands\CommandHandlerManagerInterface',
903
+			'EventEspresso\core\services\commands\CommandHandlerManagerInterface'          => 'EventEspresso\core\services\commands\CommandHandlerManager',
904
+			'CapChecker'                                                                   => 'EventEspresso\core\services\commands\middleware\CapChecker',
905
+			'AddActionHook'                                                                => 'EventEspresso\core\services\commands\middleware\AddActionHook',
906
+			'CapabilitiesChecker'                                                          => 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker',
907
+			'CapabilitiesCheckerInterface'                                                 => 'EventEspresso\core\domain\services\capabilities\CapabilitiesCheckerInterface',
908
+			'EventEspresso\core\domain\services\capabilities\CapabilitiesCheckerInterface' => 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker',
909
+			'CreateRegistrationService'                                                    => 'EventEspresso\core\domain\services\registration\CreateRegistrationService',
910
+			'CreateRegistrationCommandHandler'                                             => 'EventEspresso\core\services\commands\registration\CreateRegistrationCommand',
911
+			'CopyRegistrationDetailsCommandHandler'                                        => 'EventEspresso\core\services\commands\registration\CopyRegistrationDetailsCommand',
912
+			'CopyRegistrationPaymentsCommandHandler'                                       => 'EventEspresso\core\services\commands\registration\CopyRegistrationPaymentsCommand',
913
+			'CancelRegistrationAndTicketLineItemCommandHandler'                            => 'EventEspresso\core\services\commands\registration\CancelRegistrationAndTicketLineItemCommandHandler',
914
+			'UpdateRegistrationAndTransactionAfterChangeCommandHandler'                    => 'EventEspresso\core\services\commands\registration\UpdateRegistrationAndTransactionAfterChangeCommandHandler',
915
+			'CreateTicketLineItemCommandHandler'                                           => 'EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommand',
916
+			'CreateTransactionCommandHandler'                                              => 'EventEspresso\core\services\commands\transaction\CreateTransactionCommandHandler',
917
+			'CreateAttendeeCommandHandler'                                                 => 'EventEspresso\core\services\commands\attendee\CreateAttendeeCommandHandler',
918
+			'TableManager'                                                                 => 'EventEspresso\core\services\database\TableManager',
919
+			'TableAnalysis'                                                                => 'EventEspresso\core\services\database\TableAnalysis',
920
+			'EspressoShortcode'                                                            => 'EventEspresso\core\services\shortcodes\EspressoShortcode',
921
+			'ShortcodeInterface'                                                           => 'EventEspresso\core\services\shortcodes\ShortcodeInterface',
922
+			'EventEspresso\core\services\shortcodes\ShortcodeInterface'                    => 'EventEspresso\core\services\shortcodes\EspressoShortcode',
923
+			'EventEspresso\core\services\cache\CacheStorageInterface'                      => 'EventEspresso\core\services\cache\TransientCacheStorage',
924
+			'LoaderInterface'                                                              => 'EventEspresso\core\services\loaders\LoaderInterface',
925
+			'EventEspresso\core\services\loaders\LoaderInterface'                          => 'EventEspresso\core\services\loaders\Loader',
926
+			'CommandFactoryInterface'                                                      => 'EventEspresso\core\services\commands\CommandFactoryInterface',
927
+			'EventEspresso\core\services\commands\CommandFactoryInterface'                 => 'EventEspresso\core\services\commands\CommandFactory',
928
+			'EmailValidatorInterface'                                                      => 'EventEspresso\core\domain\services\validation\email\EmailValidatorInterface',
929
+			'EventEspresso\core\domain\services\validation\email\EmailValidatorInterface'  => 'EventEspresso\core\domain\services\validation\email\EmailValidationService',
930
+			'NoticeConverterInterface'                                                     => 'EventEspresso\core\services\notices\NoticeConverterInterface',
931
+			'EventEspresso\core\services\notices\NoticeConverterInterface'                 => 'EventEspresso\core\services\notices\ConvertNoticesToEeErrors',
932
+			'NoticesContainerInterface'                                                    => 'EventEspresso\core\services\notices\NoticesContainerInterface',
933
+			'EventEspresso\core\services\notices\NoticesContainerInterface'                => 'EventEspresso\core\services\notices\NoticesContainer',
934
+			'EventEspresso\core\services\request\RequestInterface'                         => 'EventEspresso\core\services\request\Request',
935
+			'EventEspresso\core\services\request\ResponseInterface'                        => 'EventEspresso\core\services\request\Response',
936
+			'EventEspresso\core\domain\DomainInterface'                                    => 'EventEspresso\core\domain\Domain',
937
+			'Registration_Processor'                                                       => 'EE_Registration_Processor',
938
+		];
939
+		foreach ($aliases as $alias => $fqn) {
940
+			if (is_array($fqn)) {
941
+				foreach ($fqn as $class => $for_class) {
942
+					$this->class_cache->addAlias($class, $alias, $for_class);
943
+				}
944
+				continue;
945
+			}
946
+			$this->class_cache->addAlias($fqn, $alias);
947
+		}
948
+		if (! (defined('DOING_AJAX') && DOING_AJAX) && is_admin()) {
949
+			$this->class_cache->addAlias(
950
+				'EventEspresso\core\services\notices\ConvertNoticesToAdminNotices',
951
+				'EventEspresso\core\services\notices\NoticeConverterInterface'
952
+			);
953
+		}
954
+	}
955
+
956
+
957
+	/**
958
+	 * This is used to reset the internal map and class_loaders to their original default state at the beginning of the
959
+	 * request Primarily used by unit tests.
960
+	 */
961
+	public function reset()
962
+	{
963
+		$this->_register_core_class_loaders();
964
+		$this->_register_core_dependencies();
965
+	}
966
+
967
+
968
+	/**
969
+	 * PLZ NOTE: a better name for this method would be is_alias()
970
+	 * because it returns TRUE if the provided fully qualified name IS an alias
971
+	 * WHY?
972
+	 * Because if a class is type hinting for a concretion,
973
+	 * then why would we need to find another class to supply it?
974
+	 * ie: if a class asks for `Fully/Qualified/Namespace/SpecificClassName`,
975
+	 * then give it an instance of `Fully/Qualified/Namespace/SpecificClassName`.
976
+	 * Don't go looking for some substitute.
977
+	 * Whereas if a class is type hinting for an interface...
978
+	 * then we need to find an actual class to use.
979
+	 * So the interface IS the alias for some other FQN,
980
+	 * and we need to find out if `Fully/Qualified/Namespace/SomeInterface`
981
+	 * represents some other class.
982
+	 *
983
+	 * @param string $fqn
984
+	 * @param string $for_class
985
+	 * @return bool
986
+	 * @deprecated 4.9.62.p
987
+	 */
988
+	public function has_alias($fqn = '', $for_class = '')
989
+	{
990
+		return $this->isAlias($fqn, $for_class);
991
+	}
992
+
993
+
994
+	/**
995
+	 * PLZ NOTE: a better name for this method would be get_fqn_for_alias()
996
+	 * because it returns a FQN for provided alias if one exists, otherwise returns the original $alias
997
+	 * functions recursively, so that multiple aliases can be used to drill down to a FQN
998
+	 *  for example:
999
+	 *      if the following two entries were added to the _aliases array:
1000
+	 *          array(
1001
+	 *              'interface_alias'           => 'some\namespace\interface'
1002
+	 *              'some\namespace\interface'  => 'some\namespace\classname'
1003
+	 *          )
1004
+	 *      then one could use EE_Registry::instance()->create( 'interface_alias' )
1005
+	 *      to load an instance of 'some\namespace\classname'
1006
+	 *
1007
+	 * @param string $alias
1008
+	 * @param string $for_class
1009
+	 * @return string
1010
+	 * @deprecated 4.9.62.p
1011
+	 */
1012
+	public function get_alias($alias = '', $for_class = '')
1013
+	{
1014
+		return $this->getFqnForAlias($alias, $for_class);
1015
+	}
1016 1016
 }
Please login to merge, or discard this patch.