Completed
Branch BUG/11268/release-reserved-cou... (6d4092)
by
unknown
26:45 queued 13:23
created
core/services/commands/CommandBusInterface.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\commands;
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
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	 * @param \EventEspresso\core\services\commands\CommandInterface $command
24 24
 	 * @return mixed
25 25
 	 */
26
-	public function execute( $command );
26
+	public function execute($command);
27 27
 
28 28
 }
29 29
 // End of file CommandBusInterface.php
Please login to merge, or discard this patch.
core/db_models/EEM_Question_Group.model.php 2 patches
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
  *
22 22
  * ------------------------------------------------------------------------
23 23
  */
24
-require_once ( EE_MODELS . 'EEM_Soft_Delete_Base.model.php' );
25
-require_once( EE_CLASSES . 'EE_Question_Group.class.php');
24
+require_once (EE_MODELS.'EEM_Soft_Delete_Base.model.php');
25
+require_once(EE_CLASSES.'EE_Question_Group.class.php');
26 26
 class EEM_Question_Group extends EEM_Soft_Delete_Base {
27 27
 	const system_personal = 1;
28 28
 	const system_address = 2;
@@ -30,25 +30,25 @@  discard block
 block discarded – undo
30 30
 	protected static $_instance = NULL;
31 31
         
32 32
         
33
-	protected function __construct( $timezone = NULL ) {
34
-		$this->singular_item = __('Question Group','event_espresso');
35
-		$this->plural_item = __('Question Groups','event_espresso');
33
+	protected function __construct($timezone = NULL) {
34
+		$this->singular_item = __('Question Group', 'event_espresso');
35
+		$this->plural_item = __('Question Groups', 'event_espresso');
36 36
 
37 37
 		$this->_tables = array(
38
-			'Question_Group'=>new EE_Primary_Table('esp_question_group','QSG_ID')
38
+			'Question_Group'=>new EE_Primary_Table('esp_question_group', 'QSG_ID')
39 39
 		);
40 40
 		$this->_fields = array(
41 41
 			'Question_Group'=>array(
42
-				'QSG_ID'=>new EE_Primary_Key_Int_Field('QSG_ID', __('Question Group ID','event_espresso')),
43
-				'QSG_name'=>new EE_Plain_Text_Field('QSG_name', __('Question Group Name','event_espresso'), false, ''),
44
-				'QSG_identifier'=>new EE_Plain_Text_Field('QSG_identifier', __('Text ID for question Group','event_espresso'), false, ''),
45
-				'QSG_desc'=>new EE_Post_Content_Field('QSG_desc', __('Description of Question Group','event_espresso'), true, ''),
46
-				'QSG_order'=>new EE_Integer_Field('QSG_order', __('Order in which to show the question group','event_espresso'), true, 0),
47
-				'QSG_show_group_name'=>new EE_Boolean_Field('QSG_show_group_name', __('Flag indicating whether to show the group\'s name on the registration page','event_espresso'), false, true),
48
-				'QSG_show_group_desc'=>new EE_Boolean_Field('QSG_show_group_desc', __('Flag indicating whether to show the group\s description on the registration page','event_espresso'), false, false),
49
-				'QSG_wp_user' => new EE_WP_User_Field('QSG_wp_user', __('Question Group Creator ID', 'event_espresso'), FALSE ),
50
-				'QSG_system'=>new EE_Integer_Field('QSG_system', __('Indicate IF this is a system group and if it is what system group it corresponds to.','event_espresso'), false, 0),
51
-				'QSG_deleted'=>new EE_Trashed_Flag_Field('QSG_deleted', __('Flag indicating this question group was deleted','event_espresso'), false, false)
42
+				'QSG_ID'=>new EE_Primary_Key_Int_Field('QSG_ID', __('Question Group ID', 'event_espresso')),
43
+				'QSG_name'=>new EE_Plain_Text_Field('QSG_name', __('Question Group Name', 'event_espresso'), false, ''),
44
+				'QSG_identifier'=>new EE_Plain_Text_Field('QSG_identifier', __('Text ID for question Group', 'event_espresso'), false, ''),
45
+				'QSG_desc'=>new EE_Post_Content_Field('QSG_desc', __('Description of Question Group', 'event_espresso'), true, ''),
46
+				'QSG_order'=>new EE_Integer_Field('QSG_order', __('Order in which to show the question group', 'event_espresso'), true, 0),
47
+				'QSG_show_group_name'=>new EE_Boolean_Field('QSG_show_group_name', __('Flag indicating whether to show the group\'s name on the registration page', 'event_espresso'), false, true),
48
+				'QSG_show_group_desc'=>new EE_Boolean_Field('QSG_show_group_desc', __('Flag indicating whether to show the group\s description on the registration page', 'event_espresso'), false, false),
49
+				'QSG_wp_user' => new EE_WP_User_Field('QSG_wp_user', __('Question Group Creator ID', 'event_espresso'), FALSE),
50
+				'QSG_system'=>new EE_Integer_Field('QSG_system', __('Indicate IF this is a system group and if it is what system group it corresponds to.', 'event_espresso'), false, 0),
51
+				'QSG_deleted'=>new EE_Trashed_Flag_Field('QSG_deleted', __('Flag indicating this question group was deleted', 'event_espresso'), false, false)
52 52
 			)
53 53
 		);
54 54
 		$this->_model_relations = array(
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
 			'WP_User' => new EE_Belongs_To_Relation(),
59 59
 		);
60 60
 		//this model is generally available for reading
61
-		$this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Public();
62
-		$this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Reg_Form('QSG_system');
63
-		$this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Reg_Form('QSG_system');
64
-		$this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Reg_Form('QSG_system');
65
-		parent::__construct( $timezone );
61
+		$this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Public();
62
+		$this->_cap_restriction_generators[EEM_Base::caps_read_admin] = new EE_Restriction_Generator_Reg_Form('QSG_system');
63
+		$this->_cap_restriction_generators[EEM_Base::caps_edit] = new EE_Restriction_Generator_Reg_Form('QSG_system');
64
+		$this->_cap_restriction_generators[EEM_Base::caps_delete] = new EE_Restriction_Generator_Reg_Form('QSG_system');
65
+		parent::__construct($timezone);
66 66
 
67 67
 	}
68 68
 	/**
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
 	 */
73 73
 	public function get_latest_question_group_order() {
74 74
 		$columns_to_select = array(
75
-			'max_order' => array("MAX(QSG_order)","%d")
75
+			'max_order' => array("MAX(QSG_order)", "%d")
76 76
 			);
77
-		$max = $this->_get_all_wpdb_results(array(), ARRAY_A, $columns_to_select );
77
+		$max = $this->_get_all_wpdb_results(array(), ARRAY_A, $columns_to_select);
78 78
 		return $max[0]['max_order'];
79 79
 	}
80 80
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
strategies/display/EE_Radio_Button_Display_Strategy.strategy.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php if (!defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
2 2
 /**
3 3
  * Class EE_Radio_Button_Display_Strategy
4 4
  * displays a set of radio buttons
@@ -15,34 +15,34 @@  discard block
 block discarded – undo
15 15
 	 * @throws EE_Error
16 16
 	 * @return string of html to display the field
17 17
 	 */
18
-	public function display(){
18
+	public function display() {
19 19
 		$input = $this->get_input();
20 20
 		$input->set_label_sizes();
21 21
 		$label_size_class = $input->get_label_size_class();
22 22
 		$html = '';
23
-		foreach( $input->options() as $value => $display_text ){
24
-			$value = $input->get_normalization_strategy()->unnormalize( $value );
23
+		foreach ($input->options() as $value => $display_text) {
24
+			$value = $input->get_normalization_strategy()->unnormalize($value);
25 25
 
26
-			$html_id = $this->get_sub_input_id( $value );
27
-			$html .= EEH_HTML::nl( 0, 'radio' );
28
-			$html .= '<label for="' . $html_id . '"';
29
-			$html .= ' id="' . $html_id . '-lbl"';
30
-			$html .= ' class="ee-radio-label-after' . $label_size_class . '">';
31
-			$html .= EEH_HTML::nl( 1, 'radio' );
32
-			$html .= '<input id="' . $html_id . '"';
33
-			$html .= ' name="' . $input->html_name() . '"';
34
-			$html .= ' class="' . $input->html_class() . '"';
35
-			$html .= ' style="' . $input->html_style() . '"';
26
+			$html_id = $this->get_sub_input_id($value);
27
+			$html .= EEH_HTML::nl(0, 'radio');
28
+			$html .= '<label for="'.$html_id.'"';
29
+			$html .= ' id="'.$html_id.'-lbl"';
30
+			$html .= ' class="ee-radio-label-after'.$label_size_class.'">';
31
+			$html .= EEH_HTML::nl(1, 'radio');
32
+			$html .= '<input id="'.$html_id.'"';
33
+			$html .= ' name="'.$input->html_name().'"';
34
+			$html .= ' class="'.$input->html_class().'"';
35
+			$html .= ' style="'.$input->html_style().'"';
36 36
 			$html .= ' type="radio"';
37
-			$html .= ' value="' . esc_attr( $value ) . '"';
37
+			$html .= ' value="'.esc_attr($value).'"';
38 38
 			$html .= $input->raw_value() === $value ? ' checked="checked"' : '';
39
-			$html .= ' ' . $this->_input->other_html_attributes();
39
+			$html .= ' '.$this->_input->other_html_attributes();
40 40
 			$html .= '>&nbsp;';
41 41
 			$html .= $display_text;
42
-			$html .= EEH_HTML::nl( -1, 'radio' ) . '</label>';
42
+			$html .= EEH_HTML::nl( -1, 'radio' ).'</label>';
43 43
 
44 44
 		}
45
-		$html .= EEH_HTML::div( '', '', 'clear-float' );
45
+		$html .= EEH_HTML::div('', '', 'clear-float');
46 46
 		$html .= EEH_HTML::divx();
47 47
 		return $html;
48 48
 	}
Please login to merge, or discard this patch.
templates/thank-you-page-registration-details.template.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -5,81 +5,81 @@  discard block
 block discarded – undo
5 5
 /** @type string $SPCO_attendee_information_url */
6 6
 ?>
7 7
 <h3 class="ee-registration-details-h3"><?php _e('Registration Details', 'event_espresso'); ?></h3>
8
-<?php  do_action( 'AHEE__thank_you_page_registration_details_template__after_heading' ); ?>
8
+<?php  do_action('AHEE__thank_you_page_registration_details_template__after_heading'); ?>
9 9
 
10 10
 <div class="ee-registration-details-dv">
11 11
 <?php
12 12
 $registrations = $transaction->registrations();
13
-$registrations = is_array( $registrations ) ? $registrations : array();
14
-$reg_count = count( $registrations );
13
+$registrations = is_array($registrations) ? $registrations : array();
14
+$reg_count = count($registrations);
15 15
 $reg_cntr = 0;
16 16
 $event_name = '';
17 17
 $wait_list = false;
18
-foreach ( $registrations as $registration ) {
19
-	if ( $registration instanceof EE_Registration ) {
20
-		if ( $event_name != $registration->event_name() && ! empty( $event_name )) { ?>
18
+foreach ($registrations as $registration) {
19
+	if ($registration instanceof EE_Registration) {
20
+		if ($event_name != $registration->event_name() && ! empty($event_name)) { ?>
21 21
 		</tbody>
22 22
 	</table>
23 23
 		<?php
24 24
 		}
25 25
 		$reg_cntr++;
26
-		if ( $event_name != $registration->event_name() ) {
26
+		if ($event_name != $registration->event_name()) {
27 27
 	?>
28 28
 	<h5>
29
-		<span class="smaller-text grey-text"><?php _e('for','event_espresso');?>: </span> <?php echo htmlentities( $registration->event_name(), ENT_QUOTES, 'UTF-8' );?>
29
+		<span class="smaller-text grey-text"><?php _e('for', 'event_espresso'); ?>: </span> <?php echo htmlentities($registration->event_name(), ENT_QUOTES, 'UTF-8'); ?>
30 30
 	</h5>
31 31
 	<table class='ee-table ee-registrations-list'>
32 32
 		<thead>
33 33
 			<tr>
34 34
 				<th width="40%">
35
-					<?php _e("Registrant Name",'event_espresso')?>
35
+					<?php _e("Registrant Name", 'event_espresso')?>
36 36
 				</th>
37 37
 				<th width="25%" class="jst-left">
38
-					<?php _e("REG Code",'event_espresso');?>
38
+					<?php _e("REG Code", 'event_espresso'); ?>
39 39
 				</th>
40 40
 				<th width="35%" class="jst-left">
41
-					<?php _e("REG Status",'event_espresso');?>
41
+					<?php _e("REG Status", 'event_espresso'); ?>
42 42
 				</th>
43 43
 			</tr>
44 44
 		</thead>
45 45
 		<tbody>
46 46
 	<?php
47 47
 		}
48
-		if ( $is_primary || ( ! $is_primary && $reg_url_link == $registration->reg_url_link() )) { ?>
48
+		if ($is_primary || ( ! $is_primary && $reg_url_link == $registration->reg_url_link())) { ?>
49 49
 			<tr>
50 50
 				<td width="40%">
51 51
 				<?php
52
-					if ( $registration->attendee() instanceof EE_Attendee ) {
53
-						echo $registration->attendee()->full_name( TRUE );
52
+					if ($registration->attendee() instanceof EE_Attendee) {
53
+						echo $registration->attendee()->full_name(TRUE);
54 54
 					}
55 55
 				?>
56 56
 					<p class="tiny-text" style="margin: .75em 0 0;">
57 57
 					<?php
58
-					if ( $registration->count_question_groups() ) {
58
+					if ($registration->count_question_groups()) {
59 59
 					?>
60
-						<a class="ee-icon-only-lnk" href="<?php echo $registration->edit_attendee_information_url();?>" title="<?php esc_attr_e('Click here to edit Attendee Information', 'event_espresso');?>"><span class="ee-icon ee-icon-user-edit"></span><?php _e('edit info', 'event_espresso');?></a>
60
+						<a class="ee-icon-only-lnk" href="<?php echo $registration->edit_attendee_information_url(); ?>" title="<?php esc_attr_e('Click here to edit Attendee Information', 'event_espresso'); ?>"><span class="ee-icon ee-icon-user-edit"></span><?php _e('edit info', 'event_espresso'); ?></a>
61 61
 					<?php } ?>
62
-						<a class="ee-resend-reg-confirmation-email ee-icon-only-lnk" href="<?php echo add_query_arg( array( 'token'=>$registration->reg_url_link(), 'resend_reg_confirmation' => 'true' ), EE_Registry::instance()->CFG->core->thank_you_page_url() );?>" title="<?php esc_attr_e('Click here to resend the Registration Confirmation email', 'event_espresso');?>" rel="<?php echo $registration->reg_url_link();?>"><span class="dashicons dashicons-email-alt"></span><?php _e('resend email', 'event_espresso');?></a>
62
+						<a class="ee-resend-reg-confirmation-email ee-icon-only-lnk" href="<?php echo add_query_arg(array('token'=>$registration->reg_url_link(), 'resend_reg_confirmation' => 'true'), EE_Registry::instance()->CFG->core->thank_you_page_url()); ?>" title="<?php esc_attr_e('Click here to resend the Registration Confirmation email', 'event_espresso'); ?>" rel="<?php echo $registration->reg_url_link(); ?>"><span class="dashicons dashicons-email-alt"></span><?php _e('resend email', 'event_espresso'); ?></a>
63 63
 					</p>
64 64
 				</td>
65 65
 				<td width="25%" class="jst-left">
66 66
 					<?php $registration->e('REG_code') ?>
67 67
 				</td>
68 68
 				<td width="35%" class="jst-left">
69
-					<?php $registration->e_pretty_status( TRUE )?>
69
+					<?php $registration->e_pretty_status(TRUE)?>
70 70
 					<?php
71
-						if ( $registration->status_ID() === EEM_Registration::status_id_wait_list ) {
71
+						if ($registration->status_ID() === EEM_Registration::status_id_wait_list) {
72 72
 							$wait_list = true;
73 73
 						}
74 74
 					?>
75 75
 				</td>
76 76
 			</tr>
77
-            <?php  do_action( 'AHEE__thank_you_page_registration_details_template__after_registration_table_row', $registration ); ?>
77
+            <?php  do_action('AHEE__thank_you_page_registration_details_template__after_registration_table_row', $registration); ?>
78 78
         <?php
79 79
 			$event_name = $registration->event_name();
80 80
 
81 81
 		}
82
-		if ( $reg_cntr >= $reg_count ) {
82
+		if ($reg_cntr >= $reg_count) {
83 83
 			?>
84 84
 			</tbody>
85 85
 			</table>
@@ -88,12 +88,12 @@  discard block
 block discarded – undo
88 88
 	}
89 89
 }
90 90
 ?>
91
-<?php if ( $is_primary && $SPCO_attendee_information_url ) { ?>
91
+<?php if ($is_primary && $SPCO_attendee_information_url) { ?>
92 92
 	<p class="small-text jst-rght">
93 93
 		<a href='<?php echo $SPCO_attendee_information_url?>'><?php _e("Click here to edit All Attendee Information", 'event_espresso'); ?></a>
94 94
 	</p>
95 95
 <?php } ?>
96
-	<?php if ( $wait_list ) { ?>
96
+	<?php if ($wait_list) { ?>
97 97
 
98 98
 			<?php
99 99
 			echo apply_filters(
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 	<?php } ?>
114 114
 
115 115
 
116
-	<?php  do_action( 'AHEE__thank_you_page_registration_details_template__after_registration_details' ); ?>
116
+	<?php  do_action('AHEE__thank_you_page_registration_details_template__after_registration_details'); ?>
117 117
 
118 118
 </div>
119 119
 <!-- end of .registration-details -->
Please login to merge, or discard this patch.
core/services/container/ContainerInterface.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 namespace EventEspresso\core\services\container;
3 3
 
4 4
 if ( ! defined('EVENT_ESPRESSO_VERSION')) {
5
-    exit('No direct script access allowed');
5
+	exit('No direct script access allowed');
6 6
 }
7 7
 
8 8
 
@@ -18,26 +18,26 @@  discard block
 block discarded – undo
18 18
 interface ContainerInterface
19 19
 {
20 20
 
21
-    /**
22
-     * Finds an entry of the container by its identifier and returns it.
23
-     *
24
-     * @param string $id Identifier of the entry to look for.
25
-     * @return mixed Entry.
26
-     */
27
-    public function get($id);
28
-
29
-
30
-
31
-    /**
32
-     * Returns true if the container can return an entry for the given identifier.
33
-     * Returns false otherwise.
34
-     * `has($id)` returning true does not mean that `get($id)` will not throw an exception.
35
-     * It does however mean that `get($id)` will not throw a `NotFoundException`.
36
-     *
37
-     * @param string $id Identifier of the entry to look for.
38
-     * @return boolean
39
-     */
40
-    public function has($id);
21
+	/**
22
+	 * Finds an entry of the container by its identifier and returns it.
23
+	 *
24
+	 * @param string $id Identifier of the entry to look for.
25
+	 * @return mixed Entry.
26
+	 */
27
+	public function get($id);
28
+
29
+
30
+
31
+	/**
32
+	 * Returns true if the container can return an entry for the given identifier.
33
+	 * Returns false otherwise.
34
+	 * `has($id)` returning true does not mean that `get($id)` will not throw an exception.
35
+	 * It does however mean that `get($id)` will not throw a `NotFoundException`.
36
+	 *
37
+	 * @param string $id Identifier of the entry to look for.
38
+	 * @return boolean
39
+	 */
40
+	public function has($id);
41 41
 
42 42
 
43 43
 }
Please login to merge, or discard this patch.
core/services/container/CoffeeMakerInterface.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 namespace EventEspresso\core\services\container;
3 3
 
4 4
 if ( ! defined('EVENT_ESPRESSO_VERSION')) {
5
-    exit('No direct script access allowed');
5
+	exit('No direct script access allowed');
6 6
 }
7 7
 
8 8
 
@@ -17,33 +17,33 @@  discard block
 block discarded – undo
17 17
 interface CoffeeMakerInterface
18 18
 {
19 19
 
20
-    /**
21
-     * @return array
22
-     */
23
-    public static function getTypes();
20
+	/**
21
+	 * @return array
22
+	 */
23
+	public static function getTypes();
24 24
 
25 25
 
26 26
 
27
-    /**
28
-     * @param $type
29
-     */
30
-    public static function validateType($type);
27
+	/**
28
+	 * @param $type
29
+	 */
30
+	public static function validateType($type);
31 31
 
32 32
 
33 33
 
34
-    /**
35
-     * @param RecipeInterface $recipe
36
-     * @param array           $arguments
37
-     * @return mixed
38
-     */
39
-    public function brew(RecipeInterface $recipe, $arguments = array());
34
+	/**
35
+	 * @param RecipeInterface $recipe
36
+	 * @param array           $arguments
37
+	 * @return mixed
38
+	 */
39
+	public function brew(RecipeInterface $recipe, $arguments = array());
40 40
 
41 41
 
42 42
 
43
-    /**
44
-     * @return string
45
-     */
46
-    public function type();
43
+	/**
44
+	 * @return string
45
+	 */
46
+	public function type();
47 47
 
48 48
 }
49 49
 // End of file CoffeeMakerInterface.php
Please login to merge, or discard this patch.
core/services/container/exceptions/InstantiationException.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 use BadMethodCallException;
5 5
 
6 6
 if ( ! defined('EVENT_ESPRESSO_VERSION')) {
7
-    exit('No direct script access allowed');
7
+	exit('No direct script access allowed');
8 8
 }
9 9
 
10 10
 
@@ -20,27 +20,27 @@  discard block
 block discarded – undo
20 20
 class InstantiationException extends BadMethodCallException
21 21
 {
22 22
 
23
-    /**
24
-     * InstantiationException constructor.
25
-     *
26
-     * @param string $identifier the name of the requested entity or service
27
-     * @param string     $message
28
-     * @param int        $code
29
-     * @param \Exception $previous
30
-     */
31
-    public function __construct($identifier, $message = '', $code = 0, \Exception $previous = null)
32
-    {
33
-        if (empty($message)) {
34
-            $message = sprintf(
35
-                __(
36
-                    'The "%1$s" class could not be constructed.',
37
-                    'event_espresso'
38
-                ),
39
-                $identifier
40
-            );
41
-        }
42
-        parent::__construct($message, $code, $previous);
43
-    }
23
+	/**
24
+	 * InstantiationException constructor.
25
+	 *
26
+	 * @param string $identifier the name of the requested entity or service
27
+	 * @param string     $message
28
+	 * @param int        $code
29
+	 * @param \Exception $previous
30
+	 */
31
+	public function __construct($identifier, $message = '', $code = 0, \Exception $previous = null)
32
+	{
33
+		if (empty($message)) {
34
+			$message = sprintf(
35
+				__(
36
+					'The "%1$s" class could not be constructed.',
37
+					'event_espresso'
38
+				),
39
+				$identifier
40
+			);
41
+		}
42
+		parent::__construct($message, $code, $previous);
43
+	}
44 44
 
45 45
 }
46 46
 // End of file InstantiationException.php
Please login to merge, or discard this patch.
core/services/container/CoffeePotInterface.php 1 patch
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 namespace EventEspresso\core\services\container;
3 3
 
4 4
 if ( ! defined('EVENT_ESPRESSO_VERSION')) {
5
-    exit('No direct script access allowed');
5
+	exit('No direct script access allowed');
6 6
 }
7 7
 
8 8
 
@@ -18,70 +18,70 @@  discard block
 block discarded – undo
18 18
 
19 19
 
20 20
 
21
-    /**
22
-     * returns an instance of the requested entity type using the supplied arguments.
23
-     * If a shared service is requested and an instance is already in the carafe, then it will be returned.
24
-     * If it is not already in the carafe, then the service will be constructed, added to the carafe, and returned
25
-     * If the request is for a new entity and a closure exists in the reservoir for creating it,
26
-     * then a new entity will be instantiated from the closure and returned.
27
-     * If a closure does not exist, then one will be built and added to the reservoir
28
-     * before instantiating the requested entity.
29
-     *
30
-     * @param  string $identifier Identifier for the entity class to be constructed.
31
-     *                            Typically a Fully Qualified Class Name
32
-     * @param array   $arguments  an array of arguments to be passed to the entity constructor
33
-     * @param string  $type
34
-     * @return mixed
35
-     */
36
-    public function brew($identifier, $arguments = array(), $type = '');
21
+	/**
22
+	 * returns an instance of the requested entity type using the supplied arguments.
23
+	 * If a shared service is requested and an instance is already in the carafe, then it will be returned.
24
+	 * If it is not already in the carafe, then the service will be constructed, added to the carafe, and returned
25
+	 * If the request is for a new entity and a closure exists in the reservoir for creating it,
26
+	 * then a new entity will be instantiated from the closure and returned.
27
+	 * If a closure does not exist, then one will be built and added to the reservoir
28
+	 * before instantiating the requested entity.
29
+	 *
30
+	 * @param  string $identifier Identifier for the entity class to be constructed.
31
+	 *                            Typically a Fully Qualified Class Name
32
+	 * @param array   $arguments  an array of arguments to be passed to the entity constructor
33
+	 * @param string  $type
34
+	 * @return mixed
35
+	 */
36
+	public function brew($identifier, $arguments = array(), $type = '');
37 37
 
38 38
 
39 39
 
40
-    /**
41
-     * @param string   $identifier
42
-     * @param callable $closure
43
-     */
44
-    public function addClosure($identifier, $closure);
40
+	/**
41
+	 * @param string   $identifier
42
+	 * @param callable $closure
43
+	 */
44
+	public function addClosure($identifier, $closure);
45 45
 
46 46
 
47 47
 
48
-    /**
49
-     * @param string $identifier
50
-     * @param mixed  $service
51
-     * @return boolean
52
-     */
53
-    public function addService($identifier, $service);
48
+	/**
49
+	 * @param string $identifier
50
+	 * @param mixed  $service
51
+	 * @return boolean
52
+	 */
53
+	public function addService($identifier, $service);
54 54
 
55 55
 
56 56
 
57
-    /**
58
-     * Adds instructions on how to brew objects
59
-     *
60
-     * @param RecipeInterface $recipe
61
-     * @return mixed
62
-     */
63
-    public function addRecipe(RecipeInterface $recipe);
57
+	/**
58
+	 * Adds instructions on how to brew objects
59
+	 *
60
+	 * @param RecipeInterface $recipe
61
+	 * @return mixed
62
+	 */
63
+	public function addRecipe(RecipeInterface $recipe);
64 64
 
65 65
 
66 66
 
67
-    /**
68
-     * Get instructions on how to brew objects
69
-     *
70
-     * @param string $identifier
71
-     * @return Recipe
72
-     */
73
-    public function getRecipe($identifier);
67
+	/**
68
+	 * Get instructions on how to brew objects
69
+	 *
70
+	 * @param string $identifier
71
+	 * @return Recipe
72
+	 */
73
+	public function getRecipe($identifier);
74 74
 
75 75
 
76 76
 
77
-    /**
78
-     * adds class name aliases to list of filters
79
-     *
80
-     * @param  string $identifier
81
-     * @param  array  $aliases
82
-     * @return string
83
-     */
84
-    public function addAliases($identifier, $aliases);
77
+	/**
78
+	 * adds class name aliases to list of filters
79
+	 *
80
+	 * @param  string $identifier
81
+	 * @param  array  $aliases
82
+	 * @return string
83
+	 */
84
+	public function addAliases($identifier, $aliases);
85 85
 
86 86
 
87 87
 
Please login to merge, or discard this patch.
core/services/container/CoffeeMaker.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
      */
57 57
     public static function getTypes()
58 58
     {
59
-        return (array)apply_filters(
59
+        return (array) apply_filters(
60 60
             'FHEE__EventEspresso\core\services\container\CoffeeMaker__getTypes',
61 61
             array(
62 62
                 CoffeeMaker::BREW_NEW,
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
 
71 71
     /**
72
-     * @param $type
72
+     * @param string $type
73 73
      * @throws \EventEspresso\core\exceptions\InvalidIdentifierException
74 74
      */
75 75
     public static function validateType($type)
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
      * Examines the constructor to determine which method should be used for instantiation
128 128
      *
129 129
      * @param \ReflectionClass $reflector
130
-     * @return mixed
130
+     * @return string
131 131
      * @throws InstantiationException
132 132
      */
133 133
     protected function resolveInstantiationMethod(\ReflectionClass $reflector)
Please login to merge, or discard this patch.
Indentation   +157 added lines, -157 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 use EventEspresso\core\services\container\exceptions\InstantiationException;
7 7
 
8 8
 if ( ! defined('EVENT_ESPRESSO_VERSION')) {
9
-    exit('No direct script access allowed');
9
+	exit('No direct script access allowed');
10 10
 }
11 11
 
12 12
 
@@ -23,162 +23,162 @@  discard block
 block discarded – undo
23 23
 abstract class CoffeeMaker implements CoffeeMakerInterface
24 24
 {
25 25
 
26
-    /**
27
-     * Indicates that CoffeeMaker should construct a NEW entity instance from the provided arguments (if given)
28
-     */
29
-    const BREW_NEW = 'new';
30
-
31
-    /**
32
-     * Indicates that CoffeeMaker should always return a SHARED instance
33
-     */
34
-    const BREW_SHARED = 'shared';
35
-
36
-    /**
37
-     * Indicates that CoffeeMaker should only load the file/class/interface but NOT instantiate
38
-     */
39
-    const BREW_LOAD_ONLY = 'load_only';
40
-
41
-
42
-    /**
43
-     * @var CoffeePotInterface $coffee_pot
44
-     */
45
-    private $coffee_pot;
46
-
47
-    /**
48
-     * @var DependencyInjector $injector
49
-     */
50
-    private $injector;
51
-
52
-
53
-
54
-    /**
55
-     * @return array
56
-     */
57
-    public static function getTypes()
58
-    {
59
-        return (array)apply_filters(
60
-            'FHEE__EventEspresso\core\services\container\CoffeeMaker__getTypes',
61
-            array(
62
-                CoffeeMaker::BREW_NEW,
63
-                CoffeeMaker::BREW_SHARED,
64
-                CoffeeMaker::BREW_LOAD_ONLY,
65
-            )
66
-        );
67
-    }
68
-
69
-
70
-
71
-    /**
72
-     * @param $type
73
-     * @throws \EventEspresso\core\exceptions\InvalidIdentifierException
74
-     */
75
-    public static function validateType($type)
76
-    {
77
-        $types = CoffeeMaker::getTypes();
78
-        if ( ! in_array($type, $types, true)) {
79
-            throw new InvalidIdentifierException(
80
-                is_object($type) ? get_class($type) : gettype($type),
81
-                __(
82
-                    'recipe type (one of the class constants on \EventEspresso\core\services\container\CoffeeMaker)',
83
-                    'event_espresso'
84
-                )
85
-            );
86
-        }
87
-        return $type;
88
-    }
89
-
90
-
91
-
92
-    /**
93
-     * CoffeeMaker constructor.
94
-     *
95
-     * @param CoffeePotInterface $coffee_pot
96
-     * @param InjectorInterface  $injector
97
-     */
98
-    public function __construct(CoffeePotInterface $coffee_pot, InjectorInterface $injector)
99
-    {
100
-        $this->coffee_pot = $coffee_pot;
101
-        $this->injector = $injector;
102
-    }
103
-
104
-
105
-
106
-    /**
107
-     * @return \EventEspresso\core\services\container\CoffeePotInterface
108
-     */
109
-    protected function coffeePot()
110
-    {
111
-        return $this->coffee_pot;
112
-    }
113
-
114
-
115
-
116
-    /**
117
-     * @return \EventEspresso\core\services\container\DependencyInjector
118
-     */
119
-    protected function injector()
120
-    {
121
-        return $this->injector;
122
-    }
123
-
124
-
125
-
126
-    /**
127
-     * Examines the constructor to determine which method should be used for instantiation
128
-     *
129
-     * @param \ReflectionClass $reflector
130
-     * @return mixed
131
-     * @throws InstantiationException
132
-     */
133
-    protected function resolveInstantiationMethod(\ReflectionClass $reflector)
134
-    {
135
-        if ($reflector->getConstructor() === null) {
136
-            return 'NewInstance';
137
-        } else if ($reflector->isInstantiable()) {
138
-            return 'NewInstanceArgs';
139
-        } else if (method_exists($reflector->getName(), 'instance')) {
140
-            return 'instance';
141
-        } else if (method_exists($reflector->getName(), 'new_instance')) {
142
-            return 'new_instance';
143
-        } else if (method_exists($reflector->getName(), 'new_instance_from_db')) {
144
-            return 'new_instance_from_db';
145
-        } else {
146
-            throw new InstantiationException($reflector->getName());
147
-        }
148
-    }
149
-
150
-
151
-
152
-    /**
153
-     * Ensures files for classes that are not PSR-4 compatible are loaded
154
-     * and then verifies that classes exist where applicable
155
-     *
156
-     * @param RecipeInterface $recipe
157
-     * @return bool
158
-     * @throws InvalidClassException
159
-     */
160
-    protected function resolveClassAndFilepath(RecipeInterface $recipe)
161
-    {
162
-        $paths = $recipe->paths();
163
-        if ( ! empty($paths)) {
164
-            foreach ($paths as $path) {
165
-                if (strpos($path, '*') === false && is_readable($path)) {
166
-                    require_once($path);
167
-                }
168
-            }
169
-        }
170
-        // re: using "false" for class_exists() second param:
171
-        // if a class name is not already known to PHP, then class_exists() will run through
172
-        // all of the registered spl_autoload functions until it either finds the class,
173
-        // or gets to the end of the registered spl_autoload functions.
174
-        // When the second parameter is true, it will also attempt to load the class file,
175
-        // but it will also trigger an error if the class can not be loaded.
176
-        // We don't want that extra error in the mix, so we have set the second param to "false"
177
-        if ($recipe->type() !== CoffeeMaker::BREW_LOAD_ONLY && ! class_exists($recipe->fqcn(), false)) {
178
-            throw new InvalidClassException($recipe->identifier());
179
-        }
180
-        return true;
181
-    }
26
+	/**
27
+	 * Indicates that CoffeeMaker should construct a NEW entity instance from the provided arguments (if given)
28
+	 */
29
+	const BREW_NEW = 'new';
30
+
31
+	/**
32
+	 * Indicates that CoffeeMaker should always return a SHARED instance
33
+	 */
34
+	const BREW_SHARED = 'shared';
35
+
36
+	/**
37
+	 * Indicates that CoffeeMaker should only load the file/class/interface but NOT instantiate
38
+	 */
39
+	const BREW_LOAD_ONLY = 'load_only';
40
+
41
+
42
+	/**
43
+	 * @var CoffeePotInterface $coffee_pot
44
+	 */
45
+	private $coffee_pot;
46
+
47
+	/**
48
+	 * @var DependencyInjector $injector
49
+	 */
50
+	private $injector;
51
+
52
+
53
+
54
+	/**
55
+	 * @return array
56
+	 */
57
+	public static function getTypes()
58
+	{
59
+		return (array)apply_filters(
60
+			'FHEE__EventEspresso\core\services\container\CoffeeMaker__getTypes',
61
+			array(
62
+				CoffeeMaker::BREW_NEW,
63
+				CoffeeMaker::BREW_SHARED,
64
+				CoffeeMaker::BREW_LOAD_ONLY,
65
+			)
66
+		);
67
+	}
68
+
69
+
70
+
71
+	/**
72
+	 * @param $type
73
+	 * @throws \EventEspresso\core\exceptions\InvalidIdentifierException
74
+	 */
75
+	public static function validateType($type)
76
+	{
77
+		$types = CoffeeMaker::getTypes();
78
+		if ( ! in_array($type, $types, true)) {
79
+			throw new InvalidIdentifierException(
80
+				is_object($type) ? get_class($type) : gettype($type),
81
+				__(
82
+					'recipe type (one of the class constants on \EventEspresso\core\services\container\CoffeeMaker)',
83
+					'event_espresso'
84
+				)
85
+			);
86
+		}
87
+		return $type;
88
+	}
89
+
90
+
91
+
92
+	/**
93
+	 * CoffeeMaker constructor.
94
+	 *
95
+	 * @param CoffeePotInterface $coffee_pot
96
+	 * @param InjectorInterface  $injector
97
+	 */
98
+	public function __construct(CoffeePotInterface $coffee_pot, InjectorInterface $injector)
99
+	{
100
+		$this->coffee_pot = $coffee_pot;
101
+		$this->injector = $injector;
102
+	}
103
+
104
+
105
+
106
+	/**
107
+	 * @return \EventEspresso\core\services\container\CoffeePotInterface
108
+	 */
109
+	protected function coffeePot()
110
+	{
111
+		return $this->coffee_pot;
112
+	}
113
+
114
+
115
+
116
+	/**
117
+	 * @return \EventEspresso\core\services\container\DependencyInjector
118
+	 */
119
+	protected function injector()
120
+	{
121
+		return $this->injector;
122
+	}
123
+
124
+
125
+
126
+	/**
127
+	 * Examines the constructor to determine which method should be used for instantiation
128
+	 *
129
+	 * @param \ReflectionClass $reflector
130
+	 * @return mixed
131
+	 * @throws InstantiationException
132
+	 */
133
+	protected function resolveInstantiationMethod(\ReflectionClass $reflector)
134
+	{
135
+		if ($reflector->getConstructor() === null) {
136
+			return 'NewInstance';
137
+		} else if ($reflector->isInstantiable()) {
138
+			return 'NewInstanceArgs';
139
+		} else if (method_exists($reflector->getName(), 'instance')) {
140
+			return 'instance';
141
+		} else if (method_exists($reflector->getName(), 'new_instance')) {
142
+			return 'new_instance';
143
+		} else if (method_exists($reflector->getName(), 'new_instance_from_db')) {
144
+			return 'new_instance_from_db';
145
+		} else {
146
+			throw new InstantiationException($reflector->getName());
147
+		}
148
+	}
149
+
150
+
151
+
152
+	/**
153
+	 * Ensures files for classes that are not PSR-4 compatible are loaded
154
+	 * and then verifies that classes exist where applicable
155
+	 *
156
+	 * @param RecipeInterface $recipe
157
+	 * @return bool
158
+	 * @throws InvalidClassException
159
+	 */
160
+	protected function resolveClassAndFilepath(RecipeInterface $recipe)
161
+	{
162
+		$paths = $recipe->paths();
163
+		if ( ! empty($paths)) {
164
+			foreach ($paths as $path) {
165
+				if (strpos($path, '*') === false && is_readable($path)) {
166
+					require_once($path);
167
+				}
168
+			}
169
+		}
170
+		// re: using "false" for class_exists() second param:
171
+		// if a class name is not already known to PHP, then class_exists() will run through
172
+		// all of the registered spl_autoload functions until it either finds the class,
173
+		// or gets to the end of the registered spl_autoload functions.
174
+		// When the second parameter is true, it will also attempt to load the class file,
175
+		// but it will also trigger an error if the class can not be loaded.
176
+		// We don't want that extra error in the mix, so we have set the second param to "false"
177
+		if ($recipe->type() !== CoffeeMaker::BREW_LOAD_ONLY && ! class_exists($recipe->fqcn(), false)) {
178
+			throw new InvalidClassException($recipe->identifier());
179
+		}
180
+		return true;
181
+	}
182 182
 
183 183
 
184 184
 
Please login to merge, or discard this patch.