Completed
Branch FET/extract-activation-detecti... (285969)
by
unknown
02:37 queued 19s
created
core/services/activation/ActivationsAndUpgradesManager.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
             }
92 92
         }
93 93
         // if no activations are scheduled, then just return false
94
-        if($this->activations === array()) {
94
+        if ($this->activations === array()) {
95 95
             return false;
96 96
         }
97 97
         add_action(
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     {
168 168
         foreach ($this->activations as $activation) {
169 169
             $initializer = ActivationsFactory::createInitializer($activation);
170
-            if($initializer instanceof InitializeInterface){
170
+            if ($initializer instanceof InitializeInterface) {
171 171
                 $initializer->initialize();
172 172
             }
173 173
             do_action(
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
     private function deactivateIncompatibleAddons()
189 189
     {
190 190
         $incompatible_addons = get_option(ActivationsAndUpgradesManager::EE_INCOMPATIBLE_ADDONS_OPTION_NAME, array());
191
-        if (! empty($incompatible_addons)) {
191
+        if ( ! empty($incompatible_addons)) {
192 192
             $active_plugins = get_option('active_plugins', array());
193 193
             foreach ($active_plugins as $active_plugin) {
194 194
                 foreach ($incompatible_addons as $incompatible_addon) {
Please login to merge, or discard this patch.
Indentation   +175 added lines, -175 removed lines patch added patch discarded remove patch
@@ -24,181 +24,181 @@
 block discarded – undo
24 24
 class ActivationsAndUpgradesManager
25 25
 {
26 26
 
27
-    /**
28
-     * option name for recording an array of addon names
29
-     * that are not compatible with the current version of core
30
-     */
31
-    const EE_INCOMPATIBLE_ADDONS_OPTION_NAME = 'ee_incompatible_addons';
32
-
33
-    /**
34
-     * @var ActivatableInterface[] $activations
35
-     */
36
-    private $activations = array();
37
-
38
-    /**
39
-     * @var ActivationHandler $activation_handler
40
-     */
41
-    private $activation_handler;
42
-
43
-    /**
44
-     * @var ActivationTypeDetector $activation_type_detector
45
-     */
46
-    private $activation_type_detector;
47
-
48
-
49
-
50
-    /**
51
-     * ActivationsAndUpgradesManager constructor.
52
-     *
53
-     * @param ActivationHandler      $activation_handler
54
-     * @param ActivationTypeDetector $activation_type_detector
55
-     */
56
-    public function __construct(
57
-        ActivationHandler $activation_handler,
58
-        ActivationTypeDetector $activation_type_detector
59
-    ) {
60
-        defined('EVENT_ESPRESSO_VERSION') || exit('No direct script access allowed');
61
-        $this->activation_handler       = $activation_handler;
62
-        $this->activation_type_detector = $activation_type_detector;
63
-    }
64
-
65
-
66
-
67
-    /**
68
-     * @param ActivatableInterface[] $activations
69
-     * @return bool
70
-     * @throws InvalidInterfaceException
71
-     * @throws InvalidDataTypeException
72
-     * @throws InvalidEntityException
73
-     * @throws InvalidArgumentException
74
-     * @throws DomainException
75
-     */
76
-    public function detectActivationsAndVersionChanges(array $activations): bool
77
-    {
78
-        foreach ($activations as $activation) {
79
-            if ( ! $activation instanceof ActivatableInterface) {
80
-                throw new InvalidEntityException(
81
-                    $activation,
82
-                    'EventEspresso\core\services\activation\ActivatableInterface'
83
-                );
84
-            }
85
-            $activation_history = $this->getActivationHistory($activation);
86
-            if (
87
-                $this->activation_handler->detectActivationOrVersionChange(
88
-                    $activation,
89
-                    $this->getActivationType($activation, $activation_history),
90
-                    $activation_history
91
-                )
92
-            ) {
93
-                $this->activations[] = $activation;
94
-            }
95
-        }
96
-        // if no activations are scheduled, then just return false
97
-        if($this->activations === array()) {
98
-            return false;
99
-        }
100
-        add_action(
101
-            'AHEE__EE_System__perform_activations_upgrades_and_migrations',
102
-            array($this, 'performActivationsAndUpgrades')
103
-        );
104
-        return true;
105
-    }
106
-
107
-
108
-
109
-    /**
110
-     * @param ActivatableInterface $activation
111
-     * @return ActivationHistory
112
-     * @throws InvalidArgumentException
113
-     * @throws InvalidInterfaceException
114
-     * @throws InvalidDataTypeException
115
-     * @throws DomainException
116
-     */
117
-    private function getActivationHistory(ActivatableInterface $activation): ActivationHistory
118
-    {
119
-        // get activation history and set arguments array based on activation type
120
-        $activation_history = ActivationsFactory::createActivationHistory($activation);
121
-        if ($activation_history instanceof ActivationHistory) {
122
-            // convert EE Core activation history to the latest format
123
-            if ($activation instanceof EE_System) {
124
-                $migrate_activation_history = ActivationsFactory::getMigrateActivationHistory();
125
-                $activation_history = $migrate_activation_history->updateFormat($activation_history);
126
-            }
127
-            $activation->setActivationHistory($activation_history);
128
-            return $activation_history;
129
-        }
130
-        throw new DomainException(
131
-            sprintf(
132
-                esc_html__(
133
-                    'Could not obtain an ActivationHistory for the "%1$s" Activatable class.',
134
-                    'event_espresso'
135
-                ),
136
-                get_class($activation)
137
-            )
138
-        );
139
-    }
140
-
141
-
142
-
143
-    /**
144
-     * @param ActivatableInterface $activation
145
-     * @param ActivationHistory    $activation_history
146
-     * @return ActivationType
147
-     * @throws InvalidArgumentException
148
-     */
149
-    private function getActivationType(ActivatableInterface $activation, ActivationHistory $activation_history): ActivationType
150
-    {
151
-        // determine whether current request is new activation, upgrade, etc
152
-        $activation_type = $this->activation_type_detector->resolveActivationTypeFromActivationHistory(
153
-            $activation_history
154
-        );
155
-        $activation->setActivationType($activation_type);
156
-        return $activation_type;
157
-    }
158
-
159
-
160
-    /**
161
-     * @return void
162
-     * @throws EE_Error
163
-     * @throws ReflectionException
164
-     */
165
-    public function performActivationsAndUpgrades()
166
-    {
167
-        foreach ($this->activations as $activation) {
168
-            $initializer = ActivationsFactory::createInitializer($activation);
169
-            if($initializer instanceof InitializeInterface){
170
-                $initializer->initialize();
171
-            }
172
-            do_action(
173
-                'AHEE__EventEspresso_core_services_activation_ActivationsAndUpgradesManager__performActivationsAndUpgrades',
174
-                $activation,
175
-                $initializer
176
-            );
177
-        }
178
-        $this->deactivateIncompatibleAddons();
179
-    }
180
-
181
-
182
-
183
-    /**
184
-     * Using the information gathered in EE_System::_incompatible_addon_error,
185
-     * deactivates any addons considered incompatible with the current version of EE
186
-     */
187
-    private function deactivateIncompatibleAddons()
188
-    {
189
-        $incompatible_addons = get_option(ActivationsAndUpgradesManager::EE_INCOMPATIBLE_ADDONS_OPTION_NAME, array());
190
-        if (! empty($incompatible_addons)) {
191
-            $active_plugins = get_option('active_plugins', array());
192
-            foreach ($active_plugins as $active_plugin) {
193
-                foreach ($incompatible_addons as $incompatible_addon) {
194
-                    if (strpos($active_plugin, $incompatible_addon) !== false) {
195
-                        unset($_GET['activate']);
196
-                        espresso_deactivate_plugin($active_plugin);
197
-                    }
198
-                }
199
-            }
200
-        }
201
-    }
27
+	/**
28
+	 * option name for recording an array of addon names
29
+	 * that are not compatible with the current version of core
30
+	 */
31
+	const EE_INCOMPATIBLE_ADDONS_OPTION_NAME = 'ee_incompatible_addons';
32
+
33
+	/**
34
+	 * @var ActivatableInterface[] $activations
35
+	 */
36
+	private $activations = array();
37
+
38
+	/**
39
+	 * @var ActivationHandler $activation_handler
40
+	 */
41
+	private $activation_handler;
42
+
43
+	/**
44
+	 * @var ActivationTypeDetector $activation_type_detector
45
+	 */
46
+	private $activation_type_detector;
47
+
48
+
49
+
50
+	/**
51
+	 * ActivationsAndUpgradesManager constructor.
52
+	 *
53
+	 * @param ActivationHandler      $activation_handler
54
+	 * @param ActivationTypeDetector $activation_type_detector
55
+	 */
56
+	public function __construct(
57
+		ActivationHandler $activation_handler,
58
+		ActivationTypeDetector $activation_type_detector
59
+	) {
60
+		defined('EVENT_ESPRESSO_VERSION') || exit('No direct script access allowed');
61
+		$this->activation_handler       = $activation_handler;
62
+		$this->activation_type_detector = $activation_type_detector;
63
+	}
64
+
65
+
66
+
67
+	/**
68
+	 * @param ActivatableInterface[] $activations
69
+	 * @return bool
70
+	 * @throws InvalidInterfaceException
71
+	 * @throws InvalidDataTypeException
72
+	 * @throws InvalidEntityException
73
+	 * @throws InvalidArgumentException
74
+	 * @throws DomainException
75
+	 */
76
+	public function detectActivationsAndVersionChanges(array $activations): bool
77
+	{
78
+		foreach ($activations as $activation) {
79
+			if ( ! $activation instanceof ActivatableInterface) {
80
+				throw new InvalidEntityException(
81
+					$activation,
82
+					'EventEspresso\core\services\activation\ActivatableInterface'
83
+				);
84
+			}
85
+			$activation_history = $this->getActivationHistory($activation);
86
+			if (
87
+				$this->activation_handler->detectActivationOrVersionChange(
88
+					$activation,
89
+					$this->getActivationType($activation, $activation_history),
90
+					$activation_history
91
+				)
92
+			) {
93
+				$this->activations[] = $activation;
94
+			}
95
+		}
96
+		// if no activations are scheduled, then just return false
97
+		if($this->activations === array()) {
98
+			return false;
99
+		}
100
+		add_action(
101
+			'AHEE__EE_System__perform_activations_upgrades_and_migrations',
102
+			array($this, 'performActivationsAndUpgrades')
103
+		);
104
+		return true;
105
+	}
106
+
107
+
108
+
109
+	/**
110
+	 * @param ActivatableInterface $activation
111
+	 * @return ActivationHistory
112
+	 * @throws InvalidArgumentException
113
+	 * @throws InvalidInterfaceException
114
+	 * @throws InvalidDataTypeException
115
+	 * @throws DomainException
116
+	 */
117
+	private function getActivationHistory(ActivatableInterface $activation): ActivationHistory
118
+	{
119
+		// get activation history and set arguments array based on activation type
120
+		$activation_history = ActivationsFactory::createActivationHistory($activation);
121
+		if ($activation_history instanceof ActivationHistory) {
122
+			// convert EE Core activation history to the latest format
123
+			if ($activation instanceof EE_System) {
124
+				$migrate_activation_history = ActivationsFactory::getMigrateActivationHistory();
125
+				$activation_history = $migrate_activation_history->updateFormat($activation_history);
126
+			}
127
+			$activation->setActivationHistory($activation_history);
128
+			return $activation_history;
129
+		}
130
+		throw new DomainException(
131
+			sprintf(
132
+				esc_html__(
133
+					'Could not obtain an ActivationHistory for the "%1$s" Activatable class.',
134
+					'event_espresso'
135
+				),
136
+				get_class($activation)
137
+			)
138
+		);
139
+	}
140
+
141
+
142
+
143
+	/**
144
+	 * @param ActivatableInterface $activation
145
+	 * @param ActivationHistory    $activation_history
146
+	 * @return ActivationType
147
+	 * @throws InvalidArgumentException
148
+	 */
149
+	private function getActivationType(ActivatableInterface $activation, ActivationHistory $activation_history): ActivationType
150
+	{
151
+		// determine whether current request is new activation, upgrade, etc
152
+		$activation_type = $this->activation_type_detector->resolveActivationTypeFromActivationHistory(
153
+			$activation_history
154
+		);
155
+		$activation->setActivationType($activation_type);
156
+		return $activation_type;
157
+	}
158
+
159
+
160
+	/**
161
+	 * @return void
162
+	 * @throws EE_Error
163
+	 * @throws ReflectionException
164
+	 */
165
+	public function performActivationsAndUpgrades()
166
+	{
167
+		foreach ($this->activations as $activation) {
168
+			$initializer = ActivationsFactory::createInitializer($activation);
169
+			if($initializer instanceof InitializeInterface){
170
+				$initializer->initialize();
171
+			}
172
+			do_action(
173
+				'AHEE__EventEspresso_core_services_activation_ActivationsAndUpgradesManager__performActivationsAndUpgrades',
174
+				$activation,
175
+				$initializer
176
+			);
177
+		}
178
+		$this->deactivateIncompatibleAddons();
179
+	}
180
+
181
+
182
+
183
+	/**
184
+	 * Using the information gathered in EE_System::_incompatible_addon_error,
185
+	 * deactivates any addons considered incompatible with the current version of EE
186
+	 */
187
+	private function deactivateIncompatibleAddons()
188
+	{
189
+		$incompatible_addons = get_option(ActivationsAndUpgradesManager::EE_INCOMPATIBLE_ADDONS_OPTION_NAME, array());
190
+		if (! empty($incompatible_addons)) {
191
+			$active_plugins = get_option('active_plugins', array());
192
+			foreach ($active_plugins as $active_plugin) {
193
+				foreach ($incompatible_addons as $incompatible_addon) {
194
+					if (strpos($active_plugin, $incompatible_addon) !== false) {
195
+						unset($_GET['activate']);
196
+						espresso_deactivate_plugin($active_plugin);
197
+					}
198
+				}
199
+			}
200
+		}
201
+	}
202 202
 
203 203
 
204 204
 }
Please login to merge, or discard this patch.
acceptance_tests/tests/e-TestContextActivationToggleCept.php 1 patch
Indentation   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@  discard block
 block discarded – undo
8 8
 $event_label = 'Testing Context Deactivation';
9 9
 
10 10
 $I->wantTo(
11
-    'Test that the context activation toggle for turning on or off specific contexts for message sending works as'
12
-    . ' expected'
11
+	'Test that the context activation toggle for turning on or off specific contexts for message sending works as'
12
+	. ' expected'
13 13
 );
14 14
 
15 15
 $I->loginAsAdmin();
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 $I->see('The template for Primary Registrant Recipient is currently inactive.');
35 35
 
36 36
 $I->amGoingTo(
37
-    'Trigger Registration Approved Messages and verify primary registrant context is excluded from sent messages.'
37
+	'Trigger Registration Approved Messages and verify primary registrant context is excluded from sent messages.'
38 38
 );
39 39
 $I->amOnDefaultEventsListTablePage();
40 40
 $I->click(EventsAdmin::ADD_NEW_EVENT_BUTTON_SELECTOR);
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
 $event_link = $I->observeLinkUrlAt(EventsAdmin::EVENT_EDITOR_VIEW_LINK_AFTER_PUBLISH_SELECTOR);
45 45
 $event_id = $I->observeValueFromInputAt(EventsAdmin::EVENT_EDITOR_EVT_ID_SELECTOR);
46 46
 $test_registration_details = array(
47
-    'fname' => 'ContextTestGuy',
48
-    'lname' => 'ContextTestDude',
49
-    'email' => '[email protected]',
47
+	'fname' => 'ContextTestGuy',
48
+	'lname' => 'ContextTestDude',
49
+	'email' => '[email protected]',
50 50
 );
51 51
 $I->logOut();
52 52
 $I->amOnUrl($event_link);
@@ -63,48 +63,48 @@  discard block
 block discarded – undo
63 63
 $I->amOnMessagesActivityListTablePage();
64 64
 //verify registrant context
65 65
 $I->see(
66
-    $test_registration_details['email'],
67
-    MessagesAdmin::messagesActivityListTableCellSelectorFor(
68
-        'to',
69
-        'Registration Approved',
70
-        MessagesAdmin::MESSAGE_STATUS_SENT,
71
-        '',
72
-        'Registrant'
73
-    )
66
+	$test_registration_details['email'],
67
+	MessagesAdmin::messagesActivityListTableCellSelectorFor(
68
+		'to',
69
+		'Registration Approved',
70
+		MessagesAdmin::MESSAGE_STATUS_SENT,
71
+		'',
72
+		'Registrant'
73
+	)
74 74
 );
75 75
 $I->deleteMessageInMessagesListTableFor(
76
-    'Registration Approved',
77
-    MessagesAdmin::MESSAGE_STATUS_SENT,
78
-    'Email',
79
-    'Registrant'
76
+	'Registration Approved',
77
+	MessagesAdmin::MESSAGE_STATUS_SENT,
78
+	'Email',
79
+	'Registrant'
80 80
 );
81 81
 //verify admin context
82 82
 $I->see(
83
-    '[email protected]',
84
-    MessagesAdmin::messagesActivityListTableCellSelectorFor(
85
-        'to',
86
-        'Registration Approved',
87
-        MessagesAdmin::MESSAGE_STATUS_SENT
88
-    )
83
+	'[email protected]',
84
+	MessagesAdmin::messagesActivityListTableCellSelectorFor(
85
+		'to',
86
+		'Registration Approved',
87
+		MessagesAdmin::MESSAGE_STATUS_SENT
88
+	)
89 89
 );
90 90
 $I->deleteMessageInMessagesListTableFor(
91
-    'Registration Approved'
91
+	'Registration Approved'
92 92
 );
93 93
 //verify primary registrant context is NOT present.
94 94
 $I->dontSee(
95
-    $test_registration_details['email'],
96
-    MessagesAdmin::messagesActivityListTableCellSelectorFor(
97
-        'to',
98
-        'Registration Approved',
99
-        MessagesAdmin::MESSAGE_STATUS_SENT,
100
-        '',
101
-        'Primary Registrant'
102
-    )
95
+	$test_registration_details['email'],
96
+	MessagesAdmin::messagesActivityListTableCellSelectorFor(
97
+		'to',
98
+		'Registration Approved',
99
+		MessagesAdmin::MESSAGE_STATUS_SENT,
100
+		'',
101
+		'Primary Registrant'
102
+	)
103 103
 );
104 104
 
105 105
 $I->amGoingTo(
106
-    'Deactivate primary registrant context for Registration Approved Message Templates and restore the "To"'
107
-    . ' field to an empty string to verify the message does not send for that context.'
106
+	'Deactivate primary registrant context for Registration Approved Message Templates and restore the "To"'
107
+	. ' field to an empty string to verify the message does not send for that context.'
108 108
 );
109 109
 $I->amOnDefaultMessageTemplateListTablePage();
110 110
 $I->clickToEditMessageTemplateByMessageType('registration', 'primary_attendee');
@@ -128,41 +128,41 @@  discard block
 block discarded – undo
128 128
 $I->amOnMessagesActivityListTablePage();
129 129
 //verify registrant context
130 130
 $I->see(
131
-    $test_registration_details['email'],
132
-    MessagesAdmin::messagesActivityListTableCellSelectorFor(
133
-        'to',
134
-        'Registration Approved',
135
-        MessagesAdmin::MESSAGE_STATUS_SENT,
136
-        '',
137
-        'Registrant'
138
-    )
131
+	$test_registration_details['email'],
132
+	MessagesAdmin::messagesActivityListTableCellSelectorFor(
133
+		'to',
134
+		'Registration Approved',
135
+		MessagesAdmin::MESSAGE_STATUS_SENT,
136
+		'',
137
+		'Registrant'
138
+	)
139 139
 );
140 140
 $I->deleteMessageInMessagesListTableFor(
141
-    'Registration Approved',
142
-    MessagesAdmin::MESSAGE_STATUS_SENT,
143
-    'Email',
144
-    'Registrant'
141
+	'Registration Approved',
142
+	MessagesAdmin::MESSAGE_STATUS_SENT,
143
+	'Email',
144
+	'Registrant'
145 145
 );
146 146
 //verify admin context
147 147
 $I->see(
148
-    '[email protected]',
149
-    MessagesAdmin::messagesActivityListTableCellSelectorFor(
150
-        'to',
151
-        'Registration Approved',
152
-        MessagesAdmin::MESSAGE_STATUS_SENT
153
-    )
148
+	'[email protected]',
149
+	MessagesAdmin::messagesActivityListTableCellSelectorFor(
150
+		'to',
151
+		'Registration Approved',
152
+		MessagesAdmin::MESSAGE_STATUS_SENT
153
+	)
154 154
 );
155 155
 $I->deleteMessageInMessagesListTableFor(
156
-    'Registration Approved'
156
+	'Registration Approved'
157 157
 );
158 158
 //verify primary registrant context is NOT present.
159 159
 $I->dontSee(
160
-    $test_registration_details['email'],
161
-    MessagesAdmin::messagesActivityListTableCellSelectorFor(
162
-        'to',
163
-        'Registration Approved',
164
-        MessagesAdmin::MESSAGE_STATUS_SENT,
165
-        '',
166
-        'Primary Registrant'
167
-    )
160
+	$test_registration_details['email'],
161
+	MessagesAdmin::messagesActivityListTableCellSelectorFor(
162
+		'to',
163
+		'Registration Approved',
164
+		MessagesAdmin::MESSAGE_STATUS_SENT,
165
+		'',
166
+		'Primary Registrant'
167
+	)
168 168
 );
169 169
\ No newline at end of file
Please login to merge, or discard this patch.
admin_pages/messages/help_tabs/messages_settings_messengers.help_tab.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,16 +19,16 @@
 block discarded – undo
19 19
             'The green colored gear %s indicates that this messenger is currently active.',
20 20
             'event_espresso'
21 21
         ),
22
-        '<img class="inline-text" src="' . EE_MSG_ASSETS_URL . 'images/email-tab-active.png' . '"'
23
-        . ' alt="' . esc_attr__('Active Email Tab', 'event_espresso') . '" />'
22
+        '<img class="inline-text" src="'.EE_MSG_ASSETS_URL.'images/email-tab-active.png'.'"'
23
+        . ' alt="'.esc_attr__('Active Email Tab', 'event_espresso').'" />'
24 24
     );
25 25
     printf(
26 26
         esc_html__(
27 27
             ' The white colored gear %s indicates the messenger is inactive. This is very helpful for seeing at a glance all the messengers that are active when you first view the page.',
28 28
             'event_espresso'
29 29
         ),
30
-        '<img class="inline-text" src="' . EE_MSG_ASSETS_URL . 'images/email-tab-inactive.png'
31
-        . '" alt="' . esc_attr__('Inactive Email Tab', 'event_espresso') . '" />'
30
+        '<img class="inline-text" src="'.EE_MSG_ASSETS_URL.'images/email-tab-inactive.png'
31
+        . '" alt="'.esc_attr__('Inactive Email Tab', 'event_espresso').'" />'
32 32
     ); ?>
33 33
 </p>
34 34
 <p>
Please login to merge, or discard this patch.
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -3,79 +3,79 @@
 block discarded – undo
3 3
 </p>
4 4
 <p>
5 5
     <?php esc_html_e(
6
-        'You can select Messengers via the tabs across the top of the settings page. The available messengers you see depends on what version of Event Espresso you have and what addons are installed. Every install include an "Email" messenger tab.  When you click one of those tabs it will display that messenger.',
7
-        'event_espresso'
8
-    ); ?>
6
+		'You can select Messengers via the tabs across the top of the settings page. The available messengers you see depends on what version of Event Espresso you have and what addons are installed. Every install include an "Email" messenger tab.  When you click one of those tabs it will display that messenger.',
7
+		'event_espresso'
8
+	); ?>
9 9
 </p>
10 10
 <p>
11 11
     <?php esc_html_e(
12
-        'There are two ways to determine whether a messenger is active or not.  The first way is via the messenger tab itself.',
13
-        'event_espresso'
14
-    ); ?>
12
+		'There are two ways to determine whether a messenger is active or not.  The first way is via the messenger tab itself.',
13
+		'event_espresso'
14
+	); ?>
15 15
 </p>
16 16
 <p>
17 17
     <?php printf(
18
-        esc_html__(
19
-            'The green colored gear %s indicates that this messenger is currently active.',
20
-            'event_espresso'
21
-        ),
22
-        '<img class="inline-text" src="' . EE_MSG_ASSETS_URL . 'images/email-tab-active.png' . '"'
23
-        . ' alt="' . esc_attr__('Active Email Tab', 'event_espresso') . '" />'
24
-    );
25
-    printf(
26
-        esc_html__(
27
-            ' The white colored gear %s indicates the messenger is inactive. This is very helpful for seeing at a glance all the messengers that are active when you first view the page.',
28
-            'event_espresso'
29
-        ),
30
-        '<img class="inline-text" src="' . EE_MSG_ASSETS_URL . 'images/email-tab-inactive.png'
31
-        . '" alt="' . esc_attr__('Inactive Email Tab', 'event_espresso') . '" />'
32
-    ); ?>
18
+		esc_html__(
19
+			'The green colored gear %s indicates that this messenger is currently active.',
20
+			'event_espresso'
21
+		),
22
+		'<img class="inline-text" src="' . EE_MSG_ASSETS_URL . 'images/email-tab-active.png' . '"'
23
+		. ' alt="' . esc_attr__('Active Email Tab', 'event_espresso') . '" />'
24
+	);
25
+	printf(
26
+		esc_html__(
27
+			' The white colored gear %s indicates the messenger is inactive. This is very helpful for seeing at a glance all the messengers that are active when you first view the page.',
28
+			'event_espresso'
29
+		),
30
+		'<img class="inline-text" src="' . EE_MSG_ASSETS_URL . 'images/email-tab-inactive.png'
31
+		. '" alt="' . esc_attr__('Inactive Email Tab', 'event_espresso') . '" />'
32
+	); ?>
33 33
 </p>
34 34
 <p>
35 35
     <?php esc_html_e(
36
-        'The second way to determine whether a messenger is active or not is via the "on/off" button in the top right corner of the active messenger displayed content:',
37
-        'event_espresso'
38
-    ); ?>
36
+		'The second way to determine whether a messenger is active or not is via the "on/off" button in the top right corner of the active messenger displayed content:',
37
+		'event_espresso'
38
+	); ?>
39 39
 </p>
40 40
 <p>
41 41
     <?php printf(
42
-        esc_html__(
43
-            '%1$s means of course that the messenger is active and %2$s means the messenger is inactive.',
44
-            'event_espresso'
45
-        ),
46
-        '<div class="switch">'
47
-        . '<input class="ee-on-off-toggle ee-toggle-round-flat" type="checkbox" checked disabled>'
48
-        . '<label for="ee-on-off-toggle-on"></label>'
49
-        . '</div>',
50
-        '<div class="switch">'
51
-        . '<input class="ee-on-off-toggle ee-toggle-round-flat" type="checkbox" disabled>'
52
-        . '<label for="ee-on-off-toggle-on"></label>'
53
-        . '</div>'
54
-    ); ?>
42
+		esc_html__(
43
+			'%1$s means of course that the messenger is active and %2$s means the messenger is inactive.',
44
+			'event_espresso'
45
+		),
46
+		'<div class="switch">'
47
+		. '<input class="ee-on-off-toggle ee-toggle-round-flat" type="checkbox" checked disabled>'
48
+		. '<label for="ee-on-off-toggle-on"></label>'
49
+		. '</div>',
50
+		'<div class="switch">'
51
+		. '<input class="ee-on-off-toggle ee-toggle-round-flat" type="checkbox" disabled>'
52
+		. '<label for="ee-on-off-toggle-on"></label>'
53
+		. '</div>'
54
+	); ?>
55 55
 </p>
56 56
 <p>
57 57
     <?php
58
-    esc_html_e(
59
-        'The on/off toggle is also what you use to activate or deactivate a messenger.',
60
-        'event_espresso'
61
-    ); ?>
58
+	esc_html_e(
59
+		'The on/off toggle is also what you use to activate or deactivate a messenger.',
60
+		'event_espresso'
61
+	); ?>
62 62
 </p>
63 63
 <p>
64 64
     <?php esc_html_e(
65
-        'What happens when you click the toggle to activate is the messenger is activated and the system determines what default message types are activated with the messenger.  Then, if there are any default settings for either the messenger or message types those settings are saved.  Next, the system will generate any default templates (if none have been generated before, if there are previously generated templates then they are reactivated).  Finally, you will see the display change to reflect that the messenger is active. If the messenger has settings you can modify them then. Any message types that have settings will also automatically expand so you can see the default settings and make any changes as necessary to fit your needs. Usually the defaults are sufficient however.',
66
-        'event_espresso'
67
-    ); ?>
65
+		'What happens when you click the toggle to activate is the messenger is activated and the system determines what default message types are activated with the messenger.  Then, if there are any default settings for either the messenger or message types those settings are saved.  Next, the system will generate any default templates (if none have been generated before, if there are previously generated templates then they are reactivated).  Finally, you will see the display change to reflect that the messenger is active. If the messenger has settings you can modify them then. Any message types that have settings will also automatically expand so you can see the default settings and make any changes as necessary to fit your needs. Usually the defaults are sufficient however.',
66
+		'event_espresso'
67
+	); ?>
68 68
 </p>
69 69
 <p>
70 70
     <?php esc_html_e(
71
-        'When you deactivate a messenger, the system will first check if there are any custom event templates for that messenger. If there are you will be unable to deactivate the messenger. This is a fail safe to make sure you know that no messages will go out for those specific events so you don\'t accidentally deactivate.  If this check passes, then the system will deactivate any global templates for that messenger (note the templates are not erased, they just become inactive, so if you decide to reactivate the messenger later all your customizations are preserved). Then the display will change to reflect the deactivation.',
72
-        'event_espresso'
73
-    ); ?>
71
+		'When you deactivate a messenger, the system will first check if there are any custom event templates for that messenger. If there are you will be unable to deactivate the messenger. This is a fail safe to make sure you know that no messages will go out for those specific events so you don\'t accidentally deactivate.  If this check passes, then the system will deactivate any global templates for that messenger (note the templates are not erased, they just become inactive, so if you decide to reactivate the messenger later all your customizations are preserved). Then the display will change to reflect the deactivation.',
72
+		'event_espresso'
73
+	); ?>
74 74
 </p>
75 75
 <p>
76 76
     <strong><?php esc_html_e('Important', 'event_espresso'); ?></strong><br />
77 77
     <?php esc_html_e(
78
-        'Although customizations made to global templates are preserved when a messenger is deactivated, any settings for that messenger (or the message types that were attached to it) are lost on deactivation.  Also, once you deactivate a messenger, no more messages will be delivered using that messenger for any of your events.',
79
-        'event_espresso'
80
-    ); ?>
78
+		'Although customizations made to global templates are preserved when a messenger is deactivated, any settings for that messenger (or the message types that were attached to it) are lost on deactivation.  Also, once you deactivate a messenger, no more messages will be delivered using that messenger for any of your events.',
79
+		'event_espresso'
80
+	); ?>
81 81
 </p>
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Datepicker_Input.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
             )
30 30
         );
31 31
         parent::__construct($input_settings);
32
-        $this->set_html_class($this->html_class() . ' datepicker');
32
+        $this->set_html_class($this->html_class().' datepicker');
33 33
         // add some style and make it dance
34 34
         add_action('wp_enqueue_scripts', array('EE_Datepicker_Input', 'enqueue_styles_and_scripts'));
35 35
         add_action('admin_enqueue_scripts', array('EE_Datepicker_Input', 'enqueue_styles_and_scripts'));
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         // load css
49 49
         wp_register_style(
50 50
             'espresso-ui-theme',
51
-            EE_GLOBAL_ASSETS_URL . 'css/espresso-ui-theme/jquery-ui-1.10.3.custom.min.css',
51
+            EE_GLOBAL_ASSETS_URL.'css/espresso-ui-theme/jquery-ui-1.10.3.custom.min.css',
52 52
             array(),
53 53
             EVENT_ESPRESSO_VERSION
54 54
         );
Please login to merge, or discard this patch.
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -9,45 +9,45 @@
 block discarded – undo
9 9
  */
10 10
 class EE_Datepicker_Input extends EE_Form_Input_Base
11 11
 {
12
-    /**
13
-     * @param array $input_settings
14
-     */
15
-    public function __construct($input_settings = array())
16
-    {
17
-        $this->_set_display_strategy(new EE_Text_Input_Display_Strategy('datepicker'));
18
-        $this->_set_normalization_strategy(new EE_Text_Normalization());
19
-        // we could do better for validation, but at least verify its plaintext
20
-        $this->_add_validation_strategy(
21
-            new EE_Plaintext_Validation_Strategy(
22
-                isset($input_settings['validation_error_message'])
23
-                    ? $input_settings['validation_error_message']
24
-                    : null
25
-            )
26
-        );
27
-        parent::__construct($input_settings);
28
-        $this->set_html_class($this->html_class() . ' datepicker');
29
-        // add some style and make it dance
30
-        add_action('wp_enqueue_scripts', array('EE_Datepicker_Input', 'enqueue_styles_and_scripts'));
31
-        add_action('admin_enqueue_scripts', array('EE_Datepicker_Input', 'enqueue_styles_and_scripts'));
32
-    }
12
+	/**
13
+	 * @param array $input_settings
14
+	 */
15
+	public function __construct($input_settings = array())
16
+	{
17
+		$this->_set_display_strategy(new EE_Text_Input_Display_Strategy('datepicker'));
18
+		$this->_set_normalization_strategy(new EE_Text_Normalization());
19
+		// we could do better for validation, but at least verify its plaintext
20
+		$this->_add_validation_strategy(
21
+			new EE_Plaintext_Validation_Strategy(
22
+				isset($input_settings['validation_error_message'])
23
+					? $input_settings['validation_error_message']
24
+					: null
25
+			)
26
+		);
27
+		parent::__construct($input_settings);
28
+		$this->set_html_class($this->html_class() . ' datepicker');
29
+		// add some style and make it dance
30
+		add_action('wp_enqueue_scripts', array('EE_Datepicker_Input', 'enqueue_styles_and_scripts'));
31
+		add_action('admin_enqueue_scripts', array('EE_Datepicker_Input', 'enqueue_styles_and_scripts'));
32
+	}
33 33
 
34 34
 
35 35
 
36
-    /**
37
-     *    enqueue_styles_and_scripts
38
-     *
39
-     * @access        public
40
-     * @return        void
41
-     */
42
-    public static function enqueue_styles_and_scripts()
43
-    {
44
-        // load css
45
-        wp_register_style(
46
-            'espresso-ui-theme',
47
-            EE_GLOBAL_ASSETS_URL . 'css/espresso-ui-theme/jquery-ui-1.10.3.custom.min.css',
48
-            array(),
49
-            EVENT_ESPRESSO_VERSION
50
-        );
51
-        wp_enqueue_style('espresso-ui-theme');
52
-    }
36
+	/**
37
+	 *    enqueue_styles_and_scripts
38
+	 *
39
+	 * @access        public
40
+	 * @return        void
41
+	 */
42
+	public static function enqueue_styles_and_scripts()
43
+	{
44
+		// load css
45
+		wp_register_style(
46
+			'espresso-ui-theme',
47
+			EE_GLOBAL_ASSETS_URL . 'css/espresso-ui-theme/jquery-ui-1.10.3.custom.min.css',
48
+			array(),
49
+			EVENT_ESPRESSO_VERSION
50
+		);
51
+		wp_enqueue_style('espresso-ui-theme');
52
+	}
53 53
 }
Please login to merge, or discard this patch.
public/Espresso_Arabica_2014/loop-espresso_event_attendees.php 3 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
  * @type bool       $show_gravatar  whether to show gravatar or not.
16 16
  */
17 17
 
18
-$no_attendees_message =  apply_filters( 'FHEE__loop-espresso_attendees-shortcode__template__no_attendees_message', __('No Attendees Yet', 'event_espresso' ) );
18
+$no_attendees_message = apply_filters('FHEE__loop-espresso_attendees-shortcode__template__no_attendees_message', __('No Attendees Yet', 'event_espresso'));
19 19
 
20 20
 
21 21
 ?>
@@ -31,16 +31,16 @@  discard block
 block discarded – undo
31 31
             $show_gravatar,
32 32
         )
33 33
     ); ?>
34
-	<?php if ( $contacts ) : ?>
34
+	<?php if ($contacts) : ?>
35 35
 		<ul class="event-attendees-list">
36
-			<?php foreach( $contacts as $contact ) :
37
-				EEH_Template::get_template_part( 'content', 'espresso_event_attendees', array( 
36
+			<?php foreach ($contacts as $contact) :
37
+				EEH_Template::get_template_part('content', 'espresso_event_attendees', array( 
38 38
 					'contact'       => $contact, 
39 39
 					'event'         => $event,
40 40
 					'datetime'      => $datetime,
41 41
 					'ticket'        => $ticket,
42 42
 					'show_gravatar' => $show_gravatar 
43
-				) );
43
+				));
44 44
 				endforeach; ?>
45 45
 		</ul>
46 46
 	<?php else : ?>
Please login to merge, or discard this patch.
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -22,15 +22,15 @@  discard block
 block discarded – undo
22 22
 
23 23
 <div class="event-attendees">
24 24
     <?php do_action_ref_array(
25
-        'AHEE__loop-espresso_event_attendees__before',
26
-        array(
27
-            $contacts,
28
-            $event,
29
-            $datetime,
30
-            $ticket,
31
-            $show_gravatar,
32
-        )
33
-    ); ?>
25
+		'AHEE__loop-espresso_event_attendees__before',
26
+		array(
27
+			$contacts,
28
+			$event,
29
+			$datetime,
30
+			$ticket,
31
+			$show_gravatar,
32
+		)
33
+	); ?>
34 34
 	<?php if ( $contacts ) : ?>
35 35
 		<ul class="event-attendees-list">
36 36
 			<?php foreach( $contacts as $contact ) :
@@ -47,13 +47,13 @@  discard block
 block discarded – undo
47 47
 		<p><?php echo esc_html($no_attendees_message); ?></p>
48 48
 	<?php endif; ?>
49 49
     <?php do_action_ref_array(
50
-        'AHEE__loop-espresso_event_attendees__after',
51
-        array(
52
-            $contacts,
53
-            $event,
54
-            $datetime,
55
-            $ticket,
56
-            $show_gravatar,
57
-        )
58
-    ); ?>
50
+		'AHEE__loop-espresso_event_attendees__after',
51
+		array(
52
+			$contacts,
53
+			$event,
54
+			$datetime,
55
+			$ticket,
56
+			$show_gravatar,
57
+		)
58
+	); ?>
59 59
 </div>
60 60
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,8 +43,11 @@
 block discarded – undo
43 43
 				) );
44 44
 				endforeach; ?>
45 45
 		</ul>
46
-	<?php else : ?>
47
-		<p><?php echo esc_html($no_attendees_message); ?></p>
46
+	<?php else {
47
+	: ?>
48
+		<p><?php echo esc_html($no_attendees_message);
49
+}
50
+?></p>
48 51
 	<?php endif; ?>
49 52
     <?php do_action_ref_array(
50 53
         'AHEE__loop-espresso_event_attendees__after',
Please login to merge, or discard this patch.
acceptance_tests/Helpers/BaseCoreAdmin.php 1 patch
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -13,72 +13,72 @@
 block discarded – undo
13 13
 trait BaseCoreAdmin
14 14
 {
15 15
 
16
-    /**
17
-     * Core method for going to an Event Espresso Admin page.
18
-     * @param string $page
19
-     * @param string $action
20
-     * @param string $additional_params
21
-     */
22
-    public function amOnEventEspressoAdminPage($page = '', $action = '', $additional_params = '')
23
-    {
24
-        $this->actor()->amOnAdminPage(CoreAdmin::adminUrl($page, $action, $additional_params));
25
-    }
16
+	/**
17
+	 * Core method for going to an Event Espresso Admin page.
18
+	 * @param string $page
19
+	 * @param string $action
20
+	 * @param string $additional_params
21
+	 */
22
+	public function amOnEventEspressoAdminPage($page = '', $action = '', $additional_params = '')
23
+	{
24
+		$this->actor()->amOnAdminPage(CoreAdmin::adminUrl($page, $action, $additional_params));
25
+	}
26 26
 
27 27
 
28
-    /**
29
-     * Helper method for returning an instance of the Actor.  Intended to help with IDE fill out of methods.
30
-     * @return \EventEspressoAcceptanceTester;
31
-     */
32
-    protected function actor()
33
-    {
34
-        /** @var \EventEspressoAcceptanceTester $this */
35
-        return $this;
36
-    }
28
+	/**
29
+	 * Helper method for returning an instance of the Actor.  Intended to help with IDE fill out of methods.
30
+	 * @return \EventEspressoAcceptanceTester;
31
+	 */
32
+	protected function actor()
33
+	{
34
+		/** @var \EventEspressoAcceptanceTester $this */
35
+		return $this;
36
+	}
37 37
 
38 38
 
39
-    /**
40
-     * Use this to set the per page option for a list table page.
41
-     * Assumes you are on a page that has this field exposed.
42
-     *
43
-     * @param int|string $per_page_value
44
-     * @throws \Codeception\Exception\TestRuntimeException
45
-     */
46
-    public function setPerPageOptionForScreen($per_page_value)
47
-    {
48
-        $this->actor()->click(CoreAdmin::WP_SCREEN_SETTINGS_LINK_SELECTOR);
49
-        $this->actor()->fillField(CoreAdmin::WP_SCREEN_SETTINGS_PER_PAGE_FIELD_SELECTOR, $per_page_value);
50
-        $this->actor()->click(CoreAdmin::WP_SCREEN_OPTIONS_APPLY_SETTINGS_BUTTON_SELECTOR);
51
-        $this->actor()->wait(8);
52
-    }
39
+	/**
40
+	 * Use this to set the per page option for a list table page.
41
+	 * Assumes you are on a page that has this field exposed.
42
+	 *
43
+	 * @param int|string $per_page_value
44
+	 * @throws \Codeception\Exception\TestRuntimeException
45
+	 */
46
+	public function setPerPageOptionForScreen($per_page_value)
47
+	{
48
+		$this->actor()->click(CoreAdmin::WP_SCREEN_SETTINGS_LINK_SELECTOR);
49
+		$this->actor()->fillField(CoreAdmin::WP_SCREEN_SETTINGS_PER_PAGE_FIELD_SELECTOR, $per_page_value);
50
+		$this->actor()->click(CoreAdmin::WP_SCREEN_OPTIONS_APPLY_SETTINGS_BUTTON_SELECTOR);
51
+		$this->actor()->wait(8);
52
+	}
53 53
 
54 54
 
55 55
 
56
-    /**
57
-     * Use this to append a given value to a wpEditor instance.
58
-     * How it works is it first switched the instance to the text (or html) view so that the textarea is exposed and
59
-     * the value is added to the text area.
60
-     *
61
-     * @param $field_reference
62
-     * @param $value
63
-     * @throws \Codeception\Exception\ElementNotFound
64
-     */
65
-    public function appendToWPEditorField($field_reference, $value)
66
-    {
67
-        $this->actor()->click(CoreAdmin::wpEditorTextTabSelector($field_reference));
68
-        $this->actor()->appendField(CoreAdmin::wpEditorTextAreaSelector($field_reference), $value);
69
-    }
56
+	/**
57
+	 * Use this to append a given value to a wpEditor instance.
58
+	 * How it works is it first switched the instance to the text (or html) view so that the textarea is exposed and
59
+	 * the value is added to the text area.
60
+	 *
61
+	 * @param $field_reference
62
+	 * @param $value
63
+	 * @throws \Codeception\Exception\ElementNotFound
64
+	 */
65
+	public function appendToWPEditorField($field_reference, $value)
66
+	{
67
+		$this->actor()->click(CoreAdmin::wpEditorTextTabSelector($field_reference));
68
+		$this->actor()->appendField(CoreAdmin::wpEditorTextAreaSelector($field_reference), $value);
69
+	}
70 70
 
71 71
 
72
-    /**
73
-     * Use to select and submit the given bulk action.
74
-     * @param string $bulk_action_option
75
-     */
76
-    public function submitBulkActionOnListTable($bulk_action_option)
77
-    {
78
-        $this->actor()->selectOption(
79
-            CoreAdmin::SELECTOR_LIST_TABLE_BULK_ACTION_FIELD,
80
-            $bulk_action_option
81
-        );
82
-        $this->actor()->click(CoreAdmin::SELECTOR_LIST_TABLE_BULK_ACTTION_APPLY);
83
-    }
72
+	/**
73
+	 * Use to select and submit the given bulk action.
74
+	 * @param string $bulk_action_option
75
+	 */
76
+	public function submitBulkActionOnListTable($bulk_action_option)
77
+	{
78
+		$this->actor()->selectOption(
79
+			CoreAdmin::SELECTOR_LIST_TABLE_BULK_ACTION_FIELD,
80
+			$bulk_action_option
81
+		);
82
+		$this->actor()->click(CoreAdmin::SELECTOR_LIST_TABLE_BULK_ACTTION_APPLY);
83
+	}
84 84
 }
Please login to merge, or discard this patch.
core/services/notices/ConvertNoticesToAdminNotices.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
             $error_string = esc_html__('The following errors occurred:', 'event_espresso');
37 37
             foreach ($notices->getError() as $notice) {
38 38
                 if ($this->getThrowExceptions()) {
39
-                    $error_string .= '<br />' . $notice->message();
39
+                    $error_string .= '<br />'.$notice->message();
40 40
                 } else {
41 41
                     new AdminNotice($notice);
42 42
                 }
Please login to merge, or discard this patch.
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -13,42 +13,42 @@
 block discarded – undo
13 13
  */
14 14
 class ConvertNoticesToAdminNotices extends NoticeConverter
15 15
 {
16
-    /**
17
-     * Converts Notice objects into AdminNotice notifications
18
-     *
19
-     * @param NoticesContainerInterface $notices
20
-     * @throws DomainException
21
-     */
22
-    public function process(NoticesContainerInterface $notices)
23
-    {
24
-        if ($notices->hasAttention()) {
25
-            foreach ($notices->getAttention() as $notice) {
26
-                new AdminNotice($notice);
27
-            }
28
-        }
29
-        if ($notices->hasError()) {
30
-            $error_string = esc_html__('The following errors occurred:', 'event_espresso');
31
-            foreach ($notices->getError() as $notice) {
32
-                if ($this->getThrowExceptions()) {
33
-                    $error_string .= '<br />' . $notice->message();
34
-                } else {
35
-                    new AdminNotice($notice);
36
-                }
37
-            }
38
-            if ($this->getThrowExceptions()) {
39
-                throw new DomainException($error_string);
40
-            }
41
-        }
42
-        if ($notices->hasSuccess()) {
43
-            foreach ($notices->getSuccess() as $notice) {
44
-                new AdminNotice($notice);
45
-            }
46
-        }
47
-        if ($notices->hasInformation()) {
48
-            foreach ($notices->getInformation() as $notice) {
49
-                new AdminNotice($notice);
50
-            }
51
-        }
52
-        $this->clearNotices();
53
-    }
16
+	/**
17
+	 * Converts Notice objects into AdminNotice notifications
18
+	 *
19
+	 * @param NoticesContainerInterface $notices
20
+	 * @throws DomainException
21
+	 */
22
+	public function process(NoticesContainerInterface $notices)
23
+	{
24
+		if ($notices->hasAttention()) {
25
+			foreach ($notices->getAttention() as $notice) {
26
+				new AdminNotice($notice);
27
+			}
28
+		}
29
+		if ($notices->hasError()) {
30
+			$error_string = esc_html__('The following errors occurred:', 'event_espresso');
31
+			foreach ($notices->getError() as $notice) {
32
+				if ($this->getThrowExceptions()) {
33
+					$error_string .= '<br />' . $notice->message();
34
+				} else {
35
+					new AdminNotice($notice);
36
+				}
37
+			}
38
+			if ($this->getThrowExceptions()) {
39
+				throw new DomainException($error_string);
40
+			}
41
+		}
42
+		if ($notices->hasSuccess()) {
43
+			foreach ($notices->getSuccess() as $notice) {
44
+				new AdminNotice($notice);
45
+			}
46
+		}
47
+		if ($notices->hasInformation()) {
48
+			foreach ($notices->getInformation() as $notice) {
49
+				new AdminNotice($notice);
50
+			}
51
+		}
52
+		$this->clearNotices();
53
+	}
54 54
 }
Please login to merge, or discard this patch.
core/domain/values/FilePath.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,14 +35,14 @@
 block discarded – undo
35 35
      */
36 36
     public function __construct($file_path)
37 37
     {
38
-        if (! is_string($file_path)) {
38
+        if ( ! is_string($file_path)) {
39 39
             throw new InvalidDataTypeException(
40 40
                 '$file_path',
41 41
                 $file_path,
42 42
                 'string'
43 43
             );
44 44
         }
45
-        if (! is_readable($file_path)) {
45
+        if ( ! is_readable($file_path)) {
46 46
             throw new InvalidFilePathException($file_path);
47 47
         }
48 48
         $this->file_path = $file_path;
Please login to merge, or discard this patch.
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -15,40 +15,40 @@
 block discarded – undo
15 15
  */
16 16
 class FilePath
17 17
 {
18
-    /**
19
-     * @var string file_path
20
-     */
21
-    private $file_path;
18
+	/**
19
+	 * @var string file_path
20
+	 */
21
+	private $file_path;
22 22
 
23 23
 
24
-    /**
25
-     * FilePath constructor.
26
-     *
27
-     * @param string $file_path
28
-     * @throws InvalidDataTypeException
29
-     * @throws InvalidFilePathException
30
-     */
31
-    public function __construct($file_path)
32
-    {
33
-        if (! is_string($file_path)) {
34
-            throw new InvalidDataTypeException(
35
-                '$file_path',
36
-                $file_path,
37
-                'string'
38
-            );
39
-        }
40
-        if (! is_readable($file_path)) {
41
-            throw new InvalidFilePathException($file_path);
42
-        }
43
-        $this->file_path = $file_path;
44
-    }
24
+	/**
25
+	 * FilePath constructor.
26
+	 *
27
+	 * @param string $file_path
28
+	 * @throws InvalidDataTypeException
29
+	 * @throws InvalidFilePathException
30
+	 */
31
+	public function __construct($file_path)
32
+	{
33
+		if (! is_string($file_path)) {
34
+			throw new InvalidDataTypeException(
35
+				'$file_path',
36
+				$file_path,
37
+				'string'
38
+			);
39
+		}
40
+		if (! is_readable($file_path)) {
41
+			throw new InvalidFilePathException($file_path);
42
+		}
43
+		$this->file_path = $file_path;
44
+	}
45 45
 
46 46
 
47
-    /**
48
-     * @return string
49
-     */
50
-    public function __toString()
51
-    {
52
-        return $this->file_path;
53
-    }
47
+	/**
48
+	 * @return string
49
+	 */
50
+	public function __toString()
51
+	{
52
+		return $this->file_path;
53
+	}
54 54
 }
Please login to merge, or discard this patch.
core/domain/values/FullyQualifiedName.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,14 +37,14 @@
 block discarded – undo
37 37
      */
38 38
     public function __construct($fully_qualified_name)
39 39
     {
40
-        if (! is_string($fully_qualified_name)) {
40
+        if ( ! is_string($fully_qualified_name)) {
41 41
             throw new InvalidDataTypeException(
42 42
                 '$fully_qualified_name',
43 43
                 $fully_qualified_name,
44 44
                 'string'
45 45
             );
46 46
         }
47
-        if (! class_exists($fully_qualified_name) && ! interface_exists($fully_qualified_name)) {
47
+        if ( ! class_exists($fully_qualified_name) && ! interface_exists($fully_qualified_name)) {
48 48
             if (strpos($fully_qualified_name, 'Interface') !== false) {
49 49
                 throw new InvalidInterfaceException($fully_qualified_name);
50 50
             }
Please login to merge, or discard this patch.
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -16,53 +16,53 @@
 block discarded – undo
16 16
  */
17 17
 class FullyQualifiedName
18 18
 {
19
-    /**
20
-     * @var string $fully_qualified_name
21
-     */
22
-    private $fully_qualified_name;
19
+	/**
20
+	 * @var string $fully_qualified_name
21
+	 */
22
+	private $fully_qualified_name;
23 23
 
24 24
 
25
-    /**
26
-     * FullyQualifiedName constructor.
27
-     *
28
-     * @param string $fully_qualified_name
29
-     * @throws InvalidClassException
30
-     * @throws InvalidInterfaceException
31
-     * @throws InvalidDataTypeException
32
-     */
33
-    public function __construct($fully_qualified_name)
34
-    {
35
-        if (! is_string($fully_qualified_name)) {
36
-            throw new InvalidDataTypeException(
37
-                '$fully_qualified_name',
38
-                $fully_qualified_name,
39
-                'string'
40
-            );
41
-        }
42
-        if (! class_exists($fully_qualified_name) && ! interface_exists($fully_qualified_name)) {
43
-            if (strpos($fully_qualified_name, 'Interface') !== false) {
44
-                throw new InvalidInterfaceException($fully_qualified_name);
45
-            }
46
-            throw new InvalidClassException($fully_qualified_name);
47
-        }
48
-        $this->fully_qualified_name = $fully_qualified_name;
49
-    }
25
+	/**
26
+	 * FullyQualifiedName constructor.
27
+	 *
28
+	 * @param string $fully_qualified_name
29
+	 * @throws InvalidClassException
30
+	 * @throws InvalidInterfaceException
31
+	 * @throws InvalidDataTypeException
32
+	 */
33
+	public function __construct($fully_qualified_name)
34
+	{
35
+		if (! is_string($fully_qualified_name)) {
36
+			throw new InvalidDataTypeException(
37
+				'$fully_qualified_name',
38
+				$fully_qualified_name,
39
+				'string'
40
+			);
41
+		}
42
+		if (! class_exists($fully_qualified_name) && ! interface_exists($fully_qualified_name)) {
43
+			if (strpos($fully_qualified_name, 'Interface') !== false) {
44
+				throw new InvalidInterfaceException($fully_qualified_name);
45
+			}
46
+			throw new InvalidClassException($fully_qualified_name);
47
+		}
48
+		$this->fully_qualified_name = $fully_qualified_name;
49
+	}
50 50
 
51 51
 
52
-    /**
53
-     * @return string
54
-     */
55
-    public function string()
56
-    {
57
-        return $this->fully_qualified_name;
58
-    }
52
+	/**
53
+	 * @return string
54
+	 */
55
+	public function string()
56
+	{
57
+		return $this->fully_qualified_name;
58
+	}
59 59
 
60 60
 
61
-    /**
62
-     * @return string
63
-     */
64
-    public function __toString()
65
-    {
66
-        return $this->fully_qualified_name;
67
-    }
61
+	/**
62
+	 * @return string
63
+	 */
64
+	public function __toString()
65
+	{
66
+		return $this->fully_qualified_name;
67
+	}
68 68
 }
Please login to merge, or discard this patch.