Completed
Branch ENH/contextual-event-check-in-... (d32e27)
by
unknown
06:40 queued 03:25
created
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.
core/domain/entities/contexts/RequestTypeContext.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
91 91
     public function __construct($slug, $description)
92 92
     {
93 93
         parent::__construct($slug, $description);
94
-        if (! in_array($this->slug(), $this->validRequestTypes(), true)) {
94
+        if ( ! in_array($this->slug(), $this->validRequestTypes(), true)) {
95 95
             throw new InvalidArgumentException(
96 96
                 sprintf(
97 97
                     esc_html__(
Please login to merge, or discard this patch.
Indentation   +151 added lines, -151 removed lines patch added patch discarded remove patch
@@ -15,155 +15,155 @@
 block discarded – undo
15 15
  */
16 16
 class RequestTypeContext extends Context
17 17
 {
18
-    /**
19
-     * indicates that the current request involves some form of activation
20
-     */
21
-    const ACTIVATION = 'activation-request';
22
-
23
-    /**
24
-     * indicates that the current request is for the admin but is not being made via AJAX
25
-     */
26
-    const ADMIN = 'non-ajax-admin-request';
27
-
28
-    /**
29
-     * indicates that the current request is for the admin AND is being made via AJAX
30
-     */
31
-    const AJAX_ADMIN = 'admin-ajax-request';
32
-
33
-    /**
34
-     * indicates that the current request is for the frontend AND is being made via AJAX
35
-     */
36
-    const AJAX_FRONT = 'frontend-ajax-request';
37
-
38
-    /**
39
-     * indicates that the current request is for the WP Heartbeat
40
-     */
41
-    const AJAX_HEARTBEAT = 'admin-ajax-heartbeat';
42
-
43
-    /**
44
-     * indicates that the current request is being made via AJAX, but is NOT for EE
45
-     */
46
-    const AJAX_OTHER = 'other-ajax-request';
47
-
48
-    /**
49
-     * indicates that the current request is for the EE REST API
50
-     */
51
-    const API = 'rest-api';
52
-
53
-    /**
54
-     * indicates that the current request is from the command line
55
-     */
56
-    const CLI = 'command-line';
57
-
58
-    /**
59
-     * indicates that the current request is for a WP_Cron
60
-     */
61
-    const CRON = 'wp-cron';
62
-
63
-    /**
64
-     * indicates that the current request is for a feed (ie: RSS)
65
-     */
66
-    const FEED = 'feed-request';
67
-
68
-    /**
69
-     * indicates that the current request is for the frontend but is not being made via AJAX
70
-     */
71
-    const FRONTEND = 'non-ajax-frontend-request';
72
-
73
-    /**
74
-     * indicates that the current request is for content that is to be displayed within an iframe
75
-     */
76
-    const IFRAME = 'iframe-request';
77
-
78
-    /**
79
-     * indicates that the current request is for the WP REST API
80
-     */
81
-    const WP_API = 'wp-rest-api';
82
-
83
-    /**
84
-     * indicates that the current request is a loopback sent from WP core to test for errors
85
-     */
86
-    const WP_SCRAPE = 'wordpress-scrape';
87
-
88
-    /**
89
-     * @var boolean $is_activation
90
-     */
91
-    private $is_activation = false;
92
-
93
-    /**
94
-     * @var array $valid_request_types
95
-     */
96
-    private $valid_request_types = array();
97
-
98
-
99
-    /**
100
-     * RequestTypeContext constructor.
101
-     *
102
-     * @param string $slug
103
-     * @param string $description
104
-     * @throws InvalidArgumentException
105
-     */
106
-    public function __construct($slug, $description)
107
-    {
108
-        parent::__construct($slug, $description);
109
-        if (! in_array($this->slug(), $this->validRequestTypes(), true)) {
110
-            throw new InvalidArgumentException(
111
-                sprintf(
112
-                    esc_html__(
113
-                        'The RequestTypeContext slug must be one of the following values: %1$s %2$s',
114
-                        'event_espresso'
115
-                    ),
116
-                    var_export($this->validRequestTypes(), true)
117
-                )
118
-            );
119
-        }
120
-    }
121
-
122
-
123
-    /**
124
-     * @return array
125
-     */
126
-    public function validRequestTypes()
127
-    {
128
-        if (empty($this->valid_request_types)) {
129
-            $this->valid_request_types = apply_filters(
130
-                'FHEE__EventEspresso_core_domain_entities_contexts_RequestTypeContext__validRequestTypes',
131
-                array(
132
-                    RequestTypeContext::ACTIVATION,
133
-                    RequestTypeContext::ADMIN,
134
-                    RequestTypeContext::AJAX_ADMIN,
135
-                    RequestTypeContext::AJAX_FRONT,
136
-                    RequestTypeContext::AJAX_HEARTBEAT,
137
-                    RequestTypeContext::AJAX_OTHER,
138
-                    RequestTypeContext::API,
139
-                    RequestTypeContext::CLI,
140
-                    RequestTypeContext::CRON,
141
-                    RequestTypeContext::FEED,
142
-                    RequestTypeContext::FRONTEND,
143
-                    RequestTypeContext::IFRAME,
144
-                    RequestTypeContext::WP_API,
145
-                    RequestTypeContext::WP_SCRAPE,
146
-                )
147
-            );
148
-        }
149
-        return $this->valid_request_types;
150
-    }
151
-
152
-
153
-    /**
154
-     * @return bool
155
-     */
156
-    public function isActivation()
157
-    {
158
-        return $this->is_activation;
159
-    }
160
-
161
-
162
-    /**
163
-     * @param bool $is_activation
164
-     */
165
-    public function setIsActivation($is_activation)
166
-    {
167
-        $this->is_activation = filter_var($is_activation, FILTER_VALIDATE_BOOLEAN);
168
-    }
18
+	/**
19
+	 * indicates that the current request involves some form of activation
20
+	 */
21
+	const ACTIVATION = 'activation-request';
22
+
23
+	/**
24
+	 * indicates that the current request is for the admin but is not being made via AJAX
25
+	 */
26
+	const ADMIN = 'non-ajax-admin-request';
27
+
28
+	/**
29
+	 * indicates that the current request is for the admin AND is being made via AJAX
30
+	 */
31
+	const AJAX_ADMIN = 'admin-ajax-request';
32
+
33
+	/**
34
+	 * indicates that the current request is for the frontend AND is being made via AJAX
35
+	 */
36
+	const AJAX_FRONT = 'frontend-ajax-request';
37
+
38
+	/**
39
+	 * indicates that the current request is for the WP Heartbeat
40
+	 */
41
+	const AJAX_HEARTBEAT = 'admin-ajax-heartbeat';
42
+
43
+	/**
44
+	 * indicates that the current request is being made via AJAX, but is NOT for EE
45
+	 */
46
+	const AJAX_OTHER = 'other-ajax-request';
47
+
48
+	/**
49
+	 * indicates that the current request is for the EE REST API
50
+	 */
51
+	const API = 'rest-api';
52
+
53
+	/**
54
+	 * indicates that the current request is from the command line
55
+	 */
56
+	const CLI = 'command-line';
57
+
58
+	/**
59
+	 * indicates that the current request is for a WP_Cron
60
+	 */
61
+	const CRON = 'wp-cron';
62
+
63
+	/**
64
+	 * indicates that the current request is for a feed (ie: RSS)
65
+	 */
66
+	const FEED = 'feed-request';
67
+
68
+	/**
69
+	 * indicates that the current request is for the frontend but is not being made via AJAX
70
+	 */
71
+	const FRONTEND = 'non-ajax-frontend-request';
72
+
73
+	/**
74
+	 * indicates that the current request is for content that is to be displayed within an iframe
75
+	 */
76
+	const IFRAME = 'iframe-request';
77
+
78
+	/**
79
+	 * indicates that the current request is for the WP REST API
80
+	 */
81
+	const WP_API = 'wp-rest-api';
82
+
83
+	/**
84
+	 * indicates that the current request is a loopback sent from WP core to test for errors
85
+	 */
86
+	const WP_SCRAPE = 'wordpress-scrape';
87
+
88
+	/**
89
+	 * @var boolean $is_activation
90
+	 */
91
+	private $is_activation = false;
92
+
93
+	/**
94
+	 * @var array $valid_request_types
95
+	 */
96
+	private $valid_request_types = array();
97
+
98
+
99
+	/**
100
+	 * RequestTypeContext constructor.
101
+	 *
102
+	 * @param string $slug
103
+	 * @param string $description
104
+	 * @throws InvalidArgumentException
105
+	 */
106
+	public function __construct($slug, $description)
107
+	{
108
+		parent::__construct($slug, $description);
109
+		if (! in_array($this->slug(), $this->validRequestTypes(), true)) {
110
+			throw new InvalidArgumentException(
111
+				sprintf(
112
+					esc_html__(
113
+						'The RequestTypeContext slug must be one of the following values: %1$s %2$s',
114
+						'event_espresso'
115
+					),
116
+					var_export($this->validRequestTypes(), true)
117
+				)
118
+			);
119
+		}
120
+	}
121
+
122
+
123
+	/**
124
+	 * @return array
125
+	 */
126
+	public function validRequestTypes()
127
+	{
128
+		if (empty($this->valid_request_types)) {
129
+			$this->valid_request_types = apply_filters(
130
+				'FHEE__EventEspresso_core_domain_entities_contexts_RequestTypeContext__validRequestTypes',
131
+				array(
132
+					RequestTypeContext::ACTIVATION,
133
+					RequestTypeContext::ADMIN,
134
+					RequestTypeContext::AJAX_ADMIN,
135
+					RequestTypeContext::AJAX_FRONT,
136
+					RequestTypeContext::AJAX_HEARTBEAT,
137
+					RequestTypeContext::AJAX_OTHER,
138
+					RequestTypeContext::API,
139
+					RequestTypeContext::CLI,
140
+					RequestTypeContext::CRON,
141
+					RequestTypeContext::FEED,
142
+					RequestTypeContext::FRONTEND,
143
+					RequestTypeContext::IFRAME,
144
+					RequestTypeContext::WP_API,
145
+					RequestTypeContext::WP_SCRAPE,
146
+				)
147
+			);
148
+		}
149
+		return $this->valid_request_types;
150
+	}
151
+
152
+
153
+	/**
154
+	 * @return bool
155
+	 */
156
+	public function isActivation()
157
+	{
158
+		return $this->is_activation;
159
+	}
160
+
161
+
162
+	/**
163
+	 * @param bool $is_activation
164
+	 */
165
+	public function setIsActivation($is_activation)
166
+	{
167
+		$this->is_activation = filter_var($is_activation, FILTER_VALIDATE_BOOLEAN);
168
+	}
169 169
 }
Please login to merge, or discard this patch.
core/db_classes/EE_WP_User.class.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
      */
52 52
     public function wp_user_obj()
53 53
     {
54
-        if (! $this->_wp_user_obj) {
54
+        if ( ! $this->_wp_user_obj) {
55 55
             $this->_wp_user_obj = get_user_by('ID', $this->ID());
56 56
         }
57 57
         return $this->_wp_user_obj;
Please login to merge, or discard this patch.
Indentation   +107 added lines, -107 removed lines patch added patch discarded remove patch
@@ -12,111 +12,111 @@
 block discarded – undo
12 12
  */
13 13
 class EE_WP_User extends EE_Base_Class implements EEI_Admin_Links
14 14
 {
15
-    /**
16
-     * @var WP_User
17
-     */
18
-    protected $_wp_user_obj;
19
-
20
-
21
-    /**
22
-     * @param array $props_n_values
23
-     * @return EE_WP_User|mixed
24
-     * @throws EE_Error
25
-     * @throws ReflectionException
26
-     */
27
-    public static function new_instance($props_n_values = [])
28
-    {
29
-        $has_object = parent::_check_for_object($props_n_values, __CLASS__);
30
-        return $has_object ?: new self($props_n_values);
31
-    }
32
-
33
-
34
-    /**
35
-     * @param array $props_n_values
36
-     * @return EE_WP_User
37
-     * @throws EE_Error
38
-     * @throws ReflectionException
39
-     */
40
-    public static function new_instance_from_db($props_n_values = [])
41
-    {
42
-        return new self($props_n_values, true);
43
-    }
44
-
45
-
46
-    /**
47
-     * Return a normal WP_User object (caches the object for future calls)
48
-     *
49
-     * @return WP_User
50
-     * @throws EE_Error
51
-     * @throws ReflectionException
52
-     */
53
-    public function wp_user_obj()
54
-    {
55
-        if (! $this->_wp_user_obj) {
56
-            $this->_wp_user_obj = get_user_by('ID', $this->ID());
57
-        }
58
-        return $this->_wp_user_obj;
59
-    }
60
-
61
-
62
-    /**
63
-     * Return the link to the admin details for the object.
64
-     *
65
-     * @return string
66
-     * @throws EE_Error
67
-     * @throws ReflectionException
68
-     */
69
-    public function get_admin_details_link()
70
-    {
71
-        return $this->get_admin_edit_link();
72
-    }
73
-
74
-
75
-    /**
76
-     * Returns the link to the editor for the object.  Sometimes this is the same as the details.
77
-     *
78
-     * @return string
79
-     * @throws EE_Error
80
-     * @throws ReflectionException
81
-     */
82
-    public function get_admin_edit_link()
83
-    {
84
-        /** @var RequestInterface $request */
85
-        $request = LoaderFactory::getLoader()->getShared(RequestInterface::class);
86
-        return esc_url(
87
-            add_query_arg(
88
-                'wp_http_referer',
89
-                urlencode(
90
-                    wp_unslash(
91
-                        $request->getServerParam('REQUEST_URI')
92
-                    )
93
-                ),
94
-                get_edit_user_link($this->ID())
95
-            )
96
-        );
97
-    }
98
-
99
-
100
-    /**
101
-     * Returns the link to a settings page for the object.
102
-     *
103
-     * @return string
104
-     * @throws EE_Error
105
-     * @throws ReflectionException
106
-     */
107
-    public function get_admin_settings_link()
108
-    {
109
-        return $this->get_admin_edit_link();
110
-    }
111
-
112
-
113
-    /**
114
-     * Returns the link to the "overview" for the object (typically the "list table" view).
115
-     *
116
-     * @return string
117
-     */
118
-    public function get_admin_overview_link()
119
-    {
120
-        return admin_url('users.php');
121
-    }
15
+	/**
16
+	 * @var WP_User
17
+	 */
18
+	protected $_wp_user_obj;
19
+
20
+
21
+	/**
22
+	 * @param array $props_n_values
23
+	 * @return EE_WP_User|mixed
24
+	 * @throws EE_Error
25
+	 * @throws ReflectionException
26
+	 */
27
+	public static function new_instance($props_n_values = [])
28
+	{
29
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__);
30
+		return $has_object ?: new self($props_n_values);
31
+	}
32
+
33
+
34
+	/**
35
+	 * @param array $props_n_values
36
+	 * @return EE_WP_User
37
+	 * @throws EE_Error
38
+	 * @throws ReflectionException
39
+	 */
40
+	public static function new_instance_from_db($props_n_values = [])
41
+	{
42
+		return new self($props_n_values, true);
43
+	}
44
+
45
+
46
+	/**
47
+	 * Return a normal WP_User object (caches the object for future calls)
48
+	 *
49
+	 * @return WP_User
50
+	 * @throws EE_Error
51
+	 * @throws ReflectionException
52
+	 */
53
+	public function wp_user_obj()
54
+	{
55
+		if (! $this->_wp_user_obj) {
56
+			$this->_wp_user_obj = get_user_by('ID', $this->ID());
57
+		}
58
+		return $this->_wp_user_obj;
59
+	}
60
+
61
+
62
+	/**
63
+	 * Return the link to the admin details for the object.
64
+	 *
65
+	 * @return string
66
+	 * @throws EE_Error
67
+	 * @throws ReflectionException
68
+	 */
69
+	public function get_admin_details_link()
70
+	{
71
+		return $this->get_admin_edit_link();
72
+	}
73
+
74
+
75
+	/**
76
+	 * Returns the link to the editor for the object.  Sometimes this is the same as the details.
77
+	 *
78
+	 * @return string
79
+	 * @throws EE_Error
80
+	 * @throws ReflectionException
81
+	 */
82
+	public function get_admin_edit_link()
83
+	{
84
+		/** @var RequestInterface $request */
85
+		$request = LoaderFactory::getLoader()->getShared(RequestInterface::class);
86
+		return esc_url(
87
+			add_query_arg(
88
+				'wp_http_referer',
89
+				urlencode(
90
+					wp_unslash(
91
+						$request->getServerParam('REQUEST_URI')
92
+					)
93
+				),
94
+				get_edit_user_link($this->ID())
95
+			)
96
+		);
97
+	}
98
+
99
+
100
+	/**
101
+	 * Returns the link to a settings page for the object.
102
+	 *
103
+	 * @return string
104
+	 * @throws EE_Error
105
+	 * @throws ReflectionException
106
+	 */
107
+	public function get_admin_settings_link()
108
+	{
109
+		return $this->get_admin_edit_link();
110
+	}
111
+
112
+
113
+	/**
114
+	 * Returns the link to the "overview" for the object (typically the "list table" view).
115
+	 *
116
+	 * @return string
117
+	 */
118
+	public function get_admin_overview_link()
119
+	{
120
+		return admin_url('users.php');
121
+	}
122 122
 }
Please login to merge, or discard this patch.
core/services/request/middleware/PreProductionVersionWarning.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
     public function preProductionVersionAdminNotice()
79 79
     {
80 80
         new PersistentAdminNotice(
81
-            'preProductionVersionAdminNotice_' . EVENT_ESPRESSO_VERSION,
81
+            'preProductionVersionAdminNotice_'.EVENT_ESPRESSO_VERSION,
82 82
             $this->warningNotice()
83 83
         );
84 84
     }
Please login to merge, or discard this patch.
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -18,91 +18,91 @@
 block discarded – undo
18 18
  */
19 19
 class PreProductionVersionWarning extends Middleware
20 20
 {
21
-    /**
22
-     * converts a Request to a Response
23
-     *
24
-     * @param RequestInterface  $request
25
-     * @param ResponseInterface $response
26
-     * @return ResponseInterface
27
-     */
28
-    public function handleRequest(RequestInterface $request, ResponseInterface $response)
29
-    {
30
-        $this->request = $request;
31
-        $this->response = $response;
32
-        $this->displayPreProductionVersionWarning();
33
-        $this->response = $this->processRequestStack($this->request, $this->response);
34
-        return $this->response;
35
-    }
21
+	/**
22
+	 * converts a Request to a Response
23
+	 *
24
+	 * @param RequestInterface  $request
25
+	 * @param ResponseInterface $response
26
+	 * @return ResponseInterface
27
+	 */
28
+	public function handleRequest(RequestInterface $request, ResponseInterface $response)
29
+	{
30
+		$this->request = $request;
31
+		$this->response = $response;
32
+		$this->displayPreProductionVersionWarning();
33
+		$this->response = $this->processRequestStack($this->request, $this->response);
34
+		return $this->response;
35
+	}
36 36
 
37 37
 
38
-    /**
39
-     * displays message on frontend of site notifying admin that EE has been temporarily placed into maintenance mode
40
-     *
41
-     * @return void
42
-     */
43
-    public function displayPreProductionVersionWarning()
44
-    {
45
-        // skip AJAX requests
46
-        if ($this->request->isAjax()) {
47
-            return;
48
-        }
49
-        // skip stable releases
50
-        if (substr(EVENT_ESPRESSO_VERSION, -5) !== '.beta') {
51
-            return;
52
-        }
53
-        // site admin has authorized use of non-stable release candidate for production
54
-        if (defined('ALLOW_NON_STABLE_RELEASE_ON_LIVE_SITE') && ALLOW_NON_STABLE_RELEASE_ON_LIVE_SITE) {
55
-            return;
56
-        }
57
-        // post release candidate warning
58
-        if ($this->request->isAdmin()) {
59
-            add_action('admin_notices', array($this, 'preProductionVersionAdminNotice'), -999);
60
-        } else {
61
-            add_action('shutdown', array($this, 'preProductionVersionWarningNotice'), 10);
62
-        }
63
-    }
38
+	/**
39
+	 * displays message on frontend of site notifying admin that EE has been temporarily placed into maintenance mode
40
+	 *
41
+	 * @return void
42
+	 */
43
+	public function displayPreProductionVersionWarning()
44
+	{
45
+		// skip AJAX requests
46
+		if ($this->request->isAjax()) {
47
+			return;
48
+		}
49
+		// skip stable releases
50
+		if (substr(EVENT_ESPRESSO_VERSION, -5) !== '.beta') {
51
+			return;
52
+		}
53
+		// site admin has authorized use of non-stable release candidate for production
54
+		if (defined('ALLOW_NON_STABLE_RELEASE_ON_LIVE_SITE') && ALLOW_NON_STABLE_RELEASE_ON_LIVE_SITE) {
55
+			return;
56
+		}
57
+		// post release candidate warning
58
+		if ($this->request->isAdmin()) {
59
+			add_action('admin_notices', array($this, 'preProductionVersionAdminNotice'), -999);
60
+		} else {
61
+			add_action('shutdown', array($this, 'preProductionVersionWarningNotice'), 10);
62
+		}
63
+	}
64 64
 
65 65
 
66
-    /**
67
-     * displays admin notice that current version of EE is not a stable release
68
-     *
69
-     * @return void
70
-     * @throws InvalidDataTypeException
71
-     */
72
-    public function preProductionVersionAdminNotice()
73
-    {
74
-        new PersistentAdminNotice(
75
-            'preProductionVersionAdminNotice_' . EVENT_ESPRESSO_VERSION,
76
-            $this->warningNotice()
77
-        );
78
-    }
66
+	/**
67
+	 * displays admin notice that current version of EE is not a stable release
68
+	 *
69
+	 * @return void
70
+	 * @throws InvalidDataTypeException
71
+	 */
72
+	public function preProductionVersionAdminNotice()
73
+	{
74
+		new PersistentAdminNotice(
75
+			'preProductionVersionAdminNotice_' . EVENT_ESPRESSO_VERSION,
76
+			$this->warningNotice()
77
+		);
78
+	}
79 79
 
80 80
 
81
-    /**
82
-     * displays message on frontend of site notifying admin that current version of EE is not a stable release
83
-     *
84
-     * @return void
85
-     */
86
-    public function preProductionVersionWarningNotice()
87
-    {
88
-        echo '<div id="ee-release-candidate-notice-dv" class="ee-really-important-notice-dv"><p>';
89
-        echo wp_kses($this->warningNotice(), AllowedTags::getAllowedTags());
90
-        echo '</p></div>';
91
-    }
81
+	/**
82
+	 * displays message on frontend of site notifying admin that current version of EE is not a stable release
83
+	 *
84
+	 * @return void
85
+	 */
86
+	public function preProductionVersionWarningNotice()
87
+	{
88
+		echo '<div id="ee-release-candidate-notice-dv" class="ee-really-important-notice-dv"><p>';
89
+		echo wp_kses($this->warningNotice(), AllowedTags::getAllowedTags());
90
+		echo '</p></div>';
91
+	}
92 92
 
93 93
 
94
-    /**
95
-     * @return string
96
-     */
97
-    private function warningNotice()
98
-    {
99
-        return sprintf(
100
-            esc_html__(
101
-                'This version of Event Espresso is for testing and/or evaluation purposes only. It is %1$snot%2$s considered a stable release and should therefore %1$snot%2$s be activated on a live or production website.',
102
-                'event_espresso'
103
-            ),
104
-            '<strong>',
105
-            '</strong>'
106
-        );
107
-    }
94
+	/**
95
+	 * @return string
96
+	 */
97
+	private function warningNotice()
98
+	{
99
+		return sprintf(
100
+			esc_html__(
101
+				'This version of Event Espresso is for testing and/or evaluation purposes only. It is %1$snot%2$s considered a stable release and should therefore %1$snot%2$s be activated on a live or production website.',
102
+				'event_espresso'
103
+			),
104
+			'<strong>',
105
+			'</strong>'
106
+		);
107
+	}
108 108
 }
Please login to merge, or discard this patch.
core/services/request/RequestStack.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
     public function __construct(RequestDecoratorInterface $request_stack_app, RequestStackCoreAppInterface $core_app)
48 48
     {
49 49
         $this->request_stack_app = $request_stack_app;
50
-        $this->core_app      = $core_app;
50
+        $this->core_app = $core_app;
51 51
     }
52 52
 
53 53
 
Please login to merge, or discard this patch.
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -14,59 +14,59 @@
 block discarded – undo
14 14
  */
15 15
 class RequestStack
16 16
 {
17
-    /**
18
-     * @var RequestDecoratorInterface $request_stack_app
19
-     */
20
-    protected $request_stack_app;
17
+	/**
18
+	 * @var RequestDecoratorInterface $request_stack_app
19
+	 */
20
+	protected $request_stack_app;
21 21
 
22
-    /**
23
-     * @var RequestStackCoreAppInterface $core_app
24
-     */
25
-    protected $core_app;
22
+	/**
23
+	 * @var RequestStackCoreAppInterface $core_app
24
+	 */
25
+	protected $core_app;
26 26
 
27
-    /**
28
-     * @var RequestInterface $request
29
-     */
30
-    protected $request;
27
+	/**
28
+	 * @var RequestInterface $request
29
+	 */
30
+	protected $request;
31 31
 
32
-    /**
33
-     * @var ResponseInterface $response
34
-     */
35
-    protected $response;
32
+	/**
33
+	 * @var ResponseInterface $response
34
+	 */
35
+	protected $response;
36 36
 
37 37
 
38
-    /**
39
-     * @param RequestDecoratorInterface    $request_stack_app
40
-     * @param RequestStackCoreAppInterface $core_app
41
-     */
42
-    public function __construct(RequestDecoratorInterface $request_stack_app, RequestStackCoreAppInterface $core_app)
43
-    {
44
-        $this->request_stack_app = $request_stack_app;
45
-        $this->core_app      = $core_app;
46
-    }
38
+	/**
39
+	 * @param RequestDecoratorInterface    $request_stack_app
40
+	 * @param RequestStackCoreAppInterface $core_app
41
+	 */
42
+	public function __construct(RequestDecoratorInterface $request_stack_app, RequestStackCoreAppInterface $core_app)
43
+	{
44
+		$this->request_stack_app = $request_stack_app;
45
+		$this->core_app      = $core_app;
46
+	}
47 47
 
48 48
 
49
-    /**
50
-     * @param RequestInterface  $request
51
-     * @param ResponseInterface $response
52
-     * @return ResponseInterface
53
-     */
54
-    public function handleRequest(RequestInterface $request, ResponseInterface $response)
55
-    {
56
-        $this->request  = $request;
57
-        $this->response = $response;
58
-        return $this->request_stack_app->handleRequest($request, $response);
59
-    }
49
+	/**
50
+	 * @param RequestInterface  $request
51
+	 * @param ResponseInterface $response
52
+	 * @return ResponseInterface
53
+	 */
54
+	public function handleRequest(RequestInterface $request, ResponseInterface $response)
55
+	{
56
+		$this->request  = $request;
57
+		$this->response = $response;
58
+		return $this->request_stack_app->handleRequest($request, $response);
59
+	}
60 60
 
61 61
 
62
-    /**
63
-     * handle_response
64
-     * executes the handle_response() method on the RequestStackCoreAppInterface object
65
-     * after the request stack has been fully processed
66
-     */
67
-    public function handleResponse()
68
-    {
69
-        $this->core_app->handleResponse($this->request, $this->response);
70
-    }
62
+	/**
63
+	 * handle_response
64
+	 * executes the handle_response() method on the RequestStackCoreAppInterface object
65
+	 * after the request stack has been fully processed
66
+	 */
67
+	public function handleResponse()
68
+	{
69
+		$this->core_app->handleResponse($this->request, $this->response);
70
+	}
71 71
 }
72 72
 // Location: RequestStack.php
Please login to merge, or discard this patch.