Completed
Branch FET-9795-new-interfaces (ea072c)
by
unknown
19:19
created
core/exceptions/InvalidIdentifierException.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 namespace EventEspresso\Core\Exceptions;
3 3
 
4
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
5
-	exit( 'No direct script access allowed' );
4
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
5
+	exit('No direct script access allowed');
6 6
 }
7 7
 /**
8 8
  * Class InvalidIdentifierException
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
 	  * @param int        $code
24 24
 	  * @param \Exception $previous
25 25
 	  */
26
-	 public function __construct( $actual, $expected, $message = '', $code = 0, \Exception $previous = null ) {
27
-		 if ( empty( $message ) ) {
26
+	 public function __construct($actual, $expected, $message = '', $code = 0, \Exception $previous = null) {
27
+		 if (empty($message)) {
28 28
 			 $message = sprintf(
29 29
 				 __(
30 30
 					 'The supplied identifier "%1$s" is invalid. A value like "%2$s" was expected.',
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 				 $expected
35 35
 			 );
36 36
 		 }
37
-		 parent::__construct( $message, $code, $previous );
37
+		 parent::__construct($message, $code, $previous);
38 38
 	 }
39 39
 
40 40
  }
Please login to merge, or discard this patch.
core/exceptions/InvalidEntityException.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 namespace EventEspresso\Core\Exceptions;
3 3
 
4
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
5
-	exit( 'No direct script access allowed' );
4
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
5
+	exit('No direct script access allowed');
6 6
 }
7 7
 /**
8 8
  * Class InvalidIdentifierException
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
 	  * @param int        $code
24 24
 	  * @param \Exception $previous
25 25
 	  */
26
-	 public function __construct( $actual, $expected, $message = '', $code = 0, \Exception $previous = null ) {
27
-		 if ( empty( $message ) ) {
26
+	 public function __construct($actual, $expected, $message = '', $code = 0, \Exception $previous = null) {
27
+		 if (empty($message)) {
28 28
 			 $message = sprintf(
29 29
 				 __(
30 30
 					 'The supplied identifier "%1$s" is invalid. A value like "%2$s" was expected.',
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 				 $expected
35 35
 			 );
36 36
 		 }
37
-		 parent::__construct( $message, $code, $previous );
37
+		 parent::__construct($message, $code, $previous);
38 38
 	 }
39 39
 
40 40
  }
Please login to merge, or discard this patch.
templates/reg_admin_details_main_meta_box_reg_details.template.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,37 +1,37 @@  discard block
 block discarded – undo
1 1
 <div id="admin-primary-mbox-reg-details-dv" class="admin-primary-mbox-dv">
2 2
 
3
-	<?php do_action( 'AHEE__reg_admin_details_main_meta_box_reg_details__top', $REG_ID ); ?>
3
+	<?php do_action('AHEE__reg_admin_details_main_meta_box_reg_details__top', $REG_ID); ?>
4 4
 	<?php echo $resend_registration_button; ?>
5 5
 	<?php echo $view_transaction_button; ?>
6 6
 	<br/>
7 7
 
8
-	<h3 class="admin-primary-mbox-h4 hdr-has-icon"><span class="dashicons dashicons-clipboard"></span><?php _e( 'Registration Items', 'event_espresso' );?></h3>
8
+	<h3 class="admin-primary-mbox-h4 hdr-has-icon"><span class="dashicons dashicons-clipboard"></span><?php _e('Registration Items', 'event_espresso'); ?></h3>
9 9
 
10 10
 	<?php echo $line_item_table; ?>
11 11
 
12 12
 	<?php
13
-	if ( WP_DEBUG ) {
14
-		$delivered_messages = get_option( 'EED_Messages__maybe_registration', array() );
15
-		if ( isset( $delivered_messages[ $REG_ID ] )) {
13
+	if (WP_DEBUG) {
14
+		$delivered_messages = get_option('EED_Messages__maybe_registration', array());
15
+		if (isset($delivered_messages[$REG_ID])) {
16 16
 	?>
17
-	<h4 class="admin-primary-mbox-h4 hdr-has-icon"><span class="dashicons dashicons-email-alt"></span><?php _e( 'Messages Sent to Registrant', 'event_espresso' );?></h4>
17
+	<h4 class="admin-primary-mbox-h4 hdr-has-icon"><span class="dashicons dashicons-email-alt"></span><?php _e('Messages Sent to Registrant', 'event_espresso'); ?></h4>
18 18
 
19 19
 	<div class="admin-primary-mbox-tbl-wrap">
20 20
 		<table class="admin-primary-mbox-tbl">
21 21
 			<thead>
22 22
 				<tr>
23
-					<th class="jst-left"><?php _e( 'Date & Time', 'event_espresso' );?></th>
24
-					<th class="jst-left"><?php _e( 'Message Type', 'event_espresso' );?></th>
25
-					<th class="jst-left"><?php _e( 'REG Status Upon Sending', 'event_espresso' );?></th>
23
+					<th class="jst-left"><?php _e('Date & Time', 'event_espresso'); ?></th>
24
+					<th class="jst-left"><?php _e('Message Type', 'event_espresso'); ?></th>
25
+					<th class="jst-left"><?php _e('REG Status Upon Sending', 'event_espresso'); ?></th>
26 26
 				</tr>
27 27
 			</thead>
28 28
 			<tbody>
29
-				<?php foreach ( $delivered_messages[ $REG_ID ] as $timestamp => $delivered_message ) :
29
+				<?php foreach ($delivered_messages[$REG_ID] as $timestamp => $delivered_message) :
30 30
 					?>
31 31
 					<tr>
32
-						<td class="jst-left"><?php echo gmdate( get_option('date_format') . ' ' . get_option('time_format'), ( $timestamp + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) );?></td>
33
-						<td class="jst-left"><?php echo isset( $delivered_message['message_type'] ) ? $delivered_message['message_type'] : '';?></td>
34
-						<td class="jst-left"><?php echo isset( $delivered_message['reg_status'] ) ? $delivered_message['reg_status'] : '';?></td>
32
+						<td class="jst-left"><?php echo gmdate(get_option('date_format').' '.get_option('time_format'), ($timestamp + (get_option('gmt_offset') * HOUR_IN_SECONDS))); ?></td>
33
+						<td class="jst-left"><?php echo isset($delivered_message['message_type']) ? $delivered_message['message_type'] : ''; ?></td>
34
+						<td class="jst-left"><?php echo isset($delivered_message['reg_status']) ? $delivered_message['reg_status'] : ''; ?></td>
35 35
 					</tr>
36 36
 				<?php endforeach; // $delivered_messages?>
37 37
 			</tbody>
@@ -43,27 +43,27 @@  discard block
 block discarded – undo
43 43
 	?>
44 44
 
45 45
 	<a id="display-additional-registration-session-info" class="display-the-hidden smaller-text" rel="additional-registration-session-info">
46
-		<span class="dashicons dashicons-plus-alt"></span><?php _e( 'view additional registration session details', 'event_espresso' );?>
46
+		<span class="dashicons dashicons-plus-alt"></span><?php _e('view additional registration session details', 'event_espresso'); ?>
47 47
 	</a>
48 48
 
49 49
 	<div id="additional-registration-session-info-dv" class="hidden">
50 50
 
51 51
 		<a id="hide-additional-registration-session-info" class="hide-the-displayed hidden smaller-text" rel="additional-registration-session-info">
52
-			<span class="dashicons dashicons-dismiss"></span><?php _e( 'hide additional registration session details', 'event_espresso' );?>
52
+			<span class="dashicons dashicons-dismiss"></span><?php _e('hide additional registration session details', 'event_espresso'); ?>
53 53
 		</a>
54 54
 	<br class="clear"/>
55 55
 
56
-		<h3 class="admin-primary-mbox-h4"><?php _e( 'Registration Session Details', 'event_espresso' );?></h3>
56
+		<h3 class="admin-primary-mbox-h4"><?php _e('Registration Session Details', 'event_espresso'); ?></h3>
57 57
 
58 58
 		<table id="admin-primary-mbox-reg-extra-session-info-tbl" class="form-table skinny-rows">
59 59
 			<tbody>
60
-			<?php foreach ( $reg_details as $key => $reg_detail ) : ?>
60
+			<?php foreach ($reg_details as $key => $reg_detail) : ?>
61 61
 				<tr>
62 62
 					<th>
63
-						<label for="<?php echo $key;?>"><?php echo $reg_detail['label'];?></label>
63
+						<label for="<?php echo $key; ?>"><?php echo $reg_detail['label']; ?></label>
64 64
 					</th>
65 65
 					<td>
66
-						<?php echo $reg_detail['value'];?>
66
+						<?php echo $reg_detail['value']; ?>
67 67
 					</td>
68 68
 				</tr>
69 69
 			<?php endforeach; // $reg_details?>
Please login to merge, or discard this patch.
core/Psr4Autoloader.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 	 * Loads the class file for a given class name.
133 133
 	 *
134 134
 	 * @param string $class The fully-qualified class name.
135
-	 * @return mixed The mapped file name on success, or boolean false on
135
+	 * @return string|false The mapped file name on success, or boolean false on
136 136
 	 * failure.
137 137
 	 */
138 138
 	public function loadClass( $class ) {
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 	 *
166 166
 	 * @param string $prefix The namespace prefix.
167 167
 	 * @param string $relative_class The relative class name.
168
-	 * @return mixed Boolean false if no mapped file can be loaded, or the
168
+	 * @return string|false Boolean false if no mapped file can be loaded, or the
169 169
 	 * name of the mapped file that was loaded.
170 170
 	 */
171 171
 	protected function loadMappedFile( $prefix, $relative_class ) {
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -77,10 +77,10 @@  discard block
 block discarded – undo
77 77
 	 * @param string $prefix
78 78
 	 * @return array
79 79
 	 */
80
-	public function prefixes( $prefix = '' ) {
81
-		if ( ! empty( $prefix ) ) {
80
+	public function prefixes($prefix = '') {
81
+		if ( ! empty($prefix)) {
82 82
 			// are there any base directories for this namespace prefix?
83
-			return isset( $this->prefixes[ $prefix ] ) ? $this->prefixes[ $prefix ] : array();
83
+			return isset($this->prefixes[$prefix]) ? $this->prefixes[$prefix] : array();
84 84
 		}
85 85
 		return $this->prefixes;
86 86
 	}
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	 * @return void
94 94
 	 */
95 95
 	public function register() {
96
-		spl_autoload_register( array( $this, 'loadClass' ) );
96
+		spl_autoload_register(array($this, 'loadClass'));
97 97
 	}
98 98
 
99 99
 
@@ -109,20 +109,20 @@  discard block
 block discarded – undo
109 109
 	 * than last.
110 110
 	 * @return void
111 111
 	 */
112
-	public function addNamespace( $prefix, $base_dir, $prepend = false ) {
112
+	public function addNamespace($prefix, $base_dir, $prepend = false) {
113 113
 		// normalize namespace prefix
114
-		$prefix = trim( $prefix, Psr4Autoloader::NS ) . Psr4Autoloader::NS;
114
+		$prefix = trim($prefix, Psr4Autoloader::NS).Psr4Autoloader::NS;
115 115
 		// normalize the base directory with a trailing separator
116
-		$base_dir = \EEH_File::standardise_and_end_with_directory_separator( $base_dir );
116
+		$base_dir = \EEH_File::standardise_and_end_with_directory_separator($base_dir);
117 117
 		// initialize the namespace prefix array
118
-		if ( isset( $this->prefixes[ $prefix ] ) === false ) {
119
-			$this->prefixes[ $prefix ] = array();
118
+		if (isset($this->prefixes[$prefix]) === false) {
119
+			$this->prefixes[$prefix] = array();
120 120
 		}
121 121
 		// retain the base directory for the namespace prefix
122
-		if ( $prepend ) {
123
-			array_unshift( $this->prefixes[ $prefix ], $base_dir );
122
+		if ($prepend) {
123
+			array_unshift($this->prefixes[$prefix], $base_dir);
124 124
 		} else {
125
-			$this->prefixes[ $prefix ][] = $base_dir;
125
+			$this->prefixes[$prefix][] = $base_dir;
126 126
 		}
127 127
 	}
128 128
 
@@ -135,24 +135,24 @@  discard block
 block discarded – undo
135 135
 	 * @return mixed The mapped file name on success, or boolean false on
136 136
 	 * failure.
137 137
 	 */
138
-	public function loadClass( $class ) {
138
+	public function loadClass($class) {
139 139
 		// the current namespace prefix
140 140
 		$prefix = $class;
141 141
 		// work backwards through the namespace names of the fully-qualified
142 142
 		// class name to find a mapped file name
143
-		while ( false !== $pos = strrpos( $prefix, Psr4Autoloader::NS ) ) {
143
+		while (false !== $pos = strrpos($prefix, Psr4Autoloader::NS)) {
144 144
 			// retain the trailing namespace separator in the prefix
145
-			$prefix = substr( $class, 0, $pos + 1 );
145
+			$prefix = substr($class, 0, $pos + 1);
146 146
 			// the rest is the relative class name
147
-			$relative_class = substr( $class, $pos + 1 );
147
+			$relative_class = substr($class, $pos + 1);
148 148
 			// try to load a mapped file for the prefix and relative class
149
-			$mapped_file = $this->loadMappedFile( $prefix, $relative_class );
150
-			if ( $mapped_file ) {
149
+			$mapped_file = $this->loadMappedFile($prefix, $relative_class);
150
+			if ($mapped_file) {
151 151
 				return $mapped_file;
152 152
 			}
153 153
 			// remove the trailing namespace separator for the next iteration
154 154
 			// of strrpos()
155
-			$prefix = rtrim( $prefix, Psr4Autoloader::NS );
155
+			$prefix = rtrim($prefix, Psr4Autoloader::NS);
156 156
 		}
157 157
 		// never found a mapped file
158 158
 		return false;
@@ -168,17 +168,17 @@  discard block
 block discarded – undo
168 168
 	 * @return mixed Boolean false if no mapped file can be loaded, or the
169 169
 	 * name of the mapped file that was loaded.
170 170
 	 */
171
-	protected function loadMappedFile( $prefix, $relative_class ) {
171
+	protected function loadMappedFile($prefix, $relative_class) {
172 172
 		// look through base directories for this namespace prefix
173
-		foreach ( $this->prefixes( $prefix ) as $base_dir ) {
173
+		foreach ($this->prefixes($prefix) as $base_dir) {
174 174
 			// replace the namespace prefix with the base directory,
175 175
 			// replace namespace separators with directory separators
176 176
 			// in the relative class name, append with .php
177 177
 			$file = $base_dir
178
-				. str_replace( Psr4Autoloader::NS, DS, $relative_class )
178
+				. str_replace(Psr4Autoloader::NS, DS, $relative_class)
179 179
 				. '.php';
180 180
 			// if the mapped file exists, require it
181
-			if ( $this->requireFile( $file ) ) {
181
+			if ($this->requireFile($file)) {
182 182
 				// yes, we're done
183 183
 				return $file;
184 184
 			}
@@ -195,8 +195,8 @@  discard block
 block discarded – undo
195 195
 	 * @param string $file The file to require.
196 196
 	 * @return bool True if the file exists, false if not.
197 197
 	 */
198
-	protected function requireFile( $file ) {
199
-		if ( file_exists( $file ) ) {
198
+	protected function requireFile($file) {
199
+		if (file_exists($file)) {
200 200
 			require $file;
201 201
 			return true;
202 202
 		}
Please login to merge, or discard this patch.
core/services/locators/FqcnLocator.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
 	 * given a valid namespace, will find all files that match the provided mask
78 78
 	 *
79 79
 	 * @access public
80
-	 * @param string|array $namespaces
80
+	 * @param string $namespaces
81 81
 	 * @return FilesystemIterator
82 82
 	 * @throws \EventEspresso\Core\Exceptions\InvalidClassException
83 83
 	 * @throws \EventEspresso\Core\Exceptions\InvalidDataTypeException
Please login to merge, or discard this patch.
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
 use EventEspresso\Core\Psr4Autoloader;
7 7
 use FilesystemIterator;
8 8
 
9
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
10
-	exit( 'No direct script access allowed' );
9
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
10
+	exit('No direct script access allowed');
11 11
 }
12 12
 
13 13
 
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
 	 * @param string $namespace_base_dir
41 41
 	 * @throws \EventEspresso\Core\Exceptions\InvalidDataTypeException
42 42
 	 */
43
-	protected function setNamespace( $namespace, $namespace_base_dir ) {
44
-		if ( ! is_string( $namespace ) ) {
45
-			throw new InvalidDataTypeException( '$namespace', $namespace, 'string' );
43
+	protected function setNamespace($namespace, $namespace_base_dir) {
44
+		if ( ! is_string($namespace)) {
45
+			throw new InvalidDataTypeException('$namespace', $namespace, 'string');
46 46
 		}
47
-		if ( ! is_string( $namespace_base_dir ) ) {
48
-			throw new InvalidDataTypeException( '$namespace_base_dir', $namespace_base_dir, 'string' );
47
+		if ( ! is_string($namespace_base_dir)) {
48
+			throw new InvalidDataTypeException('$namespace_base_dir', $namespace_base_dir, 'string');
49 49
 		}
50
-		$this->namespaces[ $namespace ] = $namespace_base_dir;
50
+		$this->namespaces[$namespace] = $namespace_base_dir;
51 51
 	}
52 52
 
53 53
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	 * @return int
68 68
 	 */
69 69
 	public function count() {
70
-		return count( $this->FQCNs );
70
+		return count($this->FQCNs);
71 71
 	}
72 72
 
73 73
 
@@ -82,13 +82,13 @@  discard block
 block discarded – undo
82 82
 	 * @throws \EventEspresso\Core\Exceptions\InvalidClassException
83 83
 	 * @throws \EventEspresso\Core\Exceptions\InvalidDataTypeException
84 84
 	 */
85
-	public function locate( $namespaces ) {
86
-		if ( ! ( is_string( $namespaces ) || is_array( $namespaces ) ) ) {
87
-			throw new InvalidDataTypeException( '$namespaces', $namespaces, 'string or array' );
85
+	public function locate($namespaces) {
86
+		if ( ! (is_string($namespaces) || is_array($namespaces))) {
87
+			throw new InvalidDataTypeException('$namespaces', $namespaces, 'string or array');
88 88
 		}
89
-		foreach ( (array) $namespaces as $namespace ) {
90
-			foreach ( $this->FindFQCNsByNamespace( $namespace ) as $key => $file ) {
91
-				$this->FQCNs[ $key ] = $file;
89
+		foreach ((array) $namespaces as $namespace) {
90
+			foreach ($this->FindFQCNsByNamespace($namespace) as $key => $file) {
91
+				$this->FQCNs[$key] = $file;
92 92
 			}
93 93
 		}
94 94
 		return $this->FQCNs;
@@ -107,24 +107,24 @@  discard block
 block discarded – undo
107 107
 	 * @throws \EventEspresso\Core\Exceptions\InvalidClassException
108 108
 	 * @throws \EventEspresso\Core\Exceptions\InvalidDataTypeException
109 109
 	 */
110
-	protected function FindFQCNsByNamespace( $partial_namespace ) {
110
+	protected function FindFQCNsByNamespace($partial_namespace) {
111 111
 		$iterator = new FilesystemIterator(
112
-			$this->getDirectoryFromPartialNamespace( $partial_namespace )
112
+			$this->getDirectoryFromPartialNamespace($partial_namespace)
113 113
 		);
114
-		foreach ( $this->flags as $flag ) {
115
-			$iterator->setFlags( $flag );
114
+		foreach ($this->flags as $flag) {
115
+			$iterator->setFlags($flag);
116 116
 		}
117
-		if ( iterator_count( $iterator ) === 0 ) {
117
+		if (iterator_count($iterator) === 0) {
118 118
 			return array();
119 119
 		}
120
-		foreach ( $iterator as $file ) {
121
-			$file = \EEH_File::standardise_directory_separators( $file );
122
-			foreach ( $this->namespaces as $namespace => $base_dir ) {
120
+		foreach ($iterator as $file) {
121
+			$file = \EEH_File::standardise_directory_separators($file);
122
+			foreach ($this->namespaces as $namespace => $base_dir) {
123 123
 				$namespace .= Psr4Autoloader::NS;
124
-				if ( strpos( $file, $base_dir ) === 0 ) {
125
-					$this->FQCNs[] = Psr4Autoloader::NS . str_replace(
126
-							array( $base_dir, DS, '.php' ),
127
-							array( $namespace, Psr4Autoloader::NS, '' ),
124
+				if (strpos($file, $base_dir) === 0) {
125
+					$this->FQCNs[] = Psr4Autoloader::NS.str_replace(
126
+							array($base_dir, DS, '.php'),
127
+							array($namespace, Psr4Autoloader::NS, ''),
128 128
 							$file
129 129
 						);
130 130
 				}
@@ -144,25 +144,25 @@  discard block
 block discarded – undo
144 144
 	 * @throws \EventEspresso\Core\Exceptions\InvalidDataTypeException
145 145
 	 * @throws \EventEspresso\Core\Exceptions\InvalidClassException
146 146
 	 */
147
-	protected function getDirectoryFromPartialNamespace( $partial_namespace ) {
148
-		if ( empty( $partial_namespace ) ) {
149
-			throw new InvalidClassException( $partial_namespace );
147
+	protected function getDirectoryFromPartialNamespace($partial_namespace) {
148
+		if (empty($partial_namespace)) {
149
+			throw new InvalidClassException($partial_namespace);
150 150
 		}
151 151
 		// load our PSR-4 Autoloader so we can get the list of registered namespaces from it
152 152
 		$psr4_loader = \EE_Psr4AutoloaderInit::psr4_loader();
153 153
 		// breakup the incoming namespace into segments then loop thru them
154
-		$namespace_segments = explode( Psr4Autoloader::NS, trim( $partial_namespace, Psr4Autoloader::NS ) );
154
+		$namespace_segments = explode(Psr4Autoloader::NS, trim($partial_namespace, Psr4Autoloader::NS));
155 155
 		// we're only interested in the first element, so pull that from the array
156
-		$namespace = array_shift( $namespace_segments );
156
+		$namespace = array_shift($namespace_segments);
157 157
 		// check if there's a base directory registered for that namespace
158
-		$prefix = $psr4_loader->prefixes( $namespace . Psr4Autoloader::NS );
158
+		$prefix = $psr4_loader->prefixes($namespace.Psr4Autoloader::NS);
159 159
 		// nope? then the incoming namespace is invalid
160
-		if ( empty( $prefix ) || empty( $prefix[0] ) ) {
161
-			throw new InvalidClassException( $partial_namespace );
160
+		if (empty($prefix) || empty($prefix[0])) {
161
+			throw new InvalidClassException($partial_namespace);
162 162
 		}
163
-		$this->setNamespace( $namespace, $prefix[0] );
163
+		$this->setNamespace($namespace, $prefix[0]);
164 164
 		// but if it's good, add that base directory to the rest of the path, and return it
165
-		return $prefix[0] . implode( DS, $namespace_segments ) . DS;
165
+		return $prefix[0].implode(DS, $namespace_segments).DS;
166 166
 	}
167 167
 
168 168
 
Please login to merge, or discard this patch.
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace EventEspresso\core\services\locators;
3 3
 
4
-use  EventEspresso\core\exceptions\InvalidClassException;
5
-use  EventEspresso\core\exceptions\InvalidDataTypeException;
4
+use EventEspresso\core\exceptions\InvalidClassException;
5
+use EventEspresso\core\exceptions\InvalidDataTypeException;
6 6
 use EventEspresso\Core\Psr4Autoloader;
7 7
 use FilesystemIterator;
8 8
 
Please login to merge, or discard this patch.
core/services/locators/Locator.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@  discard block
 block discarded – undo
5 5
 use EventEspresso\Core\Exceptions\InvalidDataTypeException;
6 6
 use FilesystemIterator;
7 7
 
8
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
9
-	exit( 'No direct script access allowed' );
8
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
9
+	exit('No direct script access allowed');
10 10
 }
11 11
 
12 12
 
@@ -35,15 +35,15 @@  discard block
 block discarded – undo
35 35
 	 * @param array $flags controls how files are found and/or file data is returned
36 36
 	 * @throws \EventEspresso\Core\Exceptions\InvalidDataTypeException
37 37
 	 */
38
-	public function __construct( $flags = array() ) {
39
-		if ( empty( $flags ) ) {
38
+	public function __construct($flags = array()) {
39
+		if (empty($flags)) {
40 40
 			$flags = array(
41 41
 				FilesystemIterator::SKIP_DOTS,
42 42
 				FilesystemIterator::UNIX_PATHS,
43 43
 				FilesystemIterator::CURRENT_AS_PATHNAME
44 44
 			);
45 45
 		}
46
-		$this->setFlags( $flags );
46
+		$this->setFlags($flags);
47 47
 	}
48 48
 
49 49
 
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
 	 * @param array $flags
55 55
 	 * @throws \EventEspresso\Core\Exceptions\InvalidDataTypeException
56 56
 	 */
57
-	public function setFlags( $flags ) {
58
-		if ( ! is_array( $flags ) ) {
59
-			throw new InvalidDataTypeException( '$flags', $flags, 'array' );
57
+	public function setFlags($flags) {
58
+		if ( ! is_array($flags)) {
59
+			throw new InvalidDataTypeException('$flags', $flags, 'array');
60 60
 		}
61 61
 		$this->flags = $flags;
62 62
 	}
Please login to merge, or discard this patch.
core/services/locators/FileLocator.php 2 patches
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@  discard block
 block discarded – undo
5 5
 use FilesystemIterator;
6 6
 use GlobIterator;
7 7
 
8
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
9
-	exit( 'No direct script access allowed' );
8
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
9
+	exit('No direct script access allowed');
10 10
 }
11 11
 
12 12
 
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
 	 * @param string $file_mask
39 39
 	 * @throws \EventEspresso\Core\Exceptions\InvalidDataTypeException
40 40
 	 */
41
-	public function setFileMask( $file_mask ) {
42
-		if ( ! is_string( $file_mask ) ) {
43
-			throw new InvalidDataTypeException( '$file_mask', $file_mask, 'string' );
41
+	public function setFileMask($file_mask) {
42
+		if ( ! is_string($file_mask)) {
43
+			throw new InvalidDataTypeException('$file_mask', $file_mask, 'string');
44 44
 		}
45 45
 		$this->file_mask = $file_mask;
46 46
 	}
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	 * @return int
64 64
 	 */
65 65
 	public function count() {
66
-		return count( $this->filepaths );
66
+		return count($this->filepaths);
67 67
 	}
68 68
 
69 69
 
@@ -77,13 +77,13 @@  discard block
 block discarded – undo
77 77
 	 * @return \FilesystemIterator
78 78
 	 * @throws \EventEspresso\Core\Exceptions\InvalidDataTypeException
79 79
 	 */
80
-	public function locate( $directory_paths ) {
81
-		if ( ! ( is_string( $directory_paths ) || is_array( $directory_paths ) ) ) {
82
-			throw new InvalidDataTypeException( '$directory_paths', $directory_paths, 'string or array' );
80
+	public function locate($directory_paths) {
81
+		if ( ! (is_string($directory_paths) || is_array($directory_paths))) {
82
+			throw new InvalidDataTypeException('$directory_paths', $directory_paths, 'string or array');
83 83
 		}
84
-		foreach ( (array) $directory_paths as $directory_path ) {
85
-			foreach ( $this->findFilesByPath( $directory_path ) as $key => $file ) {
86
-				$this->filepaths[ $key ] = \EEH_File::standardise_directory_separators( $file );
84
+		foreach ((array) $directory_paths as $directory_path) {
85
+			foreach ($this->findFilesByPath($directory_path) as $key => $file) {
86
+				$this->filepaths[$key] = \EEH_File::standardise_directory_separators($file);
87 87
 			}
88 88
 		}
89 89
 		return $this->filepaths;
@@ -98,12 +98,12 @@  discard block
 block discarded – undo
98 98
 	 * @param string $directory_path
99 99
 	 * @return \FilesystemIterator
100 100
 	 */
101
-	protected function findFilesByPath( $directory_path = '' ) {
102
-		$iterator = new GlobIterator (
103
-			\EEH_File::end_with_directory_separator( $directory_path ) . $this->file_mask
101
+	protected function findFilesByPath($directory_path = '') {
102
+		$iterator = new GlobIterator(
103
+			\EEH_File::end_with_directory_separator($directory_path).$this->file_mask
104 104
 		);
105
-		foreach ( $this->flags as $flag ) {
106
-			$iterator->setFlags( $flag );
105
+		foreach ($this->flags as $flag) {
106
+			$iterator->setFlags($flag);
107 107
 		}
108 108
 		return $iterator;
109 109
 	}
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace EventEspresso\core\services\locators;
3 3
 
4
-use  EventEspresso\core\exceptions\InvalidDataTypeException;
4
+use EventEspresso\core\exceptions\InvalidDataTypeException;
5 5
 use FilesystemIterator;
6 6
 use GlobIterator;
7 7
 
Please login to merge, or discard this patch.
core/services/locators/LocatorInterface.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 namespace EventEspresso\core\services\locators;
3 3
 
4
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
5
-	exit( 'No direct script access allowed' );
4
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
5
+	exit('No direct script access allowed');
6 6
 }
7 7
 
8 8
 
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 	 * @param array|string $location
23 23
 	 * @return \FilesystemIterator
24 24
 	 */
25
-	public function locate( $location );
25
+	public function locate($location);
26 26
 
27 27
 }
28 28
 // End of file LocatorInterface.php
Please login to merge, or discard this patch.
core/services/collections/CollectionLoader.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -165,7 +165,7 @@
 block discarded – undo
165 165
 	 *
166 166
 	 * @access protected
167 167
 	 * @param  $entity
168
-	 * @param  mixed $identifier
168
+	 * @param  string $identifier
169 169
 	 * @return string
170 170
 	 */
171 171
 	protected function addEntityToCollection( $entity, $identifier ) {
Please login to merge, or discard this patch.
Unused Use Statements   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace EventEspresso\core\services\collections;
3 3
 
4
-use  EventEspresso\core\exceptions\InvalidClassException;
5
-use  EventEspresso\core\exceptions\InvalidDataTypeException;
6
-use  EventEspresso\core\exceptions\InvalidEntityException;
7
-use  EventEspresso\core\exceptions\InvalidFilePathException;
4
+use EventEspresso\core\exceptions\InvalidClassException;
5
+use EventEspresso\core\exceptions\InvalidDataTypeException;
6
+use EventEspresso\core\exceptions\InvalidEntityException;
7
+use EventEspresso\core\exceptions\InvalidFilePathException;
8 8
 use EventEspresso\core\services\locators\LocatorInterface;
9 9
 use EventEspresso\core\services\locators\FileLocator;
10 10
 
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@  discard block
 block discarded – undo
8 8
 use EventEspresso\core\services\locators\LocatorInterface;
9 9
 use EventEspresso\core\services\locators\FileLocator;
10 10
 
11
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
12
-	exit( 'No direct script access allowed' );
11
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
12
+	exit('No direct script access allowed');
13 13
 }
14 14
 
15 15
 
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
 		LocatorInterface $file_locator = null
82 82
 	) {
83 83
 		$this->collection_details = $collection_details;
84
-		if ( ! $collection instanceof CollectionInterface ) {
85
-			$collection = new Collection( $this->collection_details->getCollectionInterface() );
84
+		if ( ! $collection instanceof CollectionInterface) {
85
+			$collection = new Collection($this->collection_details->getCollectionInterface());
86 86
 		}
87 87
 		$this->collection = $collection;
88 88
 		$this->file_locator = $file_locator;
@@ -110,12 +110,12 @@  discard block
 block discarded – undo
110 110
 	 * @throws \EventEspresso\core\exceptions\InvalidEntityException
111 111
 	 */
112 112
 	protected function loadAllFromFilepaths() {
113
-		if ( ! $this->file_locator instanceof FileLocator ) {
113
+		if ( ! $this->file_locator instanceof FileLocator) {
114 114
 			$this->file_locator = new FileLocator();
115 115
 		}
116
-		$this->file_locator->setFileMask( $this->collection_details->getFileMask() );
116
+		$this->file_locator->setFileMask($this->collection_details->getFileMask());
117 117
 		// find all of the files that match the file mask in the specified folder
118
-		$this->file_locator->locate( $this->collection_details->getCollectionPaths() );
118
+		$this->file_locator->locate($this->collection_details->getCollectionPaths());
119 119
 		// filter the results
120 120
 		$filepaths = (array) apply_filters(
121 121
 			"FHEE__CollectionLoader__loadAllFromFilepath__filepaths",
@@ -123,11 +123,11 @@  discard block
 block discarded – undo
123 123
 			$this->collection_details->collectionName(),
124 124
 			$this->collection_details
125 125
 		);
126
-		if ( empty( $filepaths ) ) {
126
+		if (empty($filepaths)) {
127 127
 			return;
128 128
 		}
129
-		foreach ( $filepaths as $filepath ) {
130
-			$this->loadClassFromFilepath( $filepath );
129
+		foreach ($filepaths as $filepath) {
130
+			$this->loadClassFromFilepath($filepath);
131 131
 		}
132 132
 	}
133 133
 
@@ -144,22 +144,22 @@  discard block
 block discarded – undo
144 144
 	 * @throws \EventEspresso\core\exceptions\InvalidFilePathException
145 145
 	 * @throws \EventEspresso\core\exceptions\InvalidClassException
146 146
 	 */
147
-	protected function loadClassFromFilepath( $filepath ) {
148
-		if ( ! is_string( $filepath ) ) {
149
-			throw new InvalidDataTypeException( '$filepath', $filepath, 'string' );
147
+	protected function loadClassFromFilepath($filepath) {
148
+		if ( ! is_string($filepath)) {
149
+			throw new InvalidDataTypeException('$filepath', $filepath, 'string');
150 150
 		}
151
-		if ( ! is_readable( $filepath ) ) {
152
-			throw new InvalidFilePathException( $filepath );
151
+		if ( ! is_readable($filepath)) {
152
+			throw new InvalidFilePathException($filepath);
153 153
 		}
154
-		require_once( $filepath );
154
+		require_once($filepath);
155 155
 		// extract filename from path
156
-		$file_name = basename( $filepath );
156
+		$file_name = basename($filepath);
157 157
 		// now remove any file extensions
158
-		$class_name = \EEH_File::get_classname_from_filepath_with_standard_filename( $file_name );
159
-		if ( ! class_exists( $class_name ) ) {
160
-			throw new InvalidClassException( $class_name );
158
+		$class_name = \EEH_File::get_classname_from_filepath_with_standard_filename($file_name);
159
+		if ( ! class_exists($class_name)) {
160
+			throw new InvalidClassException($class_name);
161 161
 		}
162
-		return $this->addEntityToCollection( new $class_name(), $file_name );
162
+		return $this->addEntityToCollection(new $class_name(), $file_name);
163 163
 	}
164 164
 
165 165
 
@@ -173,15 +173,15 @@  discard block
 block discarded – undo
173 173
 	 * @return string
174 174
 	 * @throws \EventEspresso\core\exceptions\InvalidEntityException
175 175
 	 */
176
-	protected function addEntityToCollection( $entity, $identifier ) {
176
+	protected function addEntityToCollection($entity, $identifier) {
177 177
 		do_action(
178 178
 			"FHEE__CollectionLoader__addEntityToCollection__entity",
179 179
 			$entity,
180 180
 			$this->collection_details->collectionName(),
181 181
 			$this->collection_details
182 182
 		);
183
-		$identifier = $this->setIdentifier( $entity, $identifier );
184
-		if ( $this->collection->has( $identifier ) ) {
183
+		$identifier = $this->setIdentifier($entity, $identifier);
184
+		if ($this->collection->has($identifier)) {
185 185
 			do_action(
186 186
 				"FHEE__CollectionLoader__addEntityToCollection__entity_already_added",
187 187
 				$this,
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 			);
191 191
 			return CollectionLoader::ENTITY_EXISTS;
192 192
 		}
193
-		if( $this->collection->add( $entity, $identifier ) ) {
193
+		if ($this->collection->add($entity, $identifier)) {
194 194
 			do_action(
195 195
 				"FHEE__CollectionLoader__addEntityToCollection__entity_added",
196 196
 				$this,
@@ -220,12 +220,12 @@  discard block
 block discarded – undo
220 220
 	 * @return string
221 221
 	 * @throws \EventEspresso\core\exceptions\InvalidEntityException
222 222
 	 */
223
-	protected function setIdentifier( $entity, $identifier ) {
224
-		if ( $this->collection_details->identifierType() === CollectionDetails::ID_OBJECT_HASH ) {
225
-			$identifier = spl_object_hash( $entity );
226
-		} elseif ( $this->collection_details->identifierType() === CollectionDetails::ID_CALLBACK_METHOD ) {
223
+	protected function setIdentifier($entity, $identifier) {
224
+		if ($this->collection_details->identifierType() === CollectionDetails::ID_OBJECT_HASH) {
225
+			$identifier = spl_object_hash($entity);
226
+		} elseif ($this->collection_details->identifierType() === CollectionDetails::ID_CALLBACK_METHOD) {
227 227
 			$identifier_callback = $this->collection_details->identifierCallback();
228
-			if ( ! method_exists( $entity, $identifier_callback ) ) {
228
+			if ( ! method_exists($entity, $identifier_callback)) {
229 229
 				throw new InvalidEntityException(
230 230
 					$entity,
231 231
 					$this->collection_details->getCollectionInterface(),
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 							'event_espresso'
236 236
 						),
237 237
 						$identifier_callback,
238
-						get_class( $entity )
238
+						get_class($entity)
239 239
 					)
240 240
 				);
241 241
 			}
@@ -267,8 +267,8 @@  discard block
 block discarded – undo
267 267
 			$this->collection_details->collectionName(),
268 268
 			$this->collection_details
269 269
 		);
270
-		foreach ( $FQCNs as $FQCN ) {
271
-			$this->loadClassFromFQCN( $FQCN );
270
+		foreach ($FQCNs as $FQCN) {
271
+			$this->loadClassFromFQCN($FQCN);
272 272
 		}
273 273
 	}
274 274
 
@@ -284,15 +284,15 @@  discard block
 block discarded – undo
284 284
 	 * @throws \EventEspresso\core\exceptions\InvalidDataTypeException
285 285
 	 * @throws \EventEspresso\core\exceptions\InvalidClassException
286 286
 	 */
287
-	protected function loadClassFromFQCN( $FQCN ) {
288
-		if ( ! is_string( $FQCN ) ) {
289
-			throw new InvalidDataTypeException( '$FQCN', $FQCN, 'string' );
287
+	protected function loadClassFromFQCN($FQCN) {
288
+		if ( ! is_string($FQCN)) {
289
+			throw new InvalidDataTypeException('$FQCN', $FQCN, 'string');
290 290
 		}
291
-		if ( ! class_exists( $FQCN ) ) {
292
-			throw new InvalidClassException( $FQCN );
291
+		if ( ! class_exists($FQCN)) {
292
+			throw new InvalidClassException($FQCN);
293 293
 		}
294 294
 		return $this->addEntityToCollection(
295
-			\EE_Registry::instance()->create( $FQCN ),
295
+			\EE_Registry::instance()->create($FQCN),
296 296
 			$FQCN
297 297
 		);
298 298
 	}
Please login to merge, or discard this patch.