Completed
Branch new-admin-design (7f58b2)
by
unknown
02:54
created
core/services/shortcodes/EspressoShortcode.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             // serialized attributes
105 105
             wp_json_encode($attributes),
106 106
             // Closure for generating content if cache is expired
107
-            function () use ($shortcode, $attributes) {
107
+            function() use ($shortcode, $attributes) {
108 108
                 if ($shortcode->initialized() === false) {
109 109
                     $shortcode->initializeShortcode();
110 110
                 }
@@ -191,14 +191,14 @@  discard block
 block discarded – undo
191 191
         $custom_sanitization = $this->customAttributeSanitizationMap();
192 192
         foreach ($attributes as $key => $value) {
193 193
             // is a custom sanitization callback specified ?
194
-            if (isset($custom_sanitization[ $key ])) {
195
-                $callback = $custom_sanitization[ $key ];
194
+            if (isset($custom_sanitization[$key])) {
195
+                $callback = $custom_sanitization[$key];
196 196
                 if ($callback === 'skip_sanitization') {
197
-                    $attributes[ $key ] = $value;
197
+                    $attributes[$key] = $value;
198 198
                     continue;
199 199
                 }
200 200
                 if (function_exists($callback)) {
201
-                    $attributes[ $key ] = $callback($value);
201
+                    $attributes[$key] = $callback($value);
202 202
                     continue;
203 203
                 }
204 204
             }
@@ -208,18 +208,18 @@  discard block
 block discarded – undo
208 208
                 case is_float($value):
209 209
                     // typical booleans
210 210
                 case in_array($value, array(true, 'true', '1', 'on', 'yes', false, 'false', '0', 'off', 'no'), true):
211
-                    $attributes[ $key ] = $value;
211
+                    $attributes[$key] = $value;
212 212
                     break;
213 213
                 case is_string($value):
214
-                    $attributes[ $key ] = sanitize_text_field($value);
214
+                    $attributes[$key] = sanitize_text_field($value);
215 215
                     break;
216 216
                 case is_array($value):
217
-                    $attributes[ $key ] = $this->sanitizeAttributes($value);
217
+                    $attributes[$key] = $this->sanitizeAttributes($value);
218 218
                     break;
219 219
                 default:
220 220
                     // only remaining data types are Object and Resource
221 221
                     // which are not allowed as shortcode attributes
222
-                    $attributes[ $key ] = null;
222
+                    $attributes[$key] = null;
223 223
                     break;
224 224
             }
225 225
         }
Please login to merge, or discard this patch.
Indentation   +219 added lines, -219 removed lines patch added patch discarded remove patch
@@ -20,223 +20,223 @@
 block discarded – undo
20 20
 abstract class EspressoShortcode implements ShortcodeInterface
21 21
 {
22 22
 
23
-    /**
24
-     * transient prefix
25
-     *
26
-     * @type string
27
-     */
28
-    const CACHE_TRANSIENT_PREFIX = 'ee_sc_';
29
-
30
-    /**
31
-     * @var PostRelatedCacheManager $cache_manager
32
-     */
33
-    private $cache_manager;
34
-
35
-    /**
36
-     * true if ShortcodeInterface::initializeShortcode() has been called
37
-     * if false, then that will get called before processing
38
-     *
39
-     * @var boolean $initialized
40
-     */
41
-    private $initialized = false;
42
-
43
-
44
-    /**
45
-     * EspressoShortcode constructor
46
-     *
47
-     * @param PostRelatedCacheManager $cache_manager
48
-     */
49
-    public function __construct(PostRelatedCacheManager $cache_manager)
50
-    {
51
-        $this->cache_manager = $cache_manager;
52
-    }
53
-
54
-
55
-    /**
56
-     * @return void
57
-     */
58
-    public function shortcodeHasBeenInitialized()
59
-    {
60
-        $this->initialized = true;
61
-    }
62
-
63
-
64
-    /**
65
-     * enqueues scripts then processes the shortcode
66
-     *
67
-     * @param array $attributes
68
-     * @return string
69
-     * @throws EE_Error
70
-     * @throws ReflectionException
71
-     */
72
-    final public function processShortcodeCallback($attributes = array())
73
-    {
74
-        if ($this instanceof EnqueueAssetsInterface) {
75
-            if (is_admin()) {
76
-                $this->enqueueAdminScripts();
77
-            } else {
78
-                $this->enqueueScripts();
79
-            }
80
-        }
81
-        return $this->shortcodeContent(
82
-            $this->sanitizeAttributes((array) $attributes)
83
-        );
84
-    }
85
-
86
-
87
-    /**
88
-     * If shortcode caching is enabled for the shortcode,
89
-     * and cached results exist, then that will be returned
90
-     * else new content will be generated.
91
-     * If caching is enabled, then the new content will be cached for later.
92
-     *
93
-     * @param array $attributes
94
-     * @return mixed|string
95
-     * @throws EE_Error
96
-     * @throws ReflectionException
97
-     */
98
-    private function shortcodeContent(array $attributes)
99
-    {
100
-        $shortcode = $this;
101
-        $post_ID = $this->currentPostID();
102
-        // something like "SC_EVENTS-123"
103
-        $cache_ID = $this->shortcodeCacheID($post_ID);
104
-        $this->cache_manager->clearPostRelatedCacheOnUpdate($post_ID, $cache_ID);
105
-        return $this->cache_manager->get(
106
-            $cache_ID,
107
-            // serialized attributes
108
-            wp_json_encode($attributes),
109
-            // Closure for generating content if cache is expired
110
-            function () use ($shortcode, $attributes) {
111
-                if ($shortcode->initialized() === false) {
112
-                    $shortcode->initializeShortcode();
113
-                }
114
-                return $shortcode->processShortcode($attributes);
115
-            },
116
-            // filterable cache expiration set by each shortcode
117
-            apply_filters(
118
-                'FHEE__EventEspresso_core_services_shortcodes_EspressoShortcode__shortcodeContent__cache_expiration',
119
-                $this->cacheExpiration(),
120
-                $this->getTag(),
121
-                $this
122
-            )
123
-        );
124
-    }
125
-
126
-
127
-    /**
128
-     * @return int
129
-     * @throws EE_Error
130
-     * @throws ReflectionException
131
-     */
132
-    private function currentPostID()
133
-    {
134
-        // try to get EE_Event any way we can
135
-        $event = EEH_Event_View::get_event();
136
-        // then get some kind of ID
137
-        if ($event instanceof EE_Event) {
138
-            return $event->ID();
139
-        }
140
-        global $post;
141
-        if ($post instanceof WP_Post) {
142
-            return $post->ID;
143
-        }
144
-        return 0;
145
-    }
146
-
147
-
148
-    /**
149
-     * @param int $post_ID
150
-     * @return string
151
-     */
152
-    private function shortcodeCacheID($post_ID)
153
-    {
154
-        $tag = str_replace('ESPRESSO_', '', $this->getTag());
155
-        return "SC_{$tag}-{$post_ID}";
156
-    }
157
-
158
-
159
-    /**
160
-     * array for defining custom attribute sanitization callbacks,
161
-     * where keys match keys in your attributes array,
162
-     * and values represent the sanitization function you wish to be applied to that attribute.
163
-     * So for example, if you had an integer attribute named "event_id"
164
-     * that you wanted to be sanitized using absint(),
165
-     * then you would return the following:
166
-     *      array('event_id' => 'absint')
167
-     * Entering 'skip_sanitization' for the callback value
168
-     * means that no sanitization will be applied
169
-     * on the assumption that the attribute
170
-     * will be sanitized at some point... right?
171
-     * You wouldn't pass around unsanitized attributes would you?
172
-     * That would be very Tom Foolery of you!!!
173
-     *
174
-     * @return array
175
-     */
176
-    protected function customAttributeSanitizationMap()
177
-    {
178
-        return array();
179
-    }
180
-
181
-
182
-    /**
183
-     * Performs basic sanitization on shortcode attributes
184
-     * Since incoming attributes from the shortcode usage in the WP editor will all be strings,
185
-     * most attributes will by default be sanitized using the sanitize_text_field() function.
186
-     * This can be overridden using the customAttributeSanitizationMap() method (see above),
187
-     * all other attributes would be sanitized using the defaults in the switch statement below
188
-     *
189
-     * @param array $attributes
190
-     * @return array
191
-     */
192
-    private function sanitizeAttributes(array $attributes)
193
-    {
194
-        $custom_sanitization = $this->customAttributeSanitizationMap();
195
-        foreach ($attributes as $key => $value) {
196
-            // is a custom sanitization callback specified ?
197
-            if (isset($custom_sanitization[ $key ])) {
198
-                $callback = $custom_sanitization[ $key ];
199
-                if ($callback === 'skip_sanitization') {
200
-                    $attributes[ $key ] = $value;
201
-                    continue;
202
-                }
203
-                if (function_exists($callback)) {
204
-                    $attributes[ $key ] = $callback($value);
205
-                    continue;
206
-                }
207
-            }
208
-            switch (true) {
209
-                case $value === null:
210
-                case is_int($value):
211
-                case is_float($value):
212
-                    // typical booleans
213
-                case in_array($value, array(true, 'true', '1', 'on', 'yes', false, 'false', '0', 'off', 'no'), true):
214
-                    $attributes[ $key ] = $value;
215
-                    break;
216
-                case is_string($value):
217
-                    $attributes[ $key ] = sanitize_text_field($value);
218
-                    break;
219
-                case is_array($value):
220
-                    $attributes[ $key ] = $this->sanitizeAttributes($value);
221
-                    break;
222
-                default:
223
-                    // only remaining data types are Object and Resource
224
-                    // which are not allowed as shortcode attributes
225
-                    $attributes[ $key ] = null;
226
-                    break;
227
-            }
228
-        }
229
-        return $attributes;
230
-    }
231
-
232
-
233
-    /**
234
-     * Returns whether or not this shortcode has been initialized
235
-     *
236
-     * @return boolean
237
-     */
238
-    public function initialized()
239
-    {
240
-        return $this->initialized;
241
-    }
23
+	/**
24
+	 * transient prefix
25
+	 *
26
+	 * @type string
27
+	 */
28
+	const CACHE_TRANSIENT_PREFIX = 'ee_sc_';
29
+
30
+	/**
31
+	 * @var PostRelatedCacheManager $cache_manager
32
+	 */
33
+	private $cache_manager;
34
+
35
+	/**
36
+	 * true if ShortcodeInterface::initializeShortcode() has been called
37
+	 * if false, then that will get called before processing
38
+	 *
39
+	 * @var boolean $initialized
40
+	 */
41
+	private $initialized = false;
42
+
43
+
44
+	/**
45
+	 * EspressoShortcode constructor
46
+	 *
47
+	 * @param PostRelatedCacheManager $cache_manager
48
+	 */
49
+	public function __construct(PostRelatedCacheManager $cache_manager)
50
+	{
51
+		$this->cache_manager = $cache_manager;
52
+	}
53
+
54
+
55
+	/**
56
+	 * @return void
57
+	 */
58
+	public function shortcodeHasBeenInitialized()
59
+	{
60
+		$this->initialized = true;
61
+	}
62
+
63
+
64
+	/**
65
+	 * enqueues scripts then processes the shortcode
66
+	 *
67
+	 * @param array $attributes
68
+	 * @return string
69
+	 * @throws EE_Error
70
+	 * @throws ReflectionException
71
+	 */
72
+	final public function processShortcodeCallback($attributes = array())
73
+	{
74
+		if ($this instanceof EnqueueAssetsInterface) {
75
+			if (is_admin()) {
76
+				$this->enqueueAdminScripts();
77
+			} else {
78
+				$this->enqueueScripts();
79
+			}
80
+		}
81
+		return $this->shortcodeContent(
82
+			$this->sanitizeAttributes((array) $attributes)
83
+		);
84
+	}
85
+
86
+
87
+	/**
88
+	 * If shortcode caching is enabled for the shortcode,
89
+	 * and cached results exist, then that will be returned
90
+	 * else new content will be generated.
91
+	 * If caching is enabled, then the new content will be cached for later.
92
+	 *
93
+	 * @param array $attributes
94
+	 * @return mixed|string
95
+	 * @throws EE_Error
96
+	 * @throws ReflectionException
97
+	 */
98
+	private function shortcodeContent(array $attributes)
99
+	{
100
+		$shortcode = $this;
101
+		$post_ID = $this->currentPostID();
102
+		// something like "SC_EVENTS-123"
103
+		$cache_ID = $this->shortcodeCacheID($post_ID);
104
+		$this->cache_manager->clearPostRelatedCacheOnUpdate($post_ID, $cache_ID);
105
+		return $this->cache_manager->get(
106
+			$cache_ID,
107
+			// serialized attributes
108
+			wp_json_encode($attributes),
109
+			// Closure for generating content if cache is expired
110
+			function () use ($shortcode, $attributes) {
111
+				if ($shortcode->initialized() === false) {
112
+					$shortcode->initializeShortcode();
113
+				}
114
+				return $shortcode->processShortcode($attributes);
115
+			},
116
+			// filterable cache expiration set by each shortcode
117
+			apply_filters(
118
+				'FHEE__EventEspresso_core_services_shortcodes_EspressoShortcode__shortcodeContent__cache_expiration',
119
+				$this->cacheExpiration(),
120
+				$this->getTag(),
121
+				$this
122
+			)
123
+		);
124
+	}
125
+
126
+
127
+	/**
128
+	 * @return int
129
+	 * @throws EE_Error
130
+	 * @throws ReflectionException
131
+	 */
132
+	private function currentPostID()
133
+	{
134
+		// try to get EE_Event any way we can
135
+		$event = EEH_Event_View::get_event();
136
+		// then get some kind of ID
137
+		if ($event instanceof EE_Event) {
138
+			return $event->ID();
139
+		}
140
+		global $post;
141
+		if ($post instanceof WP_Post) {
142
+			return $post->ID;
143
+		}
144
+		return 0;
145
+	}
146
+
147
+
148
+	/**
149
+	 * @param int $post_ID
150
+	 * @return string
151
+	 */
152
+	private function shortcodeCacheID($post_ID)
153
+	{
154
+		$tag = str_replace('ESPRESSO_', '', $this->getTag());
155
+		return "SC_{$tag}-{$post_ID}";
156
+	}
157
+
158
+
159
+	/**
160
+	 * array for defining custom attribute sanitization callbacks,
161
+	 * where keys match keys in your attributes array,
162
+	 * and values represent the sanitization function you wish to be applied to that attribute.
163
+	 * So for example, if you had an integer attribute named "event_id"
164
+	 * that you wanted to be sanitized using absint(),
165
+	 * then you would return the following:
166
+	 *      array('event_id' => 'absint')
167
+	 * Entering 'skip_sanitization' for the callback value
168
+	 * means that no sanitization will be applied
169
+	 * on the assumption that the attribute
170
+	 * will be sanitized at some point... right?
171
+	 * You wouldn't pass around unsanitized attributes would you?
172
+	 * That would be very Tom Foolery of you!!!
173
+	 *
174
+	 * @return array
175
+	 */
176
+	protected function customAttributeSanitizationMap()
177
+	{
178
+		return array();
179
+	}
180
+
181
+
182
+	/**
183
+	 * Performs basic sanitization on shortcode attributes
184
+	 * Since incoming attributes from the shortcode usage in the WP editor will all be strings,
185
+	 * most attributes will by default be sanitized using the sanitize_text_field() function.
186
+	 * This can be overridden using the customAttributeSanitizationMap() method (see above),
187
+	 * all other attributes would be sanitized using the defaults in the switch statement below
188
+	 *
189
+	 * @param array $attributes
190
+	 * @return array
191
+	 */
192
+	private function sanitizeAttributes(array $attributes)
193
+	{
194
+		$custom_sanitization = $this->customAttributeSanitizationMap();
195
+		foreach ($attributes as $key => $value) {
196
+			// is a custom sanitization callback specified ?
197
+			if (isset($custom_sanitization[ $key ])) {
198
+				$callback = $custom_sanitization[ $key ];
199
+				if ($callback === 'skip_sanitization') {
200
+					$attributes[ $key ] = $value;
201
+					continue;
202
+				}
203
+				if (function_exists($callback)) {
204
+					$attributes[ $key ] = $callback($value);
205
+					continue;
206
+				}
207
+			}
208
+			switch (true) {
209
+				case $value === null:
210
+				case is_int($value):
211
+				case is_float($value):
212
+					// typical booleans
213
+				case in_array($value, array(true, 'true', '1', 'on', 'yes', false, 'false', '0', 'off', 'no'), true):
214
+					$attributes[ $key ] = $value;
215
+					break;
216
+				case is_string($value):
217
+					$attributes[ $key ] = sanitize_text_field($value);
218
+					break;
219
+				case is_array($value):
220
+					$attributes[ $key ] = $this->sanitizeAttributes($value);
221
+					break;
222
+				default:
223
+					// only remaining data types are Object and Resource
224
+					// which are not allowed as shortcode attributes
225
+					$attributes[ $key ] = null;
226
+					break;
227
+			}
228
+		}
229
+		return $attributes;
230
+	}
231
+
232
+
233
+	/**
234
+	 * Returns whether or not this shortcode has been initialized
235
+	 *
236
+	 * @return boolean
237
+	 */
238
+	public function initialized()
239
+	{
240
+		return $this->initialized;
241
+	}
242 242
 }
Please login to merge, or discard this patch.
core/services/notices/NoticeConverterInterface.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -13,31 +13,31 @@
 block discarded – undo
13 13
 interface NoticeConverterInterface
14 14
 {
15 15
 
16
-    /**
17
-     * @return NoticesContainerInterface
18
-     */
19
-    public function getNotices();
16
+	/**
17
+	 * @return NoticesContainerInterface
18
+	 */
19
+	public function getNotices();
20 20
 
21
-    /**
22
-     * @param bool $throw_exceptions
23
-     */
24
-    public function setThrowExceptions($throw_exceptions);
21
+	/**
22
+	 * @param bool $throw_exceptions
23
+	 */
24
+	public function setThrowExceptions($throw_exceptions);
25 25
 
26
-    /**
27
-     * @return bool
28
-     */
29
-    public function getThrowExceptions();
26
+	/**
27
+	 * @return bool
28
+	 */
29
+	public function getThrowExceptions();
30 30
 
31
-    /**
32
-     * Converts NoticesContainerInterface objects into other format
33
-     *
34
-     * @param NoticesContainerInterface $notices
35
-     * @return
36
-     */
37
-    public function process(NoticesContainerInterface $notices);
31
+	/**
32
+	 * Converts NoticesContainerInterface objects into other format
33
+	 *
34
+	 * @param NoticesContainerInterface $notices
35
+	 * @return
36
+	 */
37
+	public function process(NoticesContainerInterface $notices);
38 38
 
39
-    /**
40
-     * @return void;
41
-     */
42
-    public function clearNotices();
39
+	/**
40
+	 * @return void;
41
+	 */
42
+	public function clearNotices();
43 43
 }
Please login to merge, or discard this patch.
core/services/notices/NoticeInterface.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -13,38 +13,38 @@
 block discarded – undo
13 13
 interface NoticeInterface
14 14
 {
15 15
 
16
-    /**
17
-     * @return string
18
-     */
19
-    public function type();
16
+	/**
17
+	 * @return string
18
+	 */
19
+	public function type();
20 20
 
21 21
 
22
-    /**
23
-     * @return string
24
-     */
25
-    public function message();
22
+	/**
23
+	 * @return string
24
+	 */
25
+	public function message();
26 26
 
27 27
 
28
-    /**
29
-     * @return bool
30
-     */
31
-    public function isDismissible();
28
+	/**
29
+	 * @return bool
30
+	 */
31
+	public function isDismissible();
32 32
 
33 33
 
34
-    /**
35
-     * @return string
36
-     */
37
-    public function file();
34
+	/**
35
+	 * @return string
36
+	 */
37
+	public function file();
38 38
 
39 39
 
40
-    /**
41
-     * @return string
42
-     */
43
-    public function func();
40
+	/**
41
+	 * @return string
42
+	 */
43
+	public function func();
44 44
 
45 45
 
46
-    /**
47
-     * @return string
48
-     */
49
-    public function line();
46
+	/**
47
+	 * @return string
48
+	 */
49
+	public function line();
50 50
 }
Please login to merge, or discard this patch.
core/services/locators/LocatorInterface.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -9,13 +9,13 @@
 block discarded – undo
9 9
 interface LocatorInterface
10 10
 {
11 11
 
12
-    /**
13
-     * given a string or an array of information for where to look,
14
-     * will find all files in that location
15
-     *
16
-     * @access public
17
-     * @param array|string $location
18
-     * @return \FilesystemIterator
19
-     */
20
-    public function locate($location);
12
+	/**
13
+	 * given a string or an array of information for where to look,
14
+	 * will find all files in that location
15
+	 *
16
+	 * @access public
17
+	 * @param array|string $location
18
+	 * @return \FilesystemIterator
19
+	 */
20
+	public function locate($location);
21 21
 }
Please login to merge, or discard this patch.
core/services/loaders/LoaderDecoratorInterface.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -5,18 +5,18 @@
 block discarded – undo
5 5
 interface LoaderDecoratorInterface
6 6
 {
7 7
 
8
-    /**
9
-     * @param string $fqcn
10
-     * @param array  $arguments
11
-     * @param bool   $shared
12
-     * @return mixed
13
-     */
14
-    public function load($fqcn, $arguments = array(), $shared = true);
8
+	/**
9
+	 * @param string $fqcn
10
+	 * @param array  $arguments
11
+	 * @param bool   $shared
12
+	 * @return mixed
13
+	 */
14
+	public function load($fqcn, $arguments = array(), $shared = true);
15 15
 
16 16
 
17 17
 
18
-    /**
19
-     * calls reset() on loader if method exists
20
-     */
21
-    public function reset();
18
+	/**
19
+	 * calls reset() on loader if method exists
20
+	 */
21
+	public function reset();
22 22
 }
Please login to merge, or discard this patch.
core/services/container/ContainerInterface.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -12,24 +12,24 @@
 block discarded – undo
12 12
 interface ContainerInterface
13 13
 {
14 14
 
15
-    /**
16
-     * Finds an entry of the container by its identifier and returns it.
17
-     *
18
-     * @param string $id Identifier of the entry to look for.
19
-     * @return mixed Entry.
20
-     */
21
-    public function get($id);
15
+	/**
16
+	 * Finds an entry of the container by its identifier and returns it.
17
+	 *
18
+	 * @param string $id Identifier of the entry to look for.
19
+	 * @return mixed Entry.
20
+	 */
21
+	public function get($id);
22 22
 
23 23
 
24 24
 
25
-    /**
26
-     * Returns true if the container can return an entry for the given identifier.
27
-     * Returns false otherwise.
28
-     * `has($id)` returning true does not mean that `get($id)` will not throw an exception.
29
-     * It does however mean that `get($id)` will not throw a `NotFoundException`.
30
-     *
31
-     * @param string $id Identifier of the entry to look for.
32
-     * @return boolean
33
-     */
34
-    public function has($id);
25
+	/**
26
+	 * Returns true if the container can return an entry for the given identifier.
27
+	 * Returns false otherwise.
28
+	 * `has($id)` returning true does not mean that `get($id)` will not throw an exception.
29
+	 * It does however mean that `get($id)` will not throw a `NotFoundException`.
30
+	 *
31
+	 * @param string $id Identifier of the entry to look for.
32
+	 * @return boolean
33
+	 */
34
+	public function has($id);
35 35
 }
Please login to merge, or discard this patch.
core/services/container/RecipeInterface.php 1 patch
Indentation   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -11,82 +11,82 @@
 block discarded – undo
11 11
 interface RecipeInterface
12 12
 {
13 13
 
14
-    /**
15
-     * @return string
16
-     */
17
-    public function identifier();
14
+	/**
15
+	 * @return string
16
+	 */
17
+	public function identifier();
18 18
 
19
-    /**
20
-     * @return string
21
-     */
22
-    public function fqcn();
19
+	/**
20
+	 * @return string
21
+	 */
22
+	public function fqcn();
23 23
 
24
-    /**
25
-     * @return array
26
-     */
27
-    public function ingredients();
24
+	/**
25
+	 * @return array
26
+	 */
27
+	public function ingredients();
28 28
 
29
-    /**
30
-     * @return string
31
-     */
32
-    public function type();
29
+	/**
30
+	 * @return string
31
+	 */
32
+	public function type();
33 33
 
34
-    /**
35
-     * @return array
36
-     */
37
-    public function filters();
34
+	/**
35
+	 * @return array
36
+	 */
37
+	public function filters();
38 38
 
39
-    /**
40
-     * @return array
41
-     */
42
-    public function paths();
39
+	/**
40
+	 * @return array
41
+	 */
42
+	public function paths();
43 43
 
44
-    /**
45
-     * @param  string $identifier Identifier for the entity class that the Recipe applies to
46
-     *                            Typically a Fully Qualified Class Name
47
-     */
48
-    public function setIdentifier($identifier);
44
+	/**
45
+	 * @param  string $identifier Identifier for the entity class that the Recipe applies to
46
+	 *                            Typically a Fully Qualified Class Name
47
+	 */
48
+	public function setIdentifier($identifier);
49 49
 
50
-    /**
51
-     * Ensures incoming string is a valid Fully Qualified Class Name,
52
-     * except if this is the default wildcard Recipe ( * ),
53
-     * or it's NOT an actual FQCN because the Recipe is using filepaths
54
-     * for classes that are not PSR-4 compatible
55
-     * PLZ NOTE:
56
-     *  Recipe::setFqcn() has a check to see if Recipe::$paths is empty or not,
57
-     *  therefore you should always call Recipe::setPaths() before Recipe::setFqcn()
58
-     *
59
-     * @param string $fqcn
60
-     */
61
-    public function setFqcn($fqcn);
50
+	/**
51
+	 * Ensures incoming string is a valid Fully Qualified Class Name,
52
+	 * except if this is the default wildcard Recipe ( * ),
53
+	 * or it's NOT an actual FQCN because the Recipe is using filepaths
54
+	 * for classes that are not PSR-4 compatible
55
+	 * PLZ NOTE:
56
+	 *  Recipe::setFqcn() has a check to see if Recipe::$paths is empty or not,
57
+	 *  therefore you should always call Recipe::setPaths() before Recipe::setFqcn()
58
+	 *
59
+	 * @param string $fqcn
60
+	 */
61
+	public function setFqcn($fqcn);
62 62
 
63
-    /**
64
-     * @param array $ingredients    an array of dependencies where keys are the aliases and values are the FQCNs
65
-     *                              example:
66
-     *                              array( 'ClassInterface' => 'Fully\Qualified\ClassName' )
67
-     */
68
-    public function setIngredients(array $ingredients);
63
+	/**
64
+	 * @param array $ingredients    an array of dependencies where keys are the aliases and values are the FQCNs
65
+	 *                              example:
66
+	 *                              array( 'ClassInterface' => 'Fully\Qualified\ClassName' )
67
+	 */
68
+	public function setIngredients(array $ingredients);
69 69
 
70
-    /**
71
-     * @param string $type one of the class constants returned from CoffeeMaker::getTypes()
72
-     */
73
-    public function setType($type = CoffeeMaker::BREW_NEW);
70
+	/**
71
+	 * @param string $type one of the class constants returned from CoffeeMaker::getTypes()
72
+	 */
73
+	public function setType($type = CoffeeMaker::BREW_NEW);
74 74
 
75
-    /**
76
-     * @param array $filters    an array of filters where keys are the aliases and values are the FQCNs
77
-     *                          example:
78
-     *                          array( 'ClassInterface' => 'Fully\Qualified\ClassName' )
79
-     */
80
-    public function setFilters(array $filters);
75
+	/**
76
+	 * @param array $filters    an array of filters where keys are the aliases and values are the FQCNs
77
+	 *                          example:
78
+	 *                          array( 'ClassInterface' => 'Fully\Qualified\ClassName' )
79
+	 */
80
+	public function setFilters(array $filters);
81 81
 
82
-    /**
83
-     * Ensures incoming paths is a valid filepath, or array of valid filepaths,
84
-     * and merges them in with any existing filepaths
85
-     * PLZ NOTE:
86
-     *  Recipe::setFqcn() has a check to see if Recipe::$paths is empty or not,
87
-     *  therefore you should always call Recipe::setPaths() before Recipe::setFqcn()
88
-     *
89
-     * @param string|array $paths
90
-     */
91
-    public function setPaths($paths = array());
82
+	/**
83
+	 * Ensures incoming paths is a valid filepath, or array of valid filepaths,
84
+	 * and merges them in with any existing filepaths
85
+	 * PLZ NOTE:
86
+	 *  Recipe::setFqcn() has a check to see if Recipe::$paths is empty or not,
87
+	 *  therefore you should always call Recipe::setPaths() before Recipe::setFqcn()
88
+	 *
89
+	 * @param string|array $paths
90
+	 */
91
+	public function setPaths($paths = array());
92 92
 }
Please login to merge, or discard this patch.
core/services/container/InjectorInterface.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -11,37 +11,37 @@
 block discarded – undo
11 11
 interface InjectorInterface
12 12
 {
13 13
 
14
-    /**
15
-     * getReflectionClass
16
-     * checks if a ReflectionClass object has already been generated for a class
17
-     * and returns that instead of creating a new one
18
-     *
19
-     * @access public
20
-     * @param string $class_name
21
-     * @return \ReflectionClass
22
-     */
23
-    public function getReflectionClass($class_name);
14
+	/**
15
+	 * getReflectionClass
16
+	 * checks if a ReflectionClass object has already been generated for a class
17
+	 * and returns that instead of creating a new one
18
+	 *
19
+	 * @access public
20
+	 * @param string $class_name
21
+	 * @return \ReflectionClass
22
+	 */
23
+	public function getReflectionClass($class_name);
24 24
 
25 25
 
26 26
 
27
-    /**
28
-     * resolveDependencies
29
-     * examines the constructor for the requested class to determine
30
-     * if any dependencies exist, and if they can be injected.
31
-     * If so, then those classes will be added to the array of arguments passed to the constructor
32
-     * PLZ NOTE: this is achieved by type hinting the constructor params
33
-     * For example:
34
-     *        if attempting to load a class "Foo" with the following constructor:
35
-     *        __construct( Bar $bar_class, Fighter $grohl_class )
36
-     *        then $bar_class and $grohl_class will be added to the $arguments array,
37
-     *        but only IF they are NOT already present in the incoming arguments array,
38
-     *        and the correct classes can be loaded
39
-     *
40
-     * @access public
41
-     * @param \EventEspresso\core\services\container\RecipeInterface $recipe
42
-     * @param \ReflectionClass                                       $reflector
43
-     * @param array                                                  $arguments
44
-     * @return array
45
-     */
46
-    public function resolveDependencies(RecipeInterface $recipe, \ReflectionClass $reflector, $arguments = array());
27
+	/**
28
+	 * resolveDependencies
29
+	 * examines the constructor for the requested class to determine
30
+	 * if any dependencies exist, and if they can be injected.
31
+	 * If so, then those classes will be added to the array of arguments passed to the constructor
32
+	 * PLZ NOTE: this is achieved by type hinting the constructor params
33
+	 * For example:
34
+	 *        if attempting to load a class "Foo" with the following constructor:
35
+	 *        __construct( Bar $bar_class, Fighter $grohl_class )
36
+	 *        then $bar_class and $grohl_class will be added to the $arguments array,
37
+	 *        but only IF they are NOT already present in the incoming arguments array,
38
+	 *        and the correct classes can be loaded
39
+	 *
40
+	 * @access public
41
+	 * @param \EventEspresso\core\services\container\RecipeInterface $recipe
42
+	 * @param \ReflectionClass                                       $reflector
43
+	 * @param array                                                  $arguments
44
+	 * @return array
45
+	 */
46
+	public function resolveDependencies(RecipeInterface $recipe, \ReflectionClass $reflector, $arguments = array());
47 47
 }
Please login to merge, or discard this patch.
core/services/container/CoffeePotInterface.php 1 patch
Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -12,68 +12,68 @@
 block discarded – undo
12 12
 
13 13
 
14 14
 
15
-    /**
16
-     * returns an instance of the requested entity type using the supplied arguments.
17
-     * If a shared service is requested and an instance is already in the carafe, then it will be returned.
18
-     * If it is not already in the carafe, then the service will be constructed, added to the carafe, and returned
19
-     * If the request is for a new entity and a closure exists in the reservoir for creating it,
20
-     * then a new entity will be instantiated from the closure and returned.
21
-     * If a closure does not exist, then one will be built and added to the reservoir
22
-     * before instantiating the requested entity.
23
-     *
24
-     * @param  string $identifier Identifier for the entity class to be constructed.
25
-     *                            Typically a Fully Qualified Class Name
26
-     * @param array   $arguments  an array of arguments to be passed to the entity constructor
27
-     * @param string  $type
28
-     * @return mixed
29
-     */
30
-    public function brew($identifier, $arguments = array(), $type = '');
31
-
32
-
33
-
34
-    /**
35
-     * @param string   $identifier
36
-     * @param callable $closure
37
-     */
38
-    public function addClosure($identifier, $closure);
39
-
40
-
41
-
42
-    /**
43
-     * @param string $identifier
44
-     * @param mixed  $service
45
-     * @return boolean
46
-     */
47
-    public function addService($identifier, $service);
48
-
49
-
50
-
51
-    /**
52
-     * Adds instructions on how to brew objects
53
-     *
54
-     * @param RecipeInterface $recipe
55
-     * @return mixed
56
-     */
57
-    public function addRecipe(RecipeInterface $recipe);
58
-
59
-
60
-
61
-    /**
62
-     * Get instructions on how to brew objects
63
-     *
64
-     * @param string $identifier
65
-     * @return Recipe
66
-     */
67
-    public function getRecipe($identifier);
68
-
69
-
70
-
71
-    /**
72
-     * adds class name aliases to list of filters
73
-     *
74
-     * @param  string $identifier
75
-     * @param  array  $aliases
76
-     * @return string
77
-     */
78
-    public function addAliases($identifier, $aliases);
15
+	/**
16
+	 * returns an instance of the requested entity type using the supplied arguments.
17
+	 * If a shared service is requested and an instance is already in the carafe, then it will be returned.
18
+	 * If it is not already in the carafe, then the service will be constructed, added to the carafe, and returned
19
+	 * If the request is for a new entity and a closure exists in the reservoir for creating it,
20
+	 * then a new entity will be instantiated from the closure and returned.
21
+	 * If a closure does not exist, then one will be built and added to the reservoir
22
+	 * before instantiating the requested entity.
23
+	 *
24
+	 * @param  string $identifier Identifier for the entity class to be constructed.
25
+	 *                            Typically a Fully Qualified Class Name
26
+	 * @param array   $arguments  an array of arguments to be passed to the entity constructor
27
+	 * @param string  $type
28
+	 * @return mixed
29
+	 */
30
+	public function brew($identifier, $arguments = array(), $type = '');
31
+
32
+
33
+
34
+	/**
35
+	 * @param string   $identifier
36
+	 * @param callable $closure
37
+	 */
38
+	public function addClosure($identifier, $closure);
39
+
40
+
41
+
42
+	/**
43
+	 * @param string $identifier
44
+	 * @param mixed  $service
45
+	 * @return boolean
46
+	 */
47
+	public function addService($identifier, $service);
48
+
49
+
50
+
51
+	/**
52
+	 * Adds instructions on how to brew objects
53
+	 *
54
+	 * @param RecipeInterface $recipe
55
+	 * @return mixed
56
+	 */
57
+	public function addRecipe(RecipeInterface $recipe);
58
+
59
+
60
+
61
+	/**
62
+	 * Get instructions on how to brew objects
63
+	 *
64
+	 * @param string $identifier
65
+	 * @return Recipe
66
+	 */
67
+	public function getRecipe($identifier);
68
+
69
+
70
+
71
+	/**
72
+	 * adds class name aliases to list of filters
73
+	 *
74
+	 * @param  string $identifier
75
+	 * @param  array  $aliases
76
+	 * @return string
77
+	 */
78
+	public function addAliases($identifier, $aliases);
79 79
 }
Please login to merge, or discard this patch.