@@ -16,131 +16,131 @@ |
||
16 | 16 | */ |
17 | 17 | class Config |
18 | 18 | { |
19 | - /** |
|
20 | - * @var EE_Network_Config |
|
21 | - */ |
|
22 | - private $network_config; |
|
23 | - |
|
24 | - |
|
25 | - /** |
|
26 | - * @var EE_Config |
|
27 | - */ |
|
28 | - private $ee_config; |
|
29 | - |
|
30 | - |
|
31 | - public function __construct(EE_Network_Config $network_config, EE_Config $ee_config) |
|
32 | - { |
|
33 | - $this->network_config = $network_config; |
|
34 | - $this->ee_config = $ee_config; |
|
35 | - } |
|
36 | - |
|
37 | - |
|
38 | - /** |
|
39 | - * Get the site license key for the site. |
|
40 | - */ |
|
41 | - public function siteLicenseKey() |
|
42 | - { |
|
43 | - return $this->network_config->core->site_license_key; |
|
44 | - } |
|
45 | - |
|
46 | - |
|
47 | - public function i18nDomain() |
|
48 | - { |
|
49 | - return 'event_espresso'; |
|
50 | - } |
|
51 | - |
|
52 | - |
|
53 | - public function checkPeriod() |
|
54 | - { |
|
55 | - return 24; |
|
56 | - } |
|
57 | - |
|
58 | - |
|
59 | - public function optionKey() |
|
60 | - { |
|
61 | - return 'ee_site_license_key'; |
|
62 | - } |
|
63 | - |
|
64 | - |
|
65 | - public function optionsPageSlug() |
|
66 | - { |
|
67 | - return 'espresso_general_settings'; |
|
68 | - } |
|
69 | - |
|
70 | - |
|
71 | - public function hostServerUrl() |
|
72 | - { |
|
73 | - return defined('PUE_UPDATES_ENDPOINT') |
|
74 | - ? PUE_UPDATES_ENDPOINT |
|
75 | - : 'https://eventespresso.com'; |
|
76 | - } |
|
77 | - |
|
78 | - |
|
79 | - public function pluginSlug() |
|
80 | - { |
|
81 | - // Note: PUE uses a simple preg_match to determine what type is currently installed based on version number. |
|
82 | - // So it's important that you use a key for the version type that is unique and not found in another key. |
|
83 | - // For example: |
|
84 | - // $plugin_slug['premium']['p'] = 'some-premium-slug'; |
|
85 | - // $plugin_slug['prerelease']['pr'] = 'some-pre-release-slug'; |
|
86 | - // The above would not work because "p" is found in both keys for the version type. ( i.e 1.0.p vs 1.0.pr ) |
|
87 | - // so doing something like: |
|
88 | - // $plugin_slug['premium']['p'] = 'some-premium-slug'; |
|
89 | - // $plugin_slug['prerelease']['b'] = 'some-pre-release-slug'; |
|
90 | - // ..WOULD work! |
|
91 | - return array( |
|
92 | - 'free' => array('decaf' => 'event-espresso-core-decaf'), |
|
93 | - 'premium' => array('p' => 'event-espresso-core-reg'), |
|
94 | - 'prerelease' => array('beta' => 'event-espresso-core-pr'), |
|
95 | - ); |
|
96 | - } |
|
97 | - |
|
98 | - |
|
99 | - /** |
|
100 | - * Return whether the site is opted in for UXIP or not. |
|
101 | - * |
|
102 | - * @return bool |
|
103 | - */ |
|
104 | - public function isOptedInForUxip() |
|
105 | - { |
|
106 | - return filter_var($this->ee_config->core->ee_ueip_optin, FILTER_VALIDATE_BOOLEAN); |
|
107 | - } |
|
108 | - |
|
109 | - |
|
110 | - /** |
|
111 | - * Return whether the site has been notified about UXIP or not. |
|
112 | - * |
|
113 | - * @return bool |
|
114 | - */ |
|
115 | - public function hasNotifiedForUxip() |
|
116 | - { |
|
117 | - return filter_var($this->ee_config->core->ee_ueip_has_notified, FILTER_VALIDATE_BOOLEAN); |
|
118 | - } |
|
119 | - |
|
120 | - |
|
121 | - /** |
|
122 | - * Set the site opted in for UXIP. |
|
123 | - */ |
|
124 | - public function setHasOptedInForUxip() |
|
125 | - { |
|
126 | - $this->ee_config->core->ee_ueip_optin = true; |
|
127 | - $this->ee_config->update_espresso_config(false, false); |
|
128 | - } |
|
129 | - |
|
130 | - |
|
131 | - /** |
|
132 | - * Set the site opted out for UXIP |
|
133 | - */ |
|
134 | - public function setHasOptedOutForUxip() |
|
135 | - { |
|
136 | - $this->ee_config->core->ee_ueip_optin = false; |
|
137 | - $this->ee_config->update_espresso_config(false, false); |
|
138 | - } |
|
139 | - |
|
140 | - |
|
141 | - public function setHasNotifiedAboutUxip() |
|
142 | - { |
|
143 | - $this->ee_config->core->ee_ueip_has_notified = true; |
|
144 | - $this->ee_config->update_espresso_config(false, false); |
|
145 | - } |
|
19 | + /** |
|
20 | + * @var EE_Network_Config |
|
21 | + */ |
|
22 | + private $network_config; |
|
23 | + |
|
24 | + |
|
25 | + /** |
|
26 | + * @var EE_Config |
|
27 | + */ |
|
28 | + private $ee_config; |
|
29 | + |
|
30 | + |
|
31 | + public function __construct(EE_Network_Config $network_config, EE_Config $ee_config) |
|
32 | + { |
|
33 | + $this->network_config = $network_config; |
|
34 | + $this->ee_config = $ee_config; |
|
35 | + } |
|
36 | + |
|
37 | + |
|
38 | + /** |
|
39 | + * Get the site license key for the site. |
|
40 | + */ |
|
41 | + public function siteLicenseKey() |
|
42 | + { |
|
43 | + return $this->network_config->core->site_license_key; |
|
44 | + } |
|
45 | + |
|
46 | + |
|
47 | + public function i18nDomain() |
|
48 | + { |
|
49 | + return 'event_espresso'; |
|
50 | + } |
|
51 | + |
|
52 | + |
|
53 | + public function checkPeriod() |
|
54 | + { |
|
55 | + return 24; |
|
56 | + } |
|
57 | + |
|
58 | + |
|
59 | + public function optionKey() |
|
60 | + { |
|
61 | + return 'ee_site_license_key'; |
|
62 | + } |
|
63 | + |
|
64 | + |
|
65 | + public function optionsPageSlug() |
|
66 | + { |
|
67 | + return 'espresso_general_settings'; |
|
68 | + } |
|
69 | + |
|
70 | + |
|
71 | + public function hostServerUrl() |
|
72 | + { |
|
73 | + return defined('PUE_UPDATES_ENDPOINT') |
|
74 | + ? PUE_UPDATES_ENDPOINT |
|
75 | + : 'https://eventespresso.com'; |
|
76 | + } |
|
77 | + |
|
78 | + |
|
79 | + public function pluginSlug() |
|
80 | + { |
|
81 | + // Note: PUE uses a simple preg_match to determine what type is currently installed based on version number. |
|
82 | + // So it's important that you use a key for the version type that is unique and not found in another key. |
|
83 | + // For example: |
|
84 | + // $plugin_slug['premium']['p'] = 'some-premium-slug'; |
|
85 | + // $plugin_slug['prerelease']['pr'] = 'some-pre-release-slug'; |
|
86 | + // The above would not work because "p" is found in both keys for the version type. ( i.e 1.0.p vs 1.0.pr ) |
|
87 | + // so doing something like: |
|
88 | + // $plugin_slug['premium']['p'] = 'some-premium-slug'; |
|
89 | + // $plugin_slug['prerelease']['b'] = 'some-pre-release-slug'; |
|
90 | + // ..WOULD work! |
|
91 | + return array( |
|
92 | + 'free' => array('decaf' => 'event-espresso-core-decaf'), |
|
93 | + 'premium' => array('p' => 'event-espresso-core-reg'), |
|
94 | + 'prerelease' => array('beta' => 'event-espresso-core-pr'), |
|
95 | + ); |
|
96 | + } |
|
97 | + |
|
98 | + |
|
99 | + /** |
|
100 | + * Return whether the site is opted in for UXIP or not. |
|
101 | + * |
|
102 | + * @return bool |
|
103 | + */ |
|
104 | + public function isOptedInForUxip() |
|
105 | + { |
|
106 | + return filter_var($this->ee_config->core->ee_ueip_optin, FILTER_VALIDATE_BOOLEAN); |
|
107 | + } |
|
108 | + |
|
109 | + |
|
110 | + /** |
|
111 | + * Return whether the site has been notified about UXIP or not. |
|
112 | + * |
|
113 | + * @return bool |
|
114 | + */ |
|
115 | + public function hasNotifiedForUxip() |
|
116 | + { |
|
117 | + return filter_var($this->ee_config->core->ee_ueip_has_notified, FILTER_VALIDATE_BOOLEAN); |
|
118 | + } |
|
119 | + |
|
120 | + |
|
121 | + /** |
|
122 | + * Set the site opted in for UXIP. |
|
123 | + */ |
|
124 | + public function setHasOptedInForUxip() |
|
125 | + { |
|
126 | + $this->ee_config->core->ee_ueip_optin = true; |
|
127 | + $this->ee_config->update_espresso_config(false, false); |
|
128 | + } |
|
129 | + |
|
130 | + |
|
131 | + /** |
|
132 | + * Set the site opted out for UXIP |
|
133 | + */ |
|
134 | + public function setHasOptedOutForUxip() |
|
135 | + { |
|
136 | + $this->ee_config->core->ee_ueip_optin = false; |
|
137 | + $this->ee_config->update_espresso_config(false, false); |
|
138 | + } |
|
139 | + |
|
140 | + |
|
141 | + public function setHasNotifiedAboutUxip() |
|
142 | + { |
|
143 | + $this->ee_config->core->ee_ueip_has_notified = true; |
|
144 | + $this->ee_config->update_espresso_config(false, false); |
|
145 | + } |
|
146 | 146 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | */ |
98 | 98 | public function addAlias(ClassAlias $alias) |
99 | 99 | { |
100 | - $this->aliases[ $alias->alias() ] = $alias; |
|
100 | + $this->aliases[$alias->alias()] = $alias; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | /** |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public function resolveAlias($param_fqcn) |
108 | 108 | { |
109 | - return isset($this->aliases[ $param_fqcn ]) |
|
110 | - ? $this->aliases[ $param_fqcn ]->fqcn() |
|
109 | + return isset($this->aliases[$param_fqcn]) |
|
110 | + ? $this->aliases[$param_fqcn]->fqcn() |
|
111 | 111 | : $this->classCache()->getFqnForAlias($param_fqcn); |
112 | 112 | } |
113 | 113 | |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $this->resolveDependenciesForClass($param_class); |
171 | 171 | } |
172 | 172 | $param_class = $this->resolveAlias($param_class); |
173 | - $dependencies[ $param_class ] = EE_Dependency_Map::load_from_cache; |
|
173 | + $dependencies[$param_class] = EE_Dependency_Map::load_from_cache; |
|
174 | 174 | } |
175 | 175 | $this->dependencyMap()->registerDependencies($fqcn, $dependencies); |
176 | 176 | } |
@@ -23,155 +23,155 @@ |
||
23 | 23 | abstract class DependencyResolver implements DependencyResolverInterface |
24 | 24 | { |
25 | 25 | |
26 | - /** |
|
27 | - * @var Mirror $mirror |
|
28 | - */ |
|
29 | - private $mirror; |
|
30 | - |
|
31 | - /** |
|
32 | - * @var ClassInterfaceCache $class_cache |
|
33 | - */ |
|
34 | - private $class_cache; |
|
35 | - |
|
36 | - /** |
|
37 | - * @var EE_Dependency_Map $dependency_map |
|
38 | - */ |
|
39 | - private $dependency_map; |
|
40 | - |
|
41 | - /** |
|
42 | - * @var ClassAlias[] $aliases |
|
43 | - */ |
|
44 | - protected $aliases = array(); |
|
45 | - |
|
46 | - /** |
|
47 | - * @var array $namespace_roots |
|
48 | - */ |
|
49 | - protected $namespace_roots = array(); |
|
50 | - |
|
51 | - |
|
52 | - /** |
|
53 | - * RouteMatchSpecificationDependencyResolver constructor. |
|
54 | - * |
|
55 | - * @param Mirror $mirror |
|
56 | - * @param ClassInterfaceCache $class_cache |
|
57 | - * @param EE_Dependency_Map $dependency_map |
|
58 | - */ |
|
59 | - public function __construct( |
|
60 | - Mirror $mirror, |
|
61 | - ClassInterfaceCache $class_cache, |
|
62 | - EE_Dependency_Map $dependency_map |
|
63 | - ) { |
|
64 | - $this->mirror = $mirror; |
|
65 | - $this->class_cache = $class_cache; |
|
66 | - $this->dependency_map = $dependency_map; |
|
67 | - $this->initialize(); |
|
68 | - } |
|
69 | - |
|
70 | - /** |
|
71 | - * @return Mirror |
|
72 | - */ |
|
73 | - public function mirror() |
|
74 | - { |
|
75 | - return $this->mirror; |
|
76 | - } |
|
77 | - |
|
78 | - /** |
|
79 | - * @return ClassInterfaceCache |
|
80 | - */ |
|
81 | - public function classCache() |
|
82 | - { |
|
83 | - return $this->class_cache; |
|
84 | - } |
|
85 | - |
|
86 | - /** |
|
87 | - * @return EE_Dependency_Map |
|
88 | - */ |
|
89 | - public function dependencyMap() |
|
90 | - { |
|
91 | - return $this->dependency_map; |
|
92 | - } |
|
93 | - |
|
94 | - /** |
|
95 | - * @param ClassAlias $alias |
|
96 | - * @throws InvalidAliasException |
|
97 | - */ |
|
98 | - public function addAlias(ClassAlias $alias) |
|
99 | - { |
|
100 | - $this->aliases[ $alias->alias() ] = $alias; |
|
101 | - } |
|
102 | - |
|
103 | - /** |
|
104 | - * @param string $param_fqcn Fully Qualified Class Name for dependency parameter |
|
105 | - * @return string |
|
106 | - */ |
|
107 | - public function resolveAlias($param_fqcn) |
|
108 | - { |
|
109 | - return isset($this->aliases[ $param_fqcn ]) |
|
110 | - ? $this->aliases[ $param_fqcn ]->fqcn() |
|
111 | - : $this->classCache()->getFqnForAlias($param_fqcn); |
|
112 | - } |
|
113 | - |
|
114 | - /** |
|
115 | - * Primarily used to indicate the namespace root for composite objects |
|
116 | - * so that dependencies requiring the same DependencyResolver can be acquired |
|
117 | - * for example: |
|
118 | - * Vendor\path\to\class\A, Vendor\path\to\class\B, and Vendor\path\to\class\C |
|
119 | - * may all implement Vendor\path\to\Interface, |
|
120 | - * but Vendor\path\to\class\C could be a composite object |
|
121 | - * that requires Vendor\path\to\class\A and Vendor\path\to\class\B, |
|
122 | - * and needs both of those dependencies resolved, which would therefore require |
|
123 | - * the use of the same DependencyResolver. |
|
124 | - * |
|
125 | - * By specifying a namespace root of "Vendor\path\to\", |
|
126 | - * then all classes that are descendants of that namespace |
|
127 | - * will use DependencyResolver to acquire the classes they need |
|
128 | - * |
|
129 | - * @param string $namespace_root Partial namespace used for detecting other classes |
|
130 | - * that should employ this same DependencyResolver |
|
131 | - */ |
|
132 | - public function addNamespaceRoot($namespace_root) |
|
133 | - { |
|
134 | - $this->namespace_roots[] = $namespace_root; |
|
135 | - } |
|
136 | - |
|
137 | - /** |
|
138 | - * Returns true if the parameter FQCN belongs to one of |
|
139 | - * the namespaces that utilizes this DependencyResolver |
|
140 | - * |
|
141 | - * @param string $param_fqcn Fully Qualified Class Name for dependency parameter |
|
142 | - * @return boolean |
|
143 | - * @since 4.9.71.p |
|
144 | - */ |
|
145 | - public function dependencyRecursionExists($param_fqcn) |
|
146 | - { |
|
147 | - foreach ($this->namespace_roots as $namespace_root) { |
|
148 | - if (strpos($param_fqcn, $namespace_root) !== false) { |
|
149 | - return true; |
|
150 | - } |
|
151 | - } |
|
152 | - return false; |
|
153 | - } |
|
154 | - |
|
155 | - |
|
156 | - /** |
|
157 | - * @param string $fqcn Fully Qualified Class Name |
|
158 | - * @throws InvalidDataTypeException |
|
159 | - * @throws ReflectionException |
|
160 | - * @since 4.9.71.p |
|
161 | - */ |
|
162 | - public function resolveDependenciesForClass($fqcn) |
|
163 | - { |
|
164 | - $dependencies = array(); |
|
165 | - $params = $this->mirror()->getParameters($fqcn); |
|
166 | - foreach ($params as $index => $param) { |
|
167 | - // is this a dependency for a specific class ? |
|
168 | - $param_class = $this->mirror()->getParameterClassName($param, $fqcn, $index); |
|
169 | - if ($this->dependencyRecursionExists($param_class)) { |
|
170 | - $this->resolveDependenciesForClass($param_class); |
|
171 | - } |
|
172 | - $param_class = $this->resolveAlias($param_class); |
|
173 | - $dependencies[ $param_class ] = EE_Dependency_Map::load_from_cache; |
|
174 | - } |
|
175 | - $this->dependencyMap()->registerDependencies($fqcn, $dependencies); |
|
176 | - } |
|
26 | + /** |
|
27 | + * @var Mirror $mirror |
|
28 | + */ |
|
29 | + private $mirror; |
|
30 | + |
|
31 | + /** |
|
32 | + * @var ClassInterfaceCache $class_cache |
|
33 | + */ |
|
34 | + private $class_cache; |
|
35 | + |
|
36 | + /** |
|
37 | + * @var EE_Dependency_Map $dependency_map |
|
38 | + */ |
|
39 | + private $dependency_map; |
|
40 | + |
|
41 | + /** |
|
42 | + * @var ClassAlias[] $aliases |
|
43 | + */ |
|
44 | + protected $aliases = array(); |
|
45 | + |
|
46 | + /** |
|
47 | + * @var array $namespace_roots |
|
48 | + */ |
|
49 | + protected $namespace_roots = array(); |
|
50 | + |
|
51 | + |
|
52 | + /** |
|
53 | + * RouteMatchSpecificationDependencyResolver constructor. |
|
54 | + * |
|
55 | + * @param Mirror $mirror |
|
56 | + * @param ClassInterfaceCache $class_cache |
|
57 | + * @param EE_Dependency_Map $dependency_map |
|
58 | + */ |
|
59 | + public function __construct( |
|
60 | + Mirror $mirror, |
|
61 | + ClassInterfaceCache $class_cache, |
|
62 | + EE_Dependency_Map $dependency_map |
|
63 | + ) { |
|
64 | + $this->mirror = $mirror; |
|
65 | + $this->class_cache = $class_cache; |
|
66 | + $this->dependency_map = $dependency_map; |
|
67 | + $this->initialize(); |
|
68 | + } |
|
69 | + |
|
70 | + /** |
|
71 | + * @return Mirror |
|
72 | + */ |
|
73 | + public function mirror() |
|
74 | + { |
|
75 | + return $this->mirror; |
|
76 | + } |
|
77 | + |
|
78 | + /** |
|
79 | + * @return ClassInterfaceCache |
|
80 | + */ |
|
81 | + public function classCache() |
|
82 | + { |
|
83 | + return $this->class_cache; |
|
84 | + } |
|
85 | + |
|
86 | + /** |
|
87 | + * @return EE_Dependency_Map |
|
88 | + */ |
|
89 | + public function dependencyMap() |
|
90 | + { |
|
91 | + return $this->dependency_map; |
|
92 | + } |
|
93 | + |
|
94 | + /** |
|
95 | + * @param ClassAlias $alias |
|
96 | + * @throws InvalidAliasException |
|
97 | + */ |
|
98 | + public function addAlias(ClassAlias $alias) |
|
99 | + { |
|
100 | + $this->aliases[ $alias->alias() ] = $alias; |
|
101 | + } |
|
102 | + |
|
103 | + /** |
|
104 | + * @param string $param_fqcn Fully Qualified Class Name for dependency parameter |
|
105 | + * @return string |
|
106 | + */ |
|
107 | + public function resolveAlias($param_fqcn) |
|
108 | + { |
|
109 | + return isset($this->aliases[ $param_fqcn ]) |
|
110 | + ? $this->aliases[ $param_fqcn ]->fqcn() |
|
111 | + : $this->classCache()->getFqnForAlias($param_fqcn); |
|
112 | + } |
|
113 | + |
|
114 | + /** |
|
115 | + * Primarily used to indicate the namespace root for composite objects |
|
116 | + * so that dependencies requiring the same DependencyResolver can be acquired |
|
117 | + * for example: |
|
118 | + * Vendor\path\to\class\A, Vendor\path\to\class\B, and Vendor\path\to\class\C |
|
119 | + * may all implement Vendor\path\to\Interface, |
|
120 | + * but Vendor\path\to\class\C could be a composite object |
|
121 | + * that requires Vendor\path\to\class\A and Vendor\path\to\class\B, |
|
122 | + * and needs both of those dependencies resolved, which would therefore require |
|
123 | + * the use of the same DependencyResolver. |
|
124 | + * |
|
125 | + * By specifying a namespace root of "Vendor\path\to\", |
|
126 | + * then all classes that are descendants of that namespace |
|
127 | + * will use DependencyResolver to acquire the classes they need |
|
128 | + * |
|
129 | + * @param string $namespace_root Partial namespace used for detecting other classes |
|
130 | + * that should employ this same DependencyResolver |
|
131 | + */ |
|
132 | + public function addNamespaceRoot($namespace_root) |
|
133 | + { |
|
134 | + $this->namespace_roots[] = $namespace_root; |
|
135 | + } |
|
136 | + |
|
137 | + /** |
|
138 | + * Returns true if the parameter FQCN belongs to one of |
|
139 | + * the namespaces that utilizes this DependencyResolver |
|
140 | + * |
|
141 | + * @param string $param_fqcn Fully Qualified Class Name for dependency parameter |
|
142 | + * @return boolean |
|
143 | + * @since 4.9.71.p |
|
144 | + */ |
|
145 | + public function dependencyRecursionExists($param_fqcn) |
|
146 | + { |
|
147 | + foreach ($this->namespace_roots as $namespace_root) { |
|
148 | + if (strpos($param_fqcn, $namespace_root) !== false) { |
|
149 | + return true; |
|
150 | + } |
|
151 | + } |
|
152 | + return false; |
|
153 | + } |
|
154 | + |
|
155 | + |
|
156 | + /** |
|
157 | + * @param string $fqcn Fully Qualified Class Name |
|
158 | + * @throws InvalidDataTypeException |
|
159 | + * @throws ReflectionException |
|
160 | + * @since 4.9.71.p |
|
161 | + */ |
|
162 | + public function resolveDependenciesForClass($fqcn) |
|
163 | + { |
|
164 | + $dependencies = array(); |
|
165 | + $params = $this->mirror()->getParameters($fqcn); |
|
166 | + foreach ($params as $index => $param) { |
|
167 | + // is this a dependency for a specific class ? |
|
168 | + $param_class = $this->mirror()->getParameterClassName($param, $fqcn, $index); |
|
169 | + if ($this->dependencyRecursionExists($param_class)) { |
|
170 | + $this->resolveDependenciesForClass($param_class); |
|
171 | + } |
|
172 | + $param_class = $this->resolveAlias($param_class); |
|
173 | + $dependencies[ $param_class ] = EE_Dependency_Map::load_from_cache; |
|
174 | + } |
|
175 | + $this->dependencyMap()->registerDependencies($fqcn, $dependencies); |
|
176 | + } |
|
177 | 177 | } |
@@ -16,29 +16,29 @@ |
||
16 | 16 | abstract class MultiRouteSpecification extends RouteMatchSpecification |
17 | 17 | { |
18 | 18 | |
19 | - /** |
|
20 | - * @var RouteMatchSpecificationInterface[] $specifications |
|
21 | - */ |
|
22 | - protected $specifications; |
|
19 | + /** |
|
20 | + * @var RouteMatchSpecificationInterface[] $specifications |
|
21 | + */ |
|
22 | + protected $specifications; |
|
23 | 23 | |
24 | - /** |
|
25 | - * MultiRouteSpecification constructor. |
|
26 | - * |
|
27 | - * @param RouteMatchSpecificationInterface[] $specifications |
|
28 | - * @param RequestInterface $request |
|
29 | - * @throws InvalidEntityException |
|
30 | - */ |
|
31 | - public function __construct(array $specifications, RequestInterface $request) |
|
32 | - { |
|
33 | - foreach ($specifications as $specification) { |
|
34 | - if (! $specification instanceof RouteMatchSpecificationInterface) { |
|
35 | - throw new InvalidEntityException( |
|
36 | - $specification, |
|
37 | - 'EventEspresso\core\domain\entities\route_match\RouteMatchSpecificationInterface' |
|
38 | - ); |
|
39 | - } |
|
40 | - } |
|
41 | - $this->specifications = $specifications; |
|
42 | - parent::__construct($request); |
|
43 | - } |
|
24 | + /** |
|
25 | + * MultiRouteSpecification constructor. |
|
26 | + * |
|
27 | + * @param RouteMatchSpecificationInterface[] $specifications |
|
28 | + * @param RequestInterface $request |
|
29 | + * @throws InvalidEntityException |
|
30 | + */ |
|
31 | + public function __construct(array $specifications, RequestInterface $request) |
|
32 | + { |
|
33 | + foreach ($specifications as $specification) { |
|
34 | + if (! $specification instanceof RouteMatchSpecificationInterface) { |
|
35 | + throw new InvalidEntityException( |
|
36 | + $specification, |
|
37 | + 'EventEspresso\core\domain\entities\route_match\RouteMatchSpecificationInterface' |
|
38 | + ); |
|
39 | + } |
|
40 | + } |
|
41 | + $this->specifications = $specifications; |
|
42 | + parent::__construct($request); |
|
43 | + } |
|
44 | 44 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | public function __construct(array $specifications, RequestInterface $request) |
32 | 32 | { |
33 | 33 | foreach ($specifications as $specification) { |
34 | - if (! $specification instanceof RouteMatchSpecificationInterface) { |
|
34 | + if ( ! $specification instanceof RouteMatchSpecificationInterface) { |
|
35 | 35 | throw new InvalidEntityException( |
36 | 36 | $specification, |
37 | 37 | 'EventEspresso\core\domain\entities\route_match\RouteMatchSpecificationInterface' |
@@ -17,23 +17,23 @@ |
||
17 | 17 | class DetectFileEditorRequest extends Middleware |
18 | 18 | { |
19 | 19 | |
20 | - /** |
|
21 | - * converts a Request to a Response |
|
22 | - * |
|
23 | - * @param RequestInterface $request |
|
24 | - * @param ResponseInterface $response |
|
25 | - * @return ResponseInterface |
|
26 | - */ |
|
27 | - public function handleRequest(RequestInterface $request, ResponseInterface $response) |
|
28 | - { |
|
29 | - $this->request = $request; |
|
30 | - $this->response = $response; |
|
31 | - // can't store user data during WP error scrapes if no user exists |
|
32 | - // so don't load the session since it's not going to work anyways |
|
33 | - if ($this->request->isWordPressScrape()) { |
|
34 | - add_filter('FHEE_load_EE_Session', '__return_false', 999); |
|
35 | - } |
|
36 | - $this->response = $this->processRequestStack($this->request, $this->response); |
|
37 | - return $this->response; |
|
38 | - } |
|
20 | + /** |
|
21 | + * converts a Request to a Response |
|
22 | + * |
|
23 | + * @param RequestInterface $request |
|
24 | + * @param ResponseInterface $response |
|
25 | + * @return ResponseInterface |
|
26 | + */ |
|
27 | + public function handleRequest(RequestInterface $request, ResponseInterface $response) |
|
28 | + { |
|
29 | + $this->request = $request; |
|
30 | + $this->response = $response; |
|
31 | + // can't store user data during WP error scrapes if no user exists |
|
32 | + // so don't load the session since it's not going to work anyways |
|
33 | + if ($this->request->isWordPressScrape()) { |
|
34 | + add_filter('FHEE_load_EE_Session', '__return_false', 999); |
|
35 | + } |
|
36 | + $this->response = $this->processRequestStack($this->request, $this->response); |
|
37 | + return $this->response; |
|
38 | + } |
|
39 | 39 | } |
@@ -18,22 +18,22 @@ |
||
18 | 18 | */ |
19 | 19 | class WordPressPostsEditor extends MatchAnyRouteSpecification |
20 | 20 | { |
21 | - /** |
|
22 | - * WordPressPostsEditor constructor. |
|
23 | - * |
|
24 | - * @param WordPressPostsEditorEdit $edit_post_route_match |
|
25 | - * @param WordPressPostsEditorAddNew $create_post_route_match |
|
26 | - * @param RequestInterface $request |
|
27 | - * @throws \EventEspresso\core\exceptions\InvalidEntityException |
|
28 | - */ |
|
29 | - public function __construct( |
|
30 | - WordPressPostsEditorEdit $edit_post_route_match, |
|
31 | - WordPressPostsEditorAddNew $create_post_route_match, |
|
32 | - RequestInterface $request |
|
33 | - ) { |
|
34 | - parent::__construct( |
|
35 | - array($edit_post_route_match, $create_post_route_match), |
|
36 | - $request |
|
37 | - ); |
|
38 | - } |
|
21 | + /** |
|
22 | + * WordPressPostsEditor constructor. |
|
23 | + * |
|
24 | + * @param WordPressPostsEditorEdit $edit_post_route_match |
|
25 | + * @param WordPressPostsEditorAddNew $create_post_route_match |
|
26 | + * @param RequestInterface $request |
|
27 | + * @throws \EventEspresso\core\exceptions\InvalidEntityException |
|
28 | + */ |
|
29 | + public function __construct( |
|
30 | + WordPressPostsEditorEdit $edit_post_route_match, |
|
31 | + WordPressPostsEditorAddNew $create_post_route_match, |
|
32 | + RequestInterface $request |
|
33 | + ) { |
|
34 | + parent::__construct( |
|
35 | + array($edit_post_route_match, $create_post_route_match), |
|
36 | + $request |
|
37 | + ); |
|
38 | + } |
|
39 | 39 | } |
@@ -19,22 +19,22 @@ |
||
19 | 19 | */ |
20 | 20 | class EspressoEventEditor extends MatchAnyRouteSpecification |
21 | 21 | { |
22 | - /** |
|
23 | - * EspressoEventEditor constructor. |
|
24 | - * |
|
25 | - * @param EspressoEventEditorEdit $edit_event_route_match |
|
26 | - * @param EspressoEventEditorAddNew $create_event_route_match |
|
27 | - * @param RequestInterface $request |
|
28 | - * @throws InvalidEntityException |
|
29 | - */ |
|
30 | - public function __construct( |
|
31 | - EspressoEventEditorEdit $edit_event_route_match, |
|
32 | - EspressoEventEditorAddNew $create_event_route_match, |
|
33 | - RequestInterface $request |
|
34 | - ) { |
|
35 | - parent::__construct( |
|
36 | - array($edit_event_route_match, $create_event_route_match), |
|
37 | - $request |
|
38 | - ); |
|
39 | - } |
|
22 | + /** |
|
23 | + * EspressoEventEditor constructor. |
|
24 | + * |
|
25 | + * @param EspressoEventEditorEdit $edit_event_route_match |
|
26 | + * @param EspressoEventEditorAddNew $create_event_route_match |
|
27 | + * @param RequestInterface $request |
|
28 | + * @throws InvalidEntityException |
|
29 | + */ |
|
30 | + public function __construct( |
|
31 | + EspressoEventEditorEdit $edit_event_route_match, |
|
32 | + EspressoEventEditorAddNew $create_event_route_match, |
|
33 | + RequestInterface $request |
|
34 | + ) { |
|
35 | + parent::__construct( |
|
36 | + array($edit_event_route_match, $create_event_route_match), |
|
37 | + $request |
|
38 | + ); |
|
39 | + } |
|
40 | 40 | } |
@@ -19,22 +19,22 @@ |
||
19 | 19 | */ |
20 | 20 | class EspressoVenueEditor extends MatchAnyRouteSpecification |
21 | 21 | { |
22 | - /** |
|
23 | - * EspressoVenueEditor constructor. |
|
24 | - * |
|
25 | - * @param EspressoVenueEditorEdit $edit_venue_route_match |
|
26 | - * @param EspressoVenueEditorAddNew $create_venue_route_match |
|
27 | - * @param RequestInterface $request |
|
28 | - * @throws InvalidEntityException |
|
29 | - */ |
|
30 | - public function __construct( |
|
31 | - EspressoVenueEditorEdit $edit_venue_route_match, |
|
32 | - EspressoVenueEditorAddNew $create_venue_route_match, |
|
33 | - RequestInterface $request |
|
34 | - ) { |
|
35 | - parent::__construct( |
|
36 | - array($edit_venue_route_match, $create_venue_route_match), |
|
37 | - $request |
|
38 | - ); |
|
39 | - } |
|
22 | + /** |
|
23 | + * EspressoVenueEditor constructor. |
|
24 | + * |
|
25 | + * @param EspressoVenueEditorEdit $edit_venue_route_match |
|
26 | + * @param EspressoVenueEditorAddNew $create_venue_route_match |
|
27 | + * @param RequestInterface $request |
|
28 | + * @throws InvalidEntityException |
|
29 | + */ |
|
30 | + public function __construct( |
|
31 | + EspressoVenueEditorEdit $edit_venue_route_match, |
|
32 | + EspressoVenueEditorAddNew $create_venue_route_match, |
|
33 | + RequestInterface $request |
|
34 | + ) { |
|
35 | + parent::__construct( |
|
36 | + array($edit_venue_route_match, $create_venue_route_match), |
|
37 | + $request |
|
38 | + ); |
|
39 | + } |
|
40 | 40 | } |
@@ -18,22 +18,22 @@ |
||
18 | 18 | */ |
19 | 19 | class EspressoPostTypeEditor extends MatchAnyRouteSpecification |
20 | 20 | { |
21 | - /** |
|
22 | - * EspressoEventEditor constructor. |
|
23 | - * |
|
24 | - * @param EspressoStandardPostTypeEditor $standard_route_match |
|
25 | - * @param EspressoAttendeePostTypeEditor $attendee_route_match |
|
26 | - * @param RequestInterface $request |
|
27 | - * @throws InvalidEntityException |
|
28 | - */ |
|
29 | - public function __construct( |
|
30 | - EspressoStandardPostTypeEditor $standard_route_match, |
|
31 | - EspressoAttendeePostTypeEditor $attendee_route_match, |
|
32 | - RequestInterface $request |
|
33 | - ) { |
|
34 | - parent::__construct( |
|
35 | - array($standard_route_match, $attendee_route_match), |
|
36 | - $request |
|
37 | - ); |
|
38 | - } |
|
21 | + /** |
|
22 | + * EspressoEventEditor constructor. |
|
23 | + * |
|
24 | + * @param EspressoStandardPostTypeEditor $standard_route_match |
|
25 | + * @param EspressoAttendeePostTypeEditor $attendee_route_match |
|
26 | + * @param RequestInterface $request |
|
27 | + * @throws InvalidEntityException |
|
28 | + */ |
|
29 | + public function __construct( |
|
30 | + EspressoStandardPostTypeEditor $standard_route_match, |
|
31 | + EspressoAttendeePostTypeEditor $attendee_route_match, |
|
32 | + RequestInterface $request |
|
33 | + ) { |
|
34 | + parent::__construct( |
|
35 | + array($standard_route_match, $attendee_route_match), |
|
36 | + $request |
|
37 | + ); |
|
38 | + } |
|
39 | 39 | } |
@@ -18,22 +18,22 @@ |
||
18 | 18 | */ |
19 | 19 | class WordPressPageEditor extends MatchAnyRouteSpecification |
20 | 20 | { |
21 | - /** |
|
22 | - * WordPressPostsEditor constructor. |
|
23 | - * |
|
24 | - * @param WordPressPostsEditorEdit $edit_page_route_match |
|
25 | - * @param WordPressPostsEditorAddNew $create_page_route_match |
|
26 | - * @param RequestInterface $request |
|
27 | - * @throws \EventEspresso\core\exceptions\InvalidEntityException |
|
28 | - */ |
|
29 | - public function __construct( |
|
30 | - WordPressPageEditorEdit $edit_page_route_match, |
|
31 | - WordPressPageEditorAddNew $create_page_route_match, |
|
32 | - RequestInterface $request |
|
33 | - ) { |
|
34 | - parent::__construct( |
|
35 | - array($edit_page_route_match, $create_page_route_match), |
|
36 | - $request |
|
37 | - ); |
|
38 | - } |
|
21 | + /** |
|
22 | + * WordPressPostsEditor constructor. |
|
23 | + * |
|
24 | + * @param WordPressPostsEditorEdit $edit_page_route_match |
|
25 | + * @param WordPressPostsEditorAddNew $create_page_route_match |
|
26 | + * @param RequestInterface $request |
|
27 | + * @throws \EventEspresso\core\exceptions\InvalidEntityException |
|
28 | + */ |
|
29 | + public function __construct( |
|
30 | + WordPressPageEditorEdit $edit_page_route_match, |
|
31 | + WordPressPageEditorAddNew $create_page_route_match, |
|
32 | + RequestInterface $request |
|
33 | + ) { |
|
34 | + parent::__construct( |
|
35 | + array($edit_page_route_match, $create_page_route_match), |
|
36 | + $request |
|
37 | + ); |
|
38 | + } |
|
39 | 39 | } |