Completed
Push — master ( 6e1f17...7db120 )
by Brian
40s queued 38s
created
includes/libraries/action-scheduler/functions.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
  * @param string $group The group to assign this job to.
13 13
  * @return string The action ID.
14 14
  */
15
-function as_enqueue_async_action( $hook, $args = array(), $group = '' ) {
16
-	return ActionScheduler::factory()->async( $hook, $args, $group );
15
+function as_enqueue_async_action($hook, $args = array(), $group = '') {
16
+	return ActionScheduler::factory()->async($hook, $args, $group);
17 17
 }
18 18
 
19 19
 /**
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
  *
27 27
  * @return string The job ID
28 28
  */
29
-function as_schedule_single_action( $timestamp, $hook, $args = array(), $group = '' ) {
30
-	return ActionScheduler::factory()->single( $hook, $args, $timestamp, $group );
29
+function as_schedule_single_action($timestamp, $hook, $args = array(), $group = '') {
30
+	return ActionScheduler::factory()->single($hook, $args, $timestamp, $group);
31 31
 }
32 32
 
33 33
 /**
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
  *
42 42
  * @return string The job ID
43 43
  */
44
-function as_schedule_recurring_action( $timestamp, $interval_in_seconds, $hook, $args = array(), $group = '' ) {
45
-	return ActionScheduler::factory()->recurring( $hook, $args, $timestamp, $interval_in_seconds, $group );
44
+function as_schedule_recurring_action($timestamp, $interval_in_seconds, $hook, $args = array(), $group = '') {
45
+	return ActionScheduler::factory()->recurring($hook, $args, $timestamp, $interval_in_seconds, $group);
46 46
 }
47 47
 
48 48
 /**
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
  *
69 69
  * @return string The job ID
70 70
  */
71
-function as_schedule_cron_action( $timestamp, $schedule, $hook, $args = array(), $group = '' ) {
72
-	return ActionScheduler::factory()->cron( $hook, $args, $timestamp, $schedule, $group );
71
+function as_schedule_cron_action($timestamp, $schedule, $hook, $args = array(), $group = '') {
72
+	return ActionScheduler::factory()->cron($hook, $args, $timestamp, $schedule, $group);
73 73
 }
74 74
 
75 75
 /**
@@ -88,18 +88,18 @@  discard block
 block discarded – undo
88 88
  *
89 89
  * @return string The scheduled action ID if a scheduled action was found, or empty string if no matching action found.
90 90
  */
91
-function as_unschedule_action( $hook, $args = array(), $group = '' ) {
91
+function as_unschedule_action($hook, $args = array(), $group = '') {
92 92
 	$params = array();
93
-	if ( is_array($args) ) {
93
+	if (is_array($args)) {
94 94
 		$params['args'] = $args;
95 95
 	}
96
-	if ( !empty($group) ) {
96
+	if (!empty($group)) {
97 97
 		$params['group'] = $group;
98 98
 	}
99
-	$job_id = ActionScheduler::store()->find_action( $hook, $params );
99
+	$job_id = ActionScheduler::store()->find_action($hook, $params);
100 100
 
101
-	if ( ! empty( $job_id ) ) {
102
-		ActionScheduler::store()->cancel_action( $job_id );
101
+	if (!empty($job_id)) {
102
+		ActionScheduler::store()->cancel_action($job_id);
103 103
 	}
104 104
 
105 105
 	return $job_id;
@@ -112,20 +112,20 @@  discard block
 block discarded – undo
112 112
  * @param array $args Args that would have been passed to the job
113 113
  * @param string $group
114 114
  */
115
-function as_unschedule_all_actions( $hook, $args = array(), $group = '' ) {
116
-	if ( empty( $args ) ) {
117
-		if ( ! empty( $hook ) && empty( $group ) ) {
118
-			ActionScheduler_Store::instance()->cancel_actions_by_hook( $hook );
115
+function as_unschedule_all_actions($hook, $args = array(), $group = '') {
116
+	if (empty($args)) {
117
+		if (!empty($hook) && empty($group)) {
118
+			ActionScheduler_Store::instance()->cancel_actions_by_hook($hook);
119 119
 			return;
120 120
 		}
121
-		if ( ! empty( $group ) && empty( $hook ) ) {
122
-			ActionScheduler_Store::instance()->cancel_actions_by_group( $group );
121
+		if (!empty($group) && empty($hook)) {
122
+			ActionScheduler_Store::instance()->cancel_actions_by_group($group);
123 123
 			return;
124 124
 		}
125 125
 	}
126 126
 	do {
127
-		$unscheduled_action = as_unschedule_action( $hook, $args, $group );
128
-	} while ( ! empty( $unscheduled_action ) );
127
+		$unscheduled_action = as_unschedule_action($hook, $args, $group);
128
+	} while (!empty($unscheduled_action));
129 129
 }
130 130
 
131 131
 /**
@@ -143,31 +143,31 @@  discard block
 block discarded – undo
143 143
  *
144 144
  * @return int|bool The timestamp for the next occurrence of a pending scheduled action, true for an async or in-progress action or false if there is no matching action.
145 145
  */
146
-function as_next_scheduled_action( $hook, $args = NULL, $group = '' ) {
146
+function as_next_scheduled_action($hook, $args = NULL, $group = '') {
147 147
 	$params = array();
148
-	if ( is_array($args) ) {
148
+	if (is_array($args)) {
149 149
 		$params['args'] = $args;
150 150
 	}
151
-	if ( !empty($group) ) {
151
+	if (!empty($group)) {
152 152
 		$params['group'] = $group;
153 153
 	}
154 154
 
155 155
 	$params['status'] = ActionScheduler_Store::STATUS_RUNNING;
156
-	$job_id = ActionScheduler::store()->find_action( $hook, $params );
157
-	if ( ! empty( $job_id ) ) {
156
+	$job_id = ActionScheduler::store()->find_action($hook, $params);
157
+	if (!empty($job_id)) {
158 158
 		return true;
159 159
 	}
160 160
 
161 161
 	$params['status'] = ActionScheduler_Store::STATUS_PENDING;
162
-	$job_id = ActionScheduler::store()->find_action( $hook, $params );
163
-	if ( empty($job_id) ) {
162
+	$job_id = ActionScheduler::store()->find_action($hook, $params);
163
+	if (empty($job_id)) {
164 164
 		return false;
165 165
 	}
166
-	$job = ActionScheduler::store()->fetch_action( $job_id );
166
+	$job = ActionScheduler::store()->fetch_action($job_id);
167 167
 	$scheduled_date = $job->get_schedule()->get_date();
168
-	if ( $scheduled_date ) {
169
-		return (int) $scheduled_date->format( 'U' );
170
-	} elseif ( NULL === $scheduled_date ) { // pending async action with NullSchedule
168
+	if ($scheduled_date) {
169
+		return (int) $scheduled_date->format('U');
170
+	} elseif (NULL === $scheduled_date) { // pending async action with NullSchedule
171 171
 		return true;
172 172
 	}
173 173
 	return false;
@@ -195,26 +195,26 @@  discard block
 block discarded – undo
195 195
  *
196 196
  * @return array
197 197
  */
198
-function as_get_scheduled_actions( $args = array(), $return_format = OBJECT ) {
198
+function as_get_scheduled_actions($args = array(), $return_format = OBJECT) {
199 199
 	$store = ActionScheduler::store();
200
-	foreach ( array('date', 'modified') as $key ) {
201
-		if ( isset($args[$key]) ) {
200
+	foreach (array('date', 'modified') as $key) {
201
+		if (isset($args[$key])) {
202 202
 			$args[$key] = as_get_datetime_object($args[$key]);
203 203
 		}
204 204
 	}
205
-	$ids = $store->query_actions( $args );
205
+	$ids = $store->query_actions($args);
206 206
 
207
-	if ( $return_format == 'ids' || $return_format == 'int' ) {
207
+	if ($return_format == 'ids' || $return_format == 'int') {
208 208
 		return $ids;
209 209
 	}
210 210
 
211 211
 	$actions = array();
212
-	foreach ( $ids as $action_id ) {
213
-		$actions[$action_id] = $store->fetch_action( $action_id );
212
+	foreach ($ids as $action_id) {
213
+		$actions[$action_id] = $store->fetch_action($action_id);
214 214
 	}
215 215
 
216
-	if ( $return_format == ARRAY_A ) {
217
-		foreach ( $actions as $action_id => $action_object ) {
216
+	if ($return_format == ARRAY_A) {
217
+		foreach ($actions as $action_id => $action_object) {
218 218
 			$actions[$action_id] = get_object_vars($action_object);
219 219
 		}
220 220
 	}
@@ -239,13 +239,13 @@  discard block
 block discarded – undo
239 239
  *
240 240
  * @return ActionScheduler_DateTime
241 241
  */
242
-function as_get_datetime_object( $date_string = null, $timezone = 'UTC' ) {
243
-	if ( is_object( $date_string ) && $date_string instanceof DateTime ) {
244
-		$date = new ActionScheduler_DateTime( $date_string->format( 'Y-m-d H:i:s' ), new DateTimeZone( $timezone ) );
245
-	} elseif ( is_numeric( $date_string ) ) {
246
-		$date = new ActionScheduler_DateTime( '@' . $date_string, new DateTimeZone( $timezone ) );
242
+function as_get_datetime_object($date_string = null, $timezone = 'UTC') {
243
+	if (is_object($date_string) && $date_string instanceof DateTime) {
244
+		$date = new ActionScheduler_DateTime($date_string->format('Y-m-d H:i:s'), new DateTimeZone($timezone));
245
+	} elseif (is_numeric($date_string)) {
246
+		$date = new ActionScheduler_DateTime('@' . $date_string, new DateTimeZone($timezone));
247 247
 	} else {
248
-		$date = new ActionScheduler_DateTime( $date_string, new DateTimeZone( $timezone ) );
248
+		$date = new ActionScheduler_DateTime($date_string, new DateTimeZone($timezone));
249 249
 	}
250 250
 	return $date;
251 251
 }
Please login to merge, or discard this patch.
action-scheduler/deprecated/ActionScheduler_AdminView_Deprecated.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
  */
11 11
 class ActionScheduler_AdminView_Deprecated {
12 12
 
13
-	public function action_scheduler_post_type_args( $args ) {
14
-		_deprecated_function( __METHOD__, '2.0.0' );
13
+	public function action_scheduler_post_type_args($args) {
14
+		_deprecated_function(__METHOD__, '2.0.0');
15 15
 		return $args;
16 16
 	}
17 17
 
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
 	 * @param array $views An associative array of views and view labels which can be used to filter the 'scheduled-action' posts displayed on the Scheduled Actions administration screen.
22 22
 	 * @return array $views An associative array of views and view labels which can be used to filter the 'scheduled-action' posts displayed on the Scheduled Actions administration screen.
23 23
 	 */
24
-	public function list_table_views( $views ) {
25
-		_deprecated_function( __METHOD__, '2.0.0' );
24
+	public function list_table_views($views) {
25
+		_deprecated_function(__METHOD__, '2.0.0');
26 26
 		return $views;
27 27
 	}
28 28
 
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
 	 * @param array $actions An associative array of actions which can be performed on the 'scheduled-action' post type.
35 35
 	 * @return array $actions An associative array of actions which can be performed on the 'scheduled-action' post type.
36 36
 	 */
37
-	public function bulk_actions( $actions ) {
38
-		_deprecated_function( __METHOD__, '2.0.0' );
37
+	public function bulk_actions($actions) {
38
+		_deprecated_function(__METHOD__, '2.0.0');
39 39
 		return $actions;
40 40
 	}
41 41
 
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
 	 * @param array $columns An associative array of columns that are use for the table on the Scheduled Actions administration screen.
49 49
 	 * @return array $columns An associative array of columns that are use for the table on the Scheduled Actions administration screen.
50 50
 	 */
51
-	public function list_table_columns( $columns ) {
52
-		_deprecated_function( __METHOD__, '2.0.0' );
51
+	public function list_table_columns($columns) {
52
+		_deprecated_function(__METHOD__, '2.0.0');
53 53
 		return $columns;
54 54
 	}
55 55
 
@@ -59,8 +59,8 @@  discard block
 block discarded – undo
59 59
 	 * @param array $columns An associative array of columns that can be used to sort the table on the Scheduled Actions administration screen.
60 60
 	 * @return array $columns An associative array of columns that can be used to sort the table on the Scheduled Actions administration screen.
61 61
 	 */
62
-	public static function list_table_sortable_columns( $columns ) {
63
-		_deprecated_function( __METHOD__, '2.0.0' );
62
+	public static function list_table_sortable_columns($columns) {
63
+		_deprecated_function(__METHOD__, '2.0.0');
64 64
 		return $columns;
65 65
 	}
66 66
 
@@ -70,8 +70,8 @@  discard block
 block discarded – undo
70 70
 	 * @param string $column_name The key for the column for which we should output our content.
71 71
 	 * @param int $post_id The ID of the 'scheduled-action' post for which this row relates.
72 72
 	 */
73
-	public static function list_table_column_content( $column_name, $post_id ) {
74
-		_deprecated_function( __METHOD__, '2.0.0' );
73
+	public static function list_table_column_content($column_name, $post_id) {
74
+		_deprecated_function(__METHOD__, '2.0.0');
75 75
 	}
76 76
 
77 77
 	/**
@@ -82,8 +82,8 @@  discard block
 block discarded – undo
82 82
 	 * @param array $actions An associative array of actions which can be performed on the 'scheduled-action' post type.
83 83
 	 * @return array $actions An associative array of actions which can be performed on the 'scheduled-action' post type.
84 84
 	 */
85
-	public static function row_actions( $actions, $post ) {
86
-		_deprecated_function( __METHOD__, '2.0.0' );
85
+	public static function row_actions($actions, $post) {
86
+		_deprecated_function(__METHOD__, '2.0.0');
87 87
 		return $actions;
88 88
 	}
89 89
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	 * @codeCoverageIgnore
94 94
 	 */
95 95
 	public static function maybe_execute_action() {
96
-		_deprecated_function( __METHOD__, '2.0.0' );
96
+		_deprecated_function(__METHOD__, '2.0.0');
97 97
 	}
98 98
 
99 99
 	/**
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	 * @return string A human friendly string representation of the interval.
110 110
 	 */
111 111
 	public static function admin_notices() {
112
-		_deprecated_function( __METHOD__, '2.0.0' );
112
+		_deprecated_function(__METHOD__, '2.0.0');
113 113
 	}
114 114
 
115 115
 	/**
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
 	 * @param WP_Query $query Instance of a WP_Query object
120 120
 	 * @return string MySQL orderby string.
121 121
 	 */
122
-	public function custom_orderby( $orderby, $query ){
123
-		_deprecated_function( __METHOD__, '2.0.0' );
122
+	public function custom_orderby($orderby, $query) {
123
+		_deprecated_function(__METHOD__, '2.0.0');
124 124
 	}
125 125
 
126 126
 	/**
@@ -130,8 +130,8 @@  discard block
 block discarded – undo
130 130
 	 * @param WP_Query $query Instance of a WP_Query object
131 131
 	 * @return string MySQL search string.
132 132
 	 */
133
-	public function search_post_password( $search, $query ) {
134
-		_deprecated_function( __METHOD__, '2.0.0' );
133
+	public function search_post_password($search, $query) {
134
+		_deprecated_function(__METHOD__, '2.0.0');
135 135
 	}
136 136
 
137 137
 	/**
@@ -140,8 +140,8 @@  discard block
 block discarded – undo
140 140
 	 * @param  array $messages
141 141
 	 * @return array
142 142
 	 */
143
-	public function post_updated_messages( $messages ) {
144
-		_deprecated_function( __METHOD__, '2.0.0' );
143
+	public function post_updated_messages($messages) {
144
+		_deprecated_function(__METHOD__, '2.0.0');
145 145
 		return $messages;
146 146
 	}
147 147
 }
148 148
\ No newline at end of file
Please login to merge, or discard this patch.
includes/libraries/action-scheduler/deprecated/functions.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
  *
19 19
  * @return string The job ID
20 20
  */
21
-function wc_schedule_single_action( $timestamp, $hook, $args = array(), $group = '' ) {
22
-	_deprecated_function( __FUNCTION__, '2.1.0', 'as_schedule_single_action()' );
23
-	return as_schedule_single_action( $timestamp, $hook, $args, $group );
21
+function wc_schedule_single_action($timestamp, $hook, $args = array(), $group = '') {
22
+	_deprecated_function(__FUNCTION__, '2.1.0', 'as_schedule_single_action()');
23
+	return as_schedule_single_action($timestamp, $hook, $args, $group);
24 24
 }
25 25
 
26 26
 /**
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
  *
37 37
  * @return string The job ID
38 38
  */
39
-function wc_schedule_recurring_action( $timestamp, $interval_in_seconds, $hook, $args = array(), $group = '' ) {
40
-	_deprecated_function( __FUNCTION__, '2.1.0', 'as_schedule_recurring_action()' );
41
-	return as_schedule_recurring_action( $timestamp, $interval_in_seconds, $hook, $args, $group );
39
+function wc_schedule_recurring_action($timestamp, $interval_in_seconds, $hook, $args = array(), $group = '') {
40
+	_deprecated_function(__FUNCTION__, '2.1.0', 'as_schedule_recurring_action()');
41
+	return as_schedule_recurring_action($timestamp, $interval_in_seconds, $hook, $args, $group);
42 42
 }
43 43
 
44 44
 /**
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
  *
65 65
  * @return string The job ID
66 66
  */
67
-function wc_schedule_cron_action( $timestamp, $schedule, $hook, $args = array(), $group = '' ) {
68
-	_deprecated_function( __FUNCTION__, '2.1.0', 'as_schedule_cron_action()' );
69
-	return as_schedule_cron_action( $timestamp, $schedule, $hook, $args, $group );
67
+function wc_schedule_cron_action($timestamp, $schedule, $hook, $args = array(), $group = '') {
68
+	_deprecated_function(__FUNCTION__, '2.1.0', 'as_schedule_cron_action()');
69
+	return as_schedule_cron_action($timestamp, $schedule, $hook, $args, $group);
70 70
 }
71 71
 
72 72
 /**
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
  *
79 79
  * @deprecated 2.1.0
80 80
  */
81
-function wc_unschedule_action( $hook, $args = array(), $group = '' ) {
82
-	_deprecated_function( __FUNCTION__, '2.1.0', 'as_unschedule_action()' );
83
-	as_unschedule_action( $hook, $args, $group );
81
+function wc_unschedule_action($hook, $args = array(), $group = '') {
82
+	_deprecated_function(__FUNCTION__, '2.1.0', 'as_unschedule_action()');
83
+	as_unschedule_action($hook, $args, $group);
84 84
 }
85 85
 
86 86
 /**
@@ -92,9 +92,9 @@  discard block
 block discarded – undo
92 92
  *
93 93
  * @return int|bool The timestamp for the next occurrence, or false if nothing was found
94 94
  */
95
-function wc_next_scheduled_action( $hook, $args = NULL, $group = '' ) {
96
-	_deprecated_function( __FUNCTION__, '2.1.0', 'as_next_scheduled_action()' );
97
-	return as_next_scheduled_action( $hook, $args, $group );
95
+function wc_next_scheduled_action($hook, $args = NULL, $group = '') {
96
+	_deprecated_function(__FUNCTION__, '2.1.0', 'as_next_scheduled_action()');
97
+	return as_next_scheduled_action($hook, $args, $group);
98 98
 }
99 99
 
100 100
 /**
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
  *
121 121
  * @return array
122 122
  */
123
-function wc_get_scheduled_actions( $args = array(), $return_format = OBJECT ) {
124
-	_deprecated_function( __FUNCTION__, '2.1.0', 'as_get_scheduled_actions()' );
125
-	return as_get_scheduled_actions( $args, $return_format );
123
+function wc_get_scheduled_actions($args = array(), $return_format = OBJECT) {
124
+	_deprecated_function(__FUNCTION__, '2.1.0', 'as_get_scheduled_actions()');
125
+	return as_get_scheduled_actions($args, $return_format);
126 126
 }
Please login to merge, or discard this patch.
action-scheduler/deprecated/ActionScheduler_Schedule_Deprecated.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,16 +13,16 @@
 block discarded – undo
13 13
 	 *
14 14
 	 * @return DateTime|null
15 15
 	 */
16
-	public function next( DateTime $after = NULL ) {
17
-		if ( empty( $after ) ) {
16
+	public function next(DateTime $after = NULL) {
17
+		if (empty($after)) {
18 18
 			$return_value       = $this->get_date();
19 19
 			$replacement_method = 'get_date()';
20 20
 		} else {
21
-			$return_value       = $this->get_next( $after );
21
+			$return_value       = $this->get_next($after);
22 22
 			$replacement_method = 'get_next( $after )';
23 23
 		}
24 24
 
25
-		_deprecated_function( __METHOD__, '3.0.0', __CLASS__ . '::' . $replacement_method );
25
+		_deprecated_function(__METHOD__, '3.0.0', __CLASS__ . '::' . $replacement_method);
26 26
 
27 27
 		return $return_value;
28 28
 	}
Please login to merge, or discard this patch.
libraries/action-scheduler/deprecated/ActionScheduler_Store_Deprecated.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,9 +13,9 @@  discard block
 block discarded – undo
13 13
 	 *
14 14
 	 * @param int $action_id The ID of the action.
15 15
 	 */
16
-	public function mark_failed_fetch_action( $action_id ) {
17
-		_deprecated_function( __METHOD__, '3.0.0', 'ActionScheduler_Store::mark_failure()' );
18
-		self::$store->mark_failure( $action_id );
16
+	public function mark_failed_fetch_action($action_id) {
17
+		_deprecated_function(__METHOD__, '3.0.0', 'ActionScheduler_Store::mark_failure()');
18
+		self::$store->mark_failure($action_id);
19 19
 	}
20 20
 
21 21
 	/**
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	 * @since 2.2.6
25 25
 	 */
26 26
 	protected static function hook() {
27
-		_deprecated_function( __METHOD__, '3.0.0' );
27
+		_deprecated_function(__METHOD__, '3.0.0');
28 28
 	}
29 29
 
30 30
 	/**
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	 * @since 2.2.6
34 34
 	 */
35 35
 	protected static function unhook() {
36
-		_deprecated_function( __METHOD__, '3.0.0' );
36
+		_deprecated_function(__METHOD__, '3.0.0');
37 37
 	}
38 38
 
39 39
 	/**
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 * @return DateTimeZone
44 44
 	 */
45 45
 	protected function get_local_timezone() {
46
-		_deprecated_function( __FUNCTION__, '2.1.0', 'ActionScheduler_TimezoneHelper::set_local_timezone()' );
46
+		_deprecated_function(__FUNCTION__, '2.1.0', 'ActionScheduler_TimezoneHelper::set_local_timezone()');
47 47
 		return ActionScheduler_TimezoneHelper::get_local_timezone();
48 48
 	}
49 49
 }
Please login to merge, or discard this patch.
deprecated/ActionScheduler_Abstract_QueueRunner_Deprecated.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -12,16 +12,16 @@
 block discarded – undo
12 12
 	 * @return int The number of seconds.
13 13
 	 */
14 14
 	protected function get_maximum_execution_time() {
15
-		_deprecated_function( __METHOD__, '2.1.1', 'ActionScheduler_Abstract_QueueRunner::get_time_limit()' );
15
+		_deprecated_function(__METHOD__, '2.1.1', 'ActionScheduler_Abstract_QueueRunner::get_time_limit()');
16 16
 
17 17
 		$maximum_execution_time = 30;
18 18
 
19 19
 		// Apply deprecated filter
20
-		if ( has_filter( 'action_scheduler_maximum_execution_time' ) ) {
21
-			_deprecated_function( 'action_scheduler_maximum_execution_time', '2.1.1', 'action_scheduler_queue_runner_time_limit' );
22
-			$maximum_execution_time = apply_filters( 'action_scheduler_maximum_execution_time', $maximum_execution_time );
20
+		if (has_filter('action_scheduler_maximum_execution_time')) {
21
+			_deprecated_function('action_scheduler_maximum_execution_time', '2.1.1', 'action_scheduler_queue_runner_time_limit');
22
+			$maximum_execution_time = apply_filters('action_scheduler_maximum_execution_time', $maximum_execution_time);
23 23
 		}
24 24
 
25
-		return absint( $maximum_execution_time );
25
+		return absint($maximum_execution_time);
26 26
 	}
27 27
 }
Please login to merge, or discard this patch.
includes/libraries/action-scheduler/action-scheduler.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -25,29 +25,29 @@
 block discarded – undo
25 25
  *
26 26
  */
27 27
 
28
-if ( ! function_exists( 'action_scheduler_register_3_dot_1_dot_4' ) ) {
28
+if (!function_exists('action_scheduler_register_3_dot_1_dot_4')) {
29 29
 
30
-	if ( ! class_exists( 'ActionScheduler_Versions' ) ) {
31
-		require_once( 'classes/ActionScheduler_Versions.php' );
32
-		add_action( 'plugins_loaded', array( 'ActionScheduler_Versions', 'initialize_latest_version' ), 1, 0 );
30
+	if (!class_exists('ActionScheduler_Versions')) {
31
+		require_once('classes/ActionScheduler_Versions.php');
32
+		add_action('plugins_loaded', array('ActionScheduler_Versions', 'initialize_latest_version'), 1, 0);
33 33
 	}
34 34
 
35
-	add_action( 'plugins_loaded', 'action_scheduler_register_3_dot_1_dot_4', 0, 0 );
35
+	add_action('plugins_loaded', 'action_scheduler_register_3_dot_1_dot_4', 0, 0);
36 36
 
37 37
 	function action_scheduler_register_3_dot_1_dot_4() {
38 38
 		$versions = ActionScheduler_Versions::instance();
39
-		$versions->register( '3.1.4', 'action_scheduler_initialize_3_dot_1_dot_4' );
39
+		$versions->register('3.1.4', 'action_scheduler_initialize_3_dot_1_dot_4');
40 40
 	}
41 41
 
42 42
 	function action_scheduler_initialize_3_dot_1_dot_4() {
43
-		require_once( 'classes/abstracts/ActionScheduler.php' );
44
-		ActionScheduler::init( __FILE__ );
43
+		require_once('classes/abstracts/ActionScheduler.php');
44
+		ActionScheduler::init(__FILE__);
45 45
 	}
46 46
 
47 47
 	// Support usage in themes - load this version if no plugin has loaded a version yet.
48
-	if ( did_action( 'plugins_loaded' ) && ! class_exists( 'ActionScheduler' ) ) {
48
+	if (did_action('plugins_loaded') && !class_exists('ActionScheduler')) {
49 49
 		action_scheduler_initialize_3_dot_1_dot_4();
50
-		do_action( 'action_scheduler_pre_theme_init' );
50
+		do_action('action_scheduler_pre_theme_init');
51 51
 		ActionScheduler_Versions::initialize_latest_version();
52 52
 	}
53 53
 }
Please login to merge, or discard this patch.
libraries/action-scheduler/classes/ActionScheduler_FatalErrorMonitor.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -10,30 +10,30 @@  discard block
 block discarded – undo
10 10
 	private $store = NULL;
11 11
 	private $action_id = 0;
12 12
 
13
-	public function __construct( ActionScheduler_Store $store ) {
13
+	public function __construct(ActionScheduler_Store $store) {
14 14
 		$this->store = $store;
15 15
 	}
16 16
 
17
-	public function attach( ActionScheduler_ActionClaim $claim ) {
17
+	public function attach(ActionScheduler_ActionClaim $claim) {
18 18
 		$this->claim = $claim;
19
-		add_action( 'shutdown', array( $this, 'handle_unexpected_shutdown' ) );
20
-		add_action( 'action_scheduler_before_execute', array( $this, 'track_current_action' ), 0, 1 );
21
-		add_action( 'action_scheduler_after_execute',  array( $this, 'untrack_action' ), 0, 0 );
22
-		add_action( 'action_scheduler_execution_ignored',  array( $this, 'untrack_action' ), 0, 0 );
23
-		add_action( 'action_scheduler_failed_execution',  array( $this, 'untrack_action' ), 0, 0 );
19
+		add_action('shutdown', array($this, 'handle_unexpected_shutdown'));
20
+		add_action('action_scheduler_before_execute', array($this, 'track_current_action'), 0, 1);
21
+		add_action('action_scheduler_after_execute', array($this, 'untrack_action'), 0, 0);
22
+		add_action('action_scheduler_execution_ignored', array($this, 'untrack_action'), 0, 0);
23
+		add_action('action_scheduler_failed_execution', array($this, 'untrack_action'), 0, 0);
24 24
 	}
25 25
 
26 26
 	public function detach() {
27 27
 		$this->claim = NULL;
28 28
 		$this->untrack_action();
29
-		remove_action( 'shutdown', array( $this, 'handle_unexpected_shutdown' ) );
30
-		remove_action( 'action_scheduler_before_execute', array( $this, 'track_current_action' ), 0 );
31
-		remove_action( 'action_scheduler_after_execute',  array( $this, 'untrack_action' ), 0 );
32
-		remove_action( 'action_scheduler_execution_ignored',  array( $this, 'untrack_action' ), 0 );
33
-		remove_action( 'action_scheduler_failed_execution',  array( $this, 'untrack_action' ), 0 );
29
+		remove_action('shutdown', array($this, 'handle_unexpected_shutdown'));
30
+		remove_action('action_scheduler_before_execute', array($this, 'track_current_action'), 0);
31
+		remove_action('action_scheduler_after_execute', array($this, 'untrack_action'), 0);
32
+		remove_action('action_scheduler_execution_ignored', array($this, 'untrack_action'), 0);
33
+		remove_action('action_scheduler_failed_execution', array($this, 'untrack_action'), 0);
34 34
 	}
35 35
 
36
-	public function track_current_action( $action_id ) {
36
+	public function track_current_action($action_id) {
37 37
 		$this->action_id = $action_id;
38 38
 	}
39 39
 
@@ -42,14 +42,14 @@  discard block
 block discarded – undo
42 42
 	}
43 43
 
44 44
 	public function handle_unexpected_shutdown() {
45
-		if ( $error = error_get_last() ) {
46
-			if ( in_array( $error['type'], array( E_ERROR, E_PARSE, E_COMPILE_ERROR, E_USER_ERROR, E_RECOVERABLE_ERROR ) ) ) {
47
-				if ( !empty($this->action_id) ) {
48
-					$this->store->mark_failure( $this->action_id );
49
-					do_action( 'action_scheduler_unexpected_shutdown', $this->action_id, $error );
45
+		if ($error = error_get_last()) {
46
+			if (in_array($error['type'], array(E_ERROR, E_PARSE, E_COMPILE_ERROR, E_USER_ERROR, E_RECOVERABLE_ERROR))) {
47
+				if (!empty($this->action_id)) {
48
+					$this->store->mark_failure($this->action_id);
49
+					do_action('action_scheduler_unexpected_shutdown', $this->action_id, $error);
50 50
 				}
51 51
 			}
52
-			$this->store->release_claim( $this->claim );
52
+			$this->store->release_claim($this->claim);
53 53
 		}
54 54
 	}
55 55
 }
Please login to merge, or discard this patch.
libraries/action-scheduler/classes/ActionScheduler_wcSystemStatus.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 	 */
13 13
 	protected $store;
14 14
 
15
-	function __construct( $store ) {
15
+	function __construct($store) {
16 16
 		$this->store = $store;
17 17
 	}
18 18
 
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
 	public function render() {
25 25
 		$action_counts     = $this->store->action_counts();
26 26
 		$status_labels     = $this->store->get_status_labels();
27
-		$oldest_and_newest = $this->get_oldest_and_newest( array_keys( $status_labels ) );
27
+		$oldest_and_newest = $this->get_oldest_and_newest(array_keys($status_labels));
28 28
 
29
-		$this->get_template( $status_labels, $action_counts, $oldest_and_newest );
29
+		$this->get_template($status_labels, $action_counts, $oldest_and_newest);
30 30
 	}
31 31
 
32 32
 	/**
@@ -35,22 +35,22 @@  discard block
 block discarded – undo
35 35
 	 * @param array $status_keys Set of statuses to find oldest & newest action for.
36 36
 	 * @return array
37 37
 	 */
38
-	protected function get_oldest_and_newest( $status_keys ) {
38
+	protected function get_oldest_and_newest($status_keys) {
39 39
 
40 40
 		$oldest_and_newest = array();
41 41
 
42
-		foreach ( $status_keys as $status ) {
43
-			$oldest_and_newest[ $status ] = array(
42
+		foreach ($status_keys as $status) {
43
+			$oldest_and_newest[$status] = array(
44 44
 				'oldest' => '–',
45 45
 				'newest' => '–',
46 46
 			);
47 47
 
48
-			if ( 'in-progress' === $status ) {
48
+			if ('in-progress' === $status) {
49 49
 				continue;
50 50
 			}
51 51
 
52
-			$oldest_and_newest[ $status ]['oldest'] = $this->get_action_status_date( $status, 'oldest' );
53
-			$oldest_and_newest[ $status ]['newest'] = $this->get_action_status_date( $status, 'newest' );
52
+			$oldest_and_newest[$status]['oldest'] = $this->get_action_status_date($status, 'oldest');
53
+			$oldest_and_newest[$status]['newest'] = $this->get_action_status_date($status, 'newest');
54 54
 		}
55 55
 
56 56
 		return $oldest_and_newest;
@@ -63,20 +63,20 @@  discard block
 block discarded – undo
63 63
 	 * @param string $date_type Oldest or Newest.
64 64
 	 * @return DateTime
65 65
 	 */
66
-	protected function get_action_status_date( $status, $date_type = 'oldest' ) {
66
+	protected function get_action_status_date($status, $date_type = 'oldest') {
67 67
 
68 68
 		$order = 'oldest' === $date_type ? 'ASC' : 'DESC';
69 69
 
70
-		$action = $this->store->query_actions( array(
70
+		$action = $this->store->query_actions(array(
71 71
 			'claimed'  => false,
72 72
 			'status'   => $status,
73 73
 			'per_page' => 1,
74 74
 			'order'    => $order,
75
-		) );
75
+		));
76 76
 
77
-		if ( ! empty( $action ) ) {
78
-			$date_object = $this->store->get_date( $action[0] );
79
-			$action_date = $date_object->format( 'Y-m-d H:i:s O' );
77
+		if (!empty($action)) {
78
+			$date_object = $this->store->get_date($action[0]);
79
+			$action_date = $date_object->format('Y-m-d H:i:s O');
80 80
 		} else {
81 81
 			$action_date = '–';
82 82
 		}
@@ -91,37 +91,37 @@  discard block
 block discarded – undo
91 91
 	 * @param array $action_counts Number of actions grouped by status.
92 92
 	 * @param array $oldest_and_newest Date of the oldest and newest action with each status.
93 93
 	 */
94
-	protected function get_template( $status_labels, $action_counts, $oldest_and_newest ) {
94
+	protected function get_template($status_labels, $action_counts, $oldest_and_newest) {
95 95
 		$as_version = ActionScheduler_Versions::instance()->latest_version();
96 96
 		?>
97 97
 
98 98
 		<table class="wc_status_table widefat" cellspacing="0">
99 99
 			<thead>
100 100
 				<tr>
101
-					<th colspan="5" data-export-label="Action Scheduler"><h2><?php esc_html_e( 'Action Scheduler', 'action-scheduler' ); ?><?php echo wc_help_tip( esc_html__( 'This section shows scheduled action counts.', 'action-scheduler' ) ); ?></h2></th>
101
+					<th colspan="5" data-export-label="Action Scheduler"><h2><?php esc_html_e('Action Scheduler', 'action-scheduler'); ?><?php echo wc_help_tip(esc_html__('This section shows scheduled action counts.', 'action-scheduler')); ?></h2></th>
102 102
 				</tr>
103 103
 				<tr>
104
-					<td colspan="2" data-export-label="Version"><?php esc_html_e( 'Version:', 'action-scheduler' ); ?></td>
105
-					<td colspan="3"><?php echo esc_html( $as_version ); ?></td>
104
+					<td colspan="2" data-export-label="Version"><?php esc_html_e('Version:', 'action-scheduler'); ?></td>
105
+					<td colspan="3"><?php echo esc_html($as_version); ?></td>
106 106
 				</tr>
107 107
 				<tr>
108
-					<td><strong><?php esc_html_e( 'Action Status', 'action-scheduler' ); ?></strong></td>
108
+					<td><strong><?php esc_html_e('Action Status', 'action-scheduler'); ?></strong></td>
109 109
 					<td class="help">&nbsp;</td>
110
-					<td><strong><?php esc_html_e( 'Count', 'action-scheduler' ); ?></strong></td>
111
-					<td><strong><?php esc_html_e( 'Oldest Scheduled Date', 'action-scheduler' ); ?></strong></td>
112
-					<td><strong><?php esc_html_e( 'Newest Scheduled Date', 'action-scheduler' ); ?></strong></td>
110
+					<td><strong><?php esc_html_e('Count', 'action-scheduler'); ?></strong></td>
111
+					<td><strong><?php esc_html_e('Oldest Scheduled Date', 'action-scheduler'); ?></strong></td>
112
+					<td><strong><?php esc_html_e('Newest Scheduled Date', 'action-scheduler'); ?></strong></td>
113 113
 				</tr>
114 114
 			</thead>
115 115
 			<tbody>
116 116
 				<?php
117
-				foreach ( $action_counts as $status => $count ) {
117
+				foreach ($action_counts as $status => $count) {
118 118
 					// WC uses the 3rd column for export, so we need to display more data in that (hidden when viewed as part of the table) and add an empty 2nd column.
119 119
 					printf(
120 120
 						'<tr><td>%1$s</td><td>&nbsp;</td><td>%2$s<span style="display: none;">, Oldest: %3$s, Newest: %4$s</span></td><td>%3$s</td><td>%4$s</td></tr>',
121
-						esc_html( $status_labels[ $status ] ),
122
-						number_format_i18n( $count ),
123
-						$oldest_and_newest[ $status ]['oldest'],
124
-						$oldest_and_newest[ $status ]['newest']
121
+						esc_html($status_labels[$status]),
122
+						number_format_i18n($count),
123
+						$oldest_and_newest[$status]['oldest'],
124
+						$oldest_and_newest[$status]['newest']
125 125
 					);
126 126
 				}
127 127
 				?>
@@ -140,11 +140,11 @@  discard block
 block discarded – undo
140 140
 	 * @return mixed
141 141
 	 * @link https://php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.methods
142 142
 	 */
143
-	public function __call( $name, $arguments ) {
144
-		switch ( $name ) {
143
+	public function __call($name, $arguments) {
144
+		switch ($name) {
145 145
 			case 'print':
146
-				_deprecated_function( __CLASS__ . '::print()', '2.2.4', __CLASS__ . '::render()' );
147
-				return call_user_func_array( array( $this, 'render' ), $arguments );
146
+				_deprecated_function(__CLASS__ . '::print()', '2.2.4', __CLASS__ . '::render()');
147
+				return call_user_func_array(array($this, 'render'), $arguments);
148 148
 		}
149 149
 
150 150
 		return null;
Please login to merge, or discard this patch.