Completed
Pull Request — master (#388)
by Darren
18:30 queued 04:38
created
core/services/request/InvalidRequestStackMiddlewareException.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -15,33 +15,33 @@
 block discarded – undo
15 15
 class InvalidRequestStackMiddlewareException extends InvalidDataTypeException
16 16
 {
17 17
 
18
-    /**
19
-     * @param  mixed    $middleware_app_class
20
-     * @param  string   $message
21
-     * @param int       $code
22
-     * @param Exception $previous
23
-     */
24
-    public function __construct($middleware_app_class, $message = '', $code = 0, Exception $previous = null)
25
-    {
26
-        if (is_array($middleware_app_class)) {
27
-            $middleware_app_class = reset($middleware_app_class);
28
-        }
29
-        if (empty($message)) {
30
-            $message = sprintf(
31
-                esc_html__(
32
-                    'The supplied Request Stack Middleware class "%1$s" is invalid or could no be found.',
33
-                    'event_espresso'
34
-                ),
35
-                $middleware_app_class
36
-            );
37
-        }
38
-        parent::__construct(
39
-            '$middleware_app_class',
40
-            $middleware_app_class,
41
-            'EventEspresso\core\services\request\middleware\Middleware',
42
-            $message,
43
-            $code,
44
-            $previous
45
-        );
46
-    }
18
+	/**
19
+	 * @param  mixed    $middleware_app_class
20
+	 * @param  string   $message
21
+	 * @param int       $code
22
+	 * @param Exception $previous
23
+	 */
24
+	public function __construct($middleware_app_class, $message = '', $code = 0, Exception $previous = null)
25
+	{
26
+		if (is_array($middleware_app_class)) {
27
+			$middleware_app_class = reset($middleware_app_class);
28
+		}
29
+		if (empty($message)) {
30
+			$message = sprintf(
31
+				esc_html__(
32
+					'The supplied Request Stack Middleware class "%1$s" is invalid or could no be found.',
33
+					'event_espresso'
34
+				),
35
+				$middleware_app_class
36
+			);
37
+		}
38
+		parent::__construct(
39
+			'$middleware_app_class',
40
+			$middleware_app_class,
41
+			'EventEspresso\core\services\request\middleware\Middleware',
42
+			$message,
43
+			$code,
44
+			$previous
45
+		);
46
+	}
47 47
 }
Please login to merge, or discard this patch.
core/services/request/RequestStackBuilder.php 2 patches
Indentation   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -20,97 +20,97 @@
 block discarded – undo
20 20
 class RequestStackBuilder extends SplDoublyLinkedList
21 21
 {
22 22
 
23
-    /**
24
-     * @type LoaderInterface $loader
25
-     */
26
-    private $loader;
23
+	/**
24
+	 * @type LoaderInterface $loader
25
+	 */
26
+	private $loader;
27 27
 
28 28
 
29
-    /**
30
-     * RequestStackBuilder constructor.
31
-     *
32
-     * @param LoaderInterface $loader
33
-     */
34
-    public function __construct(LoaderInterface $loader)
35
-    {
36
-        $this->loader = $loader;
37
-        $this->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO | SplDoublyLinkedList::IT_MODE_KEEP);
38
-    }
29
+	/**
30
+	 * RequestStackBuilder constructor.
31
+	 *
32
+	 * @param LoaderInterface $loader
33
+	 */
34
+	public function __construct(LoaderInterface $loader)
35
+	{
36
+		$this->loader = $loader;
37
+		$this->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO | SplDoublyLinkedList::IT_MODE_KEEP);
38
+	}
39 39
 
40 40
 
41
-    /**
42
-     * builds decorated middleware stack
43
-     * by continuously injecting previous middleware app into the next
44
-     *
45
-     * @param RequestStackCoreAppInterface $application
46
-     * @return RequestStack
47
-     * @throws Exception
48
-     */
49
-    public function resolve(RequestStackCoreAppInterface $application)
50
-    {
51
-        $core_app = $application;
52
-        // NOW... because the RequestStack is following the decorator pattern,
53
-        // the first stack app we add will end up at the center of the stack,
54
-        // and will end up being the last item to actually run, but we don't want that!
55
-        // Basically we're dealing with TWO stacks, and transferring items from one to the other,
56
-        // BUT... we want the final stack to be in the same order as the first.
57
-        // So we need to reverse the iterator mode when transferring items,
58
-        // because if we don't, the second stack will end  up in the incorrect order.
59
-        $this->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO | SplDoublyLinkedList::IT_MODE_KEEP);
60
-        for ($this->rewind(); $this->valid(); $this->next()) {
61
-            try {
62
-                $middleware_app = $this->validateMiddlewareAppDetails($this->current(), true);
63
-                $middleware_app_class = array_shift($middleware_app);
64
-                $middleware_app_args = is_array($middleware_app) ? $middleware_app : array();
65
-                $middleware_app_args = array($application, $this->loader) + $middleware_app_args;
66
-                $application = $this->loader->getShared($middleware_app_class, $middleware_app_args);
67
-            } catch (InvalidRequestStackMiddlewareException $exception) {
68
-                if (WP_DEBUG) {
69
-                    new ExceptionStackTraceDisplay($exception);
70
-                    continue;
71
-                }
72
-                error_log($exception->getMessage());
73
-            }
74
-        }
75
-        return new RequestStack($application, $core_app);
76
-    }
41
+	/**
42
+	 * builds decorated middleware stack
43
+	 * by continuously injecting previous middleware app into the next
44
+	 *
45
+	 * @param RequestStackCoreAppInterface $application
46
+	 * @return RequestStack
47
+	 * @throws Exception
48
+	 */
49
+	public function resolve(RequestStackCoreAppInterface $application)
50
+	{
51
+		$core_app = $application;
52
+		// NOW... because the RequestStack is following the decorator pattern,
53
+		// the first stack app we add will end up at the center of the stack,
54
+		// and will end up being the last item to actually run, but we don't want that!
55
+		// Basically we're dealing with TWO stacks, and transferring items from one to the other,
56
+		// BUT... we want the final stack to be in the same order as the first.
57
+		// So we need to reverse the iterator mode when transferring items,
58
+		// because if we don't, the second stack will end  up in the incorrect order.
59
+		$this->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO | SplDoublyLinkedList::IT_MODE_KEEP);
60
+		for ($this->rewind(); $this->valid(); $this->next()) {
61
+			try {
62
+				$middleware_app = $this->validateMiddlewareAppDetails($this->current(), true);
63
+				$middleware_app_class = array_shift($middleware_app);
64
+				$middleware_app_args = is_array($middleware_app) ? $middleware_app : array();
65
+				$middleware_app_args = array($application, $this->loader) + $middleware_app_args;
66
+				$application = $this->loader->getShared($middleware_app_class, $middleware_app_args);
67
+			} catch (InvalidRequestStackMiddlewareException $exception) {
68
+				if (WP_DEBUG) {
69
+					new ExceptionStackTraceDisplay($exception);
70
+					continue;
71
+				}
72
+				error_log($exception->getMessage());
73
+			}
74
+		}
75
+		return new RequestStack($application, $core_app);
76
+	}
77 77
 
78 78
 
79
-    /**
80
-     * Ensures that the app details that have been pushed onto RequestStackBuilder
81
-     * are all ordered correctly so that the middleware can be properly constructed
82
-     *
83
-     * @param array $middleware_app
84
-     * @param bool  $recurse
85
-     * @return array
86
-     * @throws InvalidRequestStackMiddlewareException
87
-     */
88
-    protected function validateMiddlewareAppDetails(array $middleware_app, $recurse = false)
89
-    {
90
-        $middleware_app_class = reset($middleware_app);
91
-        // is array empty ?
92
-        if ($middleware_app_class === false) {
93
-            throw new InvalidRequestStackMiddlewareException($middleware_app_class);
94
-        }
95
-        // are the class and arguments in the wrong order ?
96
-        if (is_array($middleware_app_class)) {
97
-            if ($recurse === true) {
98
-                return $this->validateMiddlewareAppDetails(array_reverse($middleware_app));
99
-            }
100
-            throw new InvalidRequestStackMiddlewareException($middleware_app_class);
101
-        }
102
-        // is filter callback working like legacy middleware and sending a numerically indexed array ?
103
-        if (is_int($middleware_app_class)) {
104
-            if ($recurse === true) {
105
-                $middleware_app = array_reverse($middleware_app);
106
-                return $this->validateMiddlewareAppDetails(array(reset($middleware_app), array()));
107
-            }
108
-            throw new InvalidRequestStackMiddlewareException($middleware_app_class);
109
-        }
110
-        // is $middleware_app_class a valid FQCN (or class is already loaded) ?
111
-        if (! class_exists($middleware_app_class)) {
112
-            throw new InvalidRequestStackMiddlewareException($middleware_app_class);
113
-        }
114
-        return $middleware_app;
115
-    }
79
+	/**
80
+	 * Ensures that the app details that have been pushed onto RequestStackBuilder
81
+	 * are all ordered correctly so that the middleware can be properly constructed
82
+	 *
83
+	 * @param array $middleware_app
84
+	 * @param bool  $recurse
85
+	 * @return array
86
+	 * @throws InvalidRequestStackMiddlewareException
87
+	 */
88
+	protected function validateMiddlewareAppDetails(array $middleware_app, $recurse = false)
89
+	{
90
+		$middleware_app_class = reset($middleware_app);
91
+		// is array empty ?
92
+		if ($middleware_app_class === false) {
93
+			throw new InvalidRequestStackMiddlewareException($middleware_app_class);
94
+		}
95
+		// are the class and arguments in the wrong order ?
96
+		if (is_array($middleware_app_class)) {
97
+			if ($recurse === true) {
98
+				return $this->validateMiddlewareAppDetails(array_reverse($middleware_app));
99
+			}
100
+			throw new InvalidRequestStackMiddlewareException($middleware_app_class);
101
+		}
102
+		// is filter callback working like legacy middleware and sending a numerically indexed array ?
103
+		if (is_int($middleware_app_class)) {
104
+			if ($recurse === true) {
105
+				$middleware_app = array_reverse($middleware_app);
106
+				return $this->validateMiddlewareAppDetails(array(reset($middleware_app), array()));
107
+			}
108
+			throw new InvalidRequestStackMiddlewareException($middleware_app_class);
109
+		}
110
+		// is $middleware_app_class a valid FQCN (or class is already loaded) ?
111
+		if (! class_exists($middleware_app_class)) {
112
+			throw new InvalidRequestStackMiddlewareException($middleware_app_class);
113
+		}
114
+		return $middleware_app;
115
+	}
116 116
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
             throw new InvalidRequestStackMiddlewareException($middleware_app_class);
109 109
         }
110 110
         // is $middleware_app_class a valid FQCN (or class is already loaded) ?
111
-        if (! class_exists($middleware_app_class)) {
111
+        if ( ! class_exists($middleware_app_class)) {
112 112
             throw new InvalidRequestStackMiddlewareException($middleware_app_class);
113 113
         }
114 114
         return $middleware_app;
Please login to merge, or discard this patch.
core/services/request/middleware/BotDetector.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -17,23 +17,23 @@
 block discarded – undo
17 17
 class BotDetector extends Middleware
18 18
 {
19 19
 
20
-    /**
21
-     * converts a Request to a Response
22
-     *
23
-     * @param RequestInterface  $request
24
-     * @param ResponseInterface $response
25
-     * @return ResponseInterface
26
-     */
27
-    public function handleRequest(RequestInterface $request, ResponseInterface $response)
28
-    {
29
-        $this->request = $request;
30
-        $this->response = $response;
31
-        /** @var CrawlerDetect $CrawlerDetect */
32
-        $CrawlerDetect = $this->loader->getShared('EventEspressoVendor\Jaybizzle\CrawlerDetect\CrawlerDetect');
33
-        // Check and record the user agent of the current 'visitor'
34
-        $this->request->setIsBot($CrawlerDetect->isCrawler());
35
-        $this->request->setUserAgent($CrawlerDetect->userAgent());
36
-        $this->response = $this->processRequestStack($this->request, $this->response);
37
-        return $this->response;
38
-    }
20
+	/**
21
+	 * converts a Request to a Response
22
+	 *
23
+	 * @param RequestInterface  $request
24
+	 * @param ResponseInterface $response
25
+	 * @return ResponseInterface
26
+	 */
27
+	public function handleRequest(RequestInterface $request, ResponseInterface $response)
28
+	{
29
+		$this->request = $request;
30
+		$this->response = $response;
31
+		/** @var CrawlerDetect $CrawlerDetect */
32
+		$CrawlerDetect = $this->loader->getShared('EventEspressoVendor\Jaybizzle\CrawlerDetect\CrawlerDetect');
33
+		// Check and record the user agent of the current 'visitor'
34
+		$this->request->setIsBot($CrawlerDetect->isCrawler());
35
+		$this->request->setUserAgent($CrawlerDetect->userAgent());
36
+		$this->response = $this->processRequestStack($this->request, $this->response);
37
+		return $this->response;
38
+	}
39 39
 }
Please login to merge, or discard this patch.
core/services/request/middleware/RecommendedVersions.php 2 patches
Indentation   +172 added lines, -172 removed lines patch added patch discarded remove patch
@@ -19,182 +19,182 @@
 block discarded – undo
19 19
 class RecommendedVersions extends Middleware
20 20
 {
21 21
 
22
-    /**
23
-     * converts a Request to a Response
24
-     *
25
-     * @param RequestInterface  $request
26
-     * @param ResponseInterface $response
27
-     * @return ResponseInterface
28
-     * @throws InvalidDataTypeException
29
-     */
30
-    public function handleRequest(RequestInterface $request, ResponseInterface $response)
31
-    {
32
-        $this->request = $request;
33
-        $this->response = $response;
34
-        // check required WP version
35
-        if (! $this->minimumWordPressVersionRequired()) {
36
-            $this->request->unSetRequestParam('activate', true);
37
-            add_action('admin_notices', array($this, 'minimum_wp_version_error'), 1);
38
-            $this->response->terminateRequest();
39
-            $this->response->deactivatePlugin();
40
-        }
41
-        // check recommended PHP version
42
-        if (! $this->minimumPhpVersionRecommended()) {
43
-            $this->displayMinimumRecommendedPhpVersionNotice();
44
-        }
45
-        // upcoming required version
46
-        if (! $this->upcomingRequiredPhpVersion()) {
47
-            $this->displayUpcomingRequiredVersion();
48
-        }
49
-        $this->response = $this->processRequestStack($this->request, $this->response);
50
-        return $this->response;
51
-    }
52
-
53
-
54
-    /**
55
-     * Helper method to assess installed wp version against given values.
56
-     * By default this compares the required minimum version of WP for EE against the installed version of WP
57
-     * Note, $wp_version is the first parameter sent into the PHP version_compare function (what is being checked
58
-     * against) so consider that when sending in your values.
59
-     *
60
-     * @param string $version_to_check
61
-     * @param string $operator
62
-     * @return bool
63
-     */
64
-    public static function compareWordPressVersion($version_to_check = EE_MIN_WP_VER_REQUIRED, $operator = '>=')
65
-    {
66
-        global $wp_version;
67
-        return version_compare(
68
-            // first account for wp_version being pre-release
69
-            // (like RC, beta etc) which are usually in the format like 4.7-RC3-39519
70
-            strpos($wp_version, '-') > 0
71
-                ? substr($wp_version, 0, strpos($wp_version, '-'))
72
-                : $wp_version,
73
-            $version_to_check,
74
-            $operator
75
-        );
76
-    }
77
-
78
-
79
-    /**
80
-     * @return boolean
81
-     */
82
-    private function minimumWordPressVersionRequired()
83
-    {
84
-        return RecommendedVersions::compareWordPressVersion();
85
-    }
86
-
87
-
88
-    /**
89
-     * @param string $min_version
90
-     * @return boolean
91
-     */
92
-    private function checkPhpVersion($min_version = EE_MIN_PHP_VER_RECOMMENDED)
93
-    {
94
-        return version_compare(PHP_VERSION, $min_version, '>=') ? true : false;
95
-    }
96
-
97
-
98
-    /**
99
-     * @return boolean
100
-     */
101
-    private function minimumPhpVersionRecommended()
102
-    {
103
-        return $this->checkPhpVersion();
104
-    }
105
-
106
-
107
-    /**
108
-     * @return void
109
-     */
110
-    public function minimumWpVersionError()
111
-    {
112
-        global $wp_version;
113
-        ?>
22
+	/**
23
+	 * converts a Request to a Response
24
+	 *
25
+	 * @param RequestInterface  $request
26
+	 * @param ResponseInterface $response
27
+	 * @return ResponseInterface
28
+	 * @throws InvalidDataTypeException
29
+	 */
30
+	public function handleRequest(RequestInterface $request, ResponseInterface $response)
31
+	{
32
+		$this->request = $request;
33
+		$this->response = $response;
34
+		// check required WP version
35
+		if (! $this->minimumWordPressVersionRequired()) {
36
+			$this->request->unSetRequestParam('activate', true);
37
+			add_action('admin_notices', array($this, 'minimum_wp_version_error'), 1);
38
+			$this->response->terminateRequest();
39
+			$this->response->deactivatePlugin();
40
+		}
41
+		// check recommended PHP version
42
+		if (! $this->minimumPhpVersionRecommended()) {
43
+			$this->displayMinimumRecommendedPhpVersionNotice();
44
+		}
45
+		// upcoming required version
46
+		if (! $this->upcomingRequiredPhpVersion()) {
47
+			$this->displayUpcomingRequiredVersion();
48
+		}
49
+		$this->response = $this->processRequestStack($this->request, $this->response);
50
+		return $this->response;
51
+	}
52
+
53
+
54
+	/**
55
+	 * Helper method to assess installed wp version against given values.
56
+	 * By default this compares the required minimum version of WP for EE against the installed version of WP
57
+	 * Note, $wp_version is the first parameter sent into the PHP version_compare function (what is being checked
58
+	 * against) so consider that when sending in your values.
59
+	 *
60
+	 * @param string $version_to_check
61
+	 * @param string $operator
62
+	 * @return bool
63
+	 */
64
+	public static function compareWordPressVersion($version_to_check = EE_MIN_WP_VER_REQUIRED, $operator = '>=')
65
+	{
66
+		global $wp_version;
67
+		return version_compare(
68
+			// first account for wp_version being pre-release
69
+			// (like RC, beta etc) which are usually in the format like 4.7-RC3-39519
70
+			strpos($wp_version, '-') > 0
71
+				? substr($wp_version, 0, strpos($wp_version, '-'))
72
+				: $wp_version,
73
+			$version_to_check,
74
+			$operator
75
+		);
76
+	}
77
+
78
+
79
+	/**
80
+	 * @return boolean
81
+	 */
82
+	private function minimumWordPressVersionRequired()
83
+	{
84
+		return RecommendedVersions::compareWordPressVersion();
85
+	}
86
+
87
+
88
+	/**
89
+	 * @param string $min_version
90
+	 * @return boolean
91
+	 */
92
+	private function checkPhpVersion($min_version = EE_MIN_PHP_VER_RECOMMENDED)
93
+	{
94
+		return version_compare(PHP_VERSION, $min_version, '>=') ? true : false;
95
+	}
96
+
97
+
98
+	/**
99
+	 * @return boolean
100
+	 */
101
+	private function minimumPhpVersionRecommended()
102
+	{
103
+		return $this->checkPhpVersion();
104
+	}
105
+
106
+
107
+	/**
108
+	 * @return void
109
+	 */
110
+	public function minimumWpVersionError()
111
+	{
112
+		global $wp_version;
113
+		?>
114 114
         <div class="error">
115 115
             <p>
116 116
                 <?php
117
-                printf(
118
-                    __(
119
-                        'We\'re sorry, but Event Espresso requires WordPress version %1$s or greater in order to operate. You are currently running version %2$s.%3$sFor information on how to update your version of WordPress, please go to %4$s.',
120
-                        'event_espresso'
121
-                    ),
122
-                    EE_MIN_WP_VER_REQUIRED,
123
-                    $wp_version,
124
-                    '<br/>',
125
-                    '<a href="http://codex.wordpress.org/Updating_WordPress">http://codex.wordpress.org/Updating_WordPress</a>'
126
-                );
127
-                ?>
117
+				printf(
118
+					__(
119
+						'We\'re sorry, but Event Espresso requires WordPress version %1$s or greater in order to operate. You are currently running version %2$s.%3$sFor information on how to update your version of WordPress, please go to %4$s.',
120
+						'event_espresso'
121
+					),
122
+					EE_MIN_WP_VER_REQUIRED,
123
+					$wp_version,
124
+					'<br/>',
125
+					'<a href="http://codex.wordpress.org/Updating_WordPress">http://codex.wordpress.org/Updating_WordPress</a>'
126
+				);
127
+				?>
128 128
             </p>
129 129
         </div>
130 130
         <?php
131
-    }
132
-
133
-
134
-    /**
135
-     *    _display_minimum_recommended_php_version_notice
136
-     *
137
-     * @access private
138
-     * @return void
139
-     * @throws InvalidDataTypeException
140
-     */
141
-    private function displayMinimumRecommendedPhpVersionNotice()
142
-    {
143
-        if ($this->request->isAdmin()) {
144
-            new PersistentAdminNotice(
145
-                'php_version_' . str_replace('.', '-', EE_MIN_PHP_VER_RECOMMENDED) . '_recommended',
146
-                sprintf(
147
-                    esc_html__(
148
-                        'Event Espresso recommends PHP version %1$s or greater for optimal performance. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.',
149
-                        'event_espresso'
150
-                    ),
151
-                    EE_MIN_PHP_VER_RECOMMENDED,
152
-                    PHP_VERSION,
153
-                    '<br/>',
154
-                    '<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>'
155
-                )
156
-            );
157
-        }
158
-    }
159
-
160
-
161
-    /**
162
-     * Returns whether the provided php version number is less than the current version of php installed on the server.
163
-     *
164
-     * @param string $version_required
165
-     * @return bool
166
-     */
167
-    private function upcomingRequiredPhpVersion($version_required = '5.5')
168
-    {
169
-        return true;
170
-        // return $this->checkPhpVersion($version_required);
171
-    }
172
-
173
-
174
-    /**
175
-     *  Sets a notice for an upcoming required version of PHP in the next update of EE core.
176
-     */
177
-    private function displayUpcomingRequiredVersion()
178
-    {
179
-        if ($this->request->isAdmin()
180
-            && apply_filters('FHEE__EE_Recommended_Versions__displayUpcomingRequiredVersion', true, $this->request)
181
-            && current_user_can('update_plugins')
182
-        ) {
183
-            add_action('admin_notices', function () {
184
-                echo '<div class="notice event-espresso-admin-notice notice-warning"><p>'
185
-                     . sprintf(
186
-                         esc_html__(
187
-                             'Please note: The next update of Event Espresso 4 will %1$srequire%2$s PHP 5.4.45 or greater.  Your web server\'s PHP version is %3$s.  You can contact your host and ask them to update your PHP version to at least PHP 5.6.  Please do not update to the new version of Event Espresso 4 until the PHP update is completed. Read about why keeping your server on the latest version of PHP is a good idea %4$shere%5$s',
188
-                             'event_espresso'
189
-                         ),
190
-                         '<strong>',
191
-                         '</strong>',
192
-                         PHP_VERSION,
193
-                         '<a href="https://wordpress.org/support/upgrade-php/">',
194
-                         '</a>'
195
-                     )
196
-                     . '</p></div>';
197
-            });
198
-        }
199
-    }
131
+	}
132
+
133
+
134
+	/**
135
+	 *    _display_minimum_recommended_php_version_notice
136
+	 *
137
+	 * @access private
138
+	 * @return void
139
+	 * @throws InvalidDataTypeException
140
+	 */
141
+	private function displayMinimumRecommendedPhpVersionNotice()
142
+	{
143
+		if ($this->request->isAdmin()) {
144
+			new PersistentAdminNotice(
145
+				'php_version_' . str_replace('.', '-', EE_MIN_PHP_VER_RECOMMENDED) . '_recommended',
146
+				sprintf(
147
+					esc_html__(
148
+						'Event Espresso recommends PHP version %1$s or greater for optimal performance. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.',
149
+						'event_espresso'
150
+					),
151
+					EE_MIN_PHP_VER_RECOMMENDED,
152
+					PHP_VERSION,
153
+					'<br/>',
154
+					'<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>'
155
+				)
156
+			);
157
+		}
158
+	}
159
+
160
+
161
+	/**
162
+	 * Returns whether the provided php version number is less than the current version of php installed on the server.
163
+	 *
164
+	 * @param string $version_required
165
+	 * @return bool
166
+	 */
167
+	private function upcomingRequiredPhpVersion($version_required = '5.5')
168
+	{
169
+		return true;
170
+		// return $this->checkPhpVersion($version_required);
171
+	}
172
+
173
+
174
+	/**
175
+	 *  Sets a notice for an upcoming required version of PHP in the next update of EE core.
176
+	 */
177
+	private function displayUpcomingRequiredVersion()
178
+	{
179
+		if ($this->request->isAdmin()
180
+			&& apply_filters('FHEE__EE_Recommended_Versions__displayUpcomingRequiredVersion', true, $this->request)
181
+			&& current_user_can('update_plugins')
182
+		) {
183
+			add_action('admin_notices', function () {
184
+				echo '<div class="notice event-espresso-admin-notice notice-warning"><p>'
185
+					 . sprintf(
186
+						 esc_html__(
187
+							 'Please note: The next update of Event Espresso 4 will %1$srequire%2$s PHP 5.4.45 or greater.  Your web server\'s PHP version is %3$s.  You can contact your host and ask them to update your PHP version to at least PHP 5.6.  Please do not update to the new version of Event Espresso 4 until the PHP update is completed. Read about why keeping your server on the latest version of PHP is a good idea %4$shere%5$s',
188
+							 'event_espresso'
189
+						 ),
190
+						 '<strong>',
191
+						 '</strong>',
192
+						 PHP_VERSION,
193
+						 '<a href="https://wordpress.org/support/upgrade-php/">',
194
+						 '</a>'
195
+					 )
196
+					 . '</p></div>';
197
+			});
198
+		}
199
+	}
200 200
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,18 +32,18 @@  discard block
 block discarded – undo
32 32
         $this->request = $request;
33 33
         $this->response = $response;
34 34
         // check required WP version
35
-        if (! $this->minimumWordPressVersionRequired()) {
35
+        if ( ! $this->minimumWordPressVersionRequired()) {
36 36
             $this->request->unSetRequestParam('activate', true);
37 37
             add_action('admin_notices', array($this, 'minimum_wp_version_error'), 1);
38 38
             $this->response->terminateRequest();
39 39
             $this->response->deactivatePlugin();
40 40
         }
41 41
         // check recommended PHP version
42
-        if (! $this->minimumPhpVersionRecommended()) {
42
+        if ( ! $this->minimumPhpVersionRecommended()) {
43 43
             $this->displayMinimumRecommendedPhpVersionNotice();
44 44
         }
45 45
         // upcoming required version
46
-        if (! $this->upcomingRequiredPhpVersion()) {
46
+        if ( ! $this->upcomingRequiredPhpVersion()) {
47 47
             $this->displayUpcomingRequiredVersion();
48 48
         }
49 49
         $this->response = $this->processRequestStack($this->request, $this->response);
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     {
143 143
         if ($this->request->isAdmin()) {
144 144
             new PersistentAdminNotice(
145
-                'php_version_' . str_replace('.', '-', EE_MIN_PHP_VER_RECOMMENDED) . '_recommended',
145
+                'php_version_'.str_replace('.', '-', EE_MIN_PHP_VER_RECOMMENDED).'_recommended',
146 146
                 sprintf(
147 147
                     esc_html__(
148 148
                         'Event Espresso recommends PHP version %1$s or greater for optimal performance. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.',
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
             && apply_filters('FHEE__EE_Recommended_Versions__displayUpcomingRequiredVersion', true, $this->request)
181 181
             && current_user_can('update_plugins')
182 182
         ) {
183
-            add_action('admin_notices', function () {
183
+            add_action('admin_notices', function() {
184 184
                 echo '<div class="notice event-espresso-admin-notice notice-warning"><p>'
185 185
                      . sprintf(
186 186
                          esc_html__(
Please login to merge, or discard this patch.
core/services/request/middleware/DetectLogin.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -16,28 +16,28 @@
 block discarded – undo
16 16
 class DetectLogin extends Middleware
17 17
 {
18 18
 
19
-    /**
20
-     * converts a Request to a Response
21
-     *
22
-     * @param RequestInterface  $request
23
-     * @param ResponseInterface $response
24
-     * @return ResponseInterface
25
-     */
26
-    public function handleRequest(RequestInterface $request, ResponseInterface $response)
27
-    {
28
-        $this->request = $request;
29
-        $this->response = $response;
30
-        global $pagenow;
31
-        if (in_array(
32
-            $pagenow,
33
-            array('wp-login.php', 'wp-register.php'),
34
-            true
35
-        )
36
-            && ! filter_var($request->getRequestParam('ee_load_on_login'), FILTER_VALIDATE_BOOLEAN)
37
-        ) {
38
-            $this->response->terminateRequest();
39
-        }
40
-        $this->response = $this->processRequestStack($this->request, $this->response);
41
-        return $this->response;
42
-    }
19
+	/**
20
+	 * converts a Request to a Response
21
+	 *
22
+	 * @param RequestInterface  $request
23
+	 * @param ResponseInterface $response
24
+	 * @return ResponseInterface
25
+	 */
26
+	public function handleRequest(RequestInterface $request, ResponseInterface $response)
27
+	{
28
+		$this->request = $request;
29
+		$this->response = $response;
30
+		global $pagenow;
31
+		if (in_array(
32
+			$pagenow,
33
+			array('wp-login.php', 'wp-register.php'),
34
+			true
35
+		)
36
+			&& ! filter_var($request->getRequestParam('ee_load_on_login'), FILTER_VALIDATE_BOOLEAN)
37
+		) {
38
+			$this->response->terminateRequest();
39
+		}
40
+		$this->response = $this->processRequestStack($this->request, $this->response);
41
+		return $this->response;
42
+	}
43 43
 }
Please login to merge, or discard this patch.
core/services/request/middleware/Middleware.php 2 patches
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -25,52 +25,52 @@
 block discarded – undo
25 25
 abstract class Middleware implements RequestDecoratorInterface
26 26
 {
27 27
 
28
-    /**
29
-     * @var RequestDecoratorInterface $request_stack_app
30
-     */
31
-    protected $request_stack_app;
28
+	/**
29
+	 * @var RequestDecoratorInterface $request_stack_app
30
+	 */
31
+	protected $request_stack_app;
32 32
 
33
-    /**
34
-     * @var RequestInterface $request
35
-     */
36
-    protected $request;
33
+	/**
34
+	 * @var RequestInterface $request
35
+	 */
36
+	protected $request;
37 37
 
38
-    /**
39
-     * @var ResponseInterface $response
40
-     */
41
-    protected $response;
38
+	/**
39
+	 * @var ResponseInterface $response
40
+	 */
41
+	protected $response;
42 42
 
43
-    /**
44
-     * @var LoaderInterface
45
-     */
46
-    protected $loader;
43
+	/**
44
+	 * @var LoaderInterface
45
+	 */
46
+	protected $loader;
47 47
 
48 48
 
49
-    /**
50
-     * @param RequestDecoratorInterface $request_stack_app
51
-     * @param LoaderInterface           $loader
52
-     */
53
-    public function __construct(RequestDecoratorInterface $request_stack_app, LoaderInterface $loader)
54
-    {
55
-        $this->request_stack_app = $request_stack_app;
56
-        $this->loader = $loader;
57
-    }
49
+	/**
50
+	 * @param RequestDecoratorInterface $request_stack_app
51
+	 * @param LoaderInterface           $loader
52
+	 */
53
+	public function __construct(RequestDecoratorInterface $request_stack_app, LoaderInterface $loader)
54
+	{
55
+		$this->request_stack_app = $request_stack_app;
56
+		$this->loader = $loader;
57
+	}
58 58
 
59 59
 
60
-    /**
61
-     * process_request_stack
62
-     *
63
-     * @param RequestInterface  $request
64
-     * @param ResponseInterface $response
65
-     * @return ResponseInterface
66
-     */
67
-    protected function processRequestStack(RequestInterface $request, ResponseInterface $response)
68
-    {
69
-        $this->request = $request;
70
-        $this->response = $response;
71
-        if (! $this->response->requestTerminated()) {
72
-            $this->response = $this->request_stack_app->handleRequest($this->request, $this->response);
73
-        }
74
-        return $this->response;
75
-    }
60
+	/**
61
+	 * process_request_stack
62
+	 *
63
+	 * @param RequestInterface  $request
64
+	 * @param ResponseInterface $response
65
+	 * @return ResponseInterface
66
+	 */
67
+	protected function processRequestStack(RequestInterface $request, ResponseInterface $response)
68
+	{
69
+		$this->request = $request;
70
+		$this->response = $response;
71
+		if (! $this->response->requestTerminated()) {
72
+			$this->response = $this->request_stack_app->handleRequest($this->request, $this->response);
73
+		}
74
+		return $this->response;
75
+	}
76 76
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
     {
69 69
         $this->request = $request;
70 70
         $this->response = $response;
71
-        if (! $this->response->requestTerminated()) {
71
+        if ( ! $this->response->requestTerminated()) {
72 72
             $this->response = $this->request_stack_app->handleRequest($this->request, $this->response);
73 73
         }
74 74
         return $this->response;
Please login to merge, or discard this patch.
core/services/collections/LooseCollection.php 2 patches
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -16,37 +16,37 @@
 block discarded – undo
16 16
 {
17 17
 
18 18
 
19
-    /**
20
-     * setCollectionInterface
21
-     *
22
-     * @access protected
23
-     * @param  string $collection_interface
24
-     */
25
-    protected function setCollectionInterface($collection_interface)
26
-    {
27
-        $this->collection_interface = '';
28
-    }
19
+	/**
20
+	 * setCollectionInterface
21
+	 *
22
+	 * @access protected
23
+	 * @param  string $collection_interface
24
+	 */
25
+	protected function setCollectionInterface($collection_interface)
26
+	{
27
+		$this->collection_interface = '';
28
+	}
29 29
 
30 30
 
31
-    /**
32
-     * add
33
-     * attaches an object to the Collection
34
-     * and sets any supplied data associated with the current iterator entry
35
-     * by calling EE_Object_Collection::set_identifier()
36
-     *
37
-     * @access public
38
-     * @param  mixed $object
39
-     * @param  mixed $identifier
40
-     * @return bool
41
-     * @throws InvalidEntityException
42
-     */
43
-    public function add($object, $identifier = null)
44
-    {
45
-        if (! is_object($object)) {
46
-            throw new InvalidEntityException($object, 'object');
47
-        }
48
-        $this->attach($object);
49
-        $this->setIdentifier($object, $identifier);
50
-        return $this->contains($object);
51
-    }
31
+	/**
32
+	 * add
33
+	 * attaches an object to the Collection
34
+	 * and sets any supplied data associated with the current iterator entry
35
+	 * by calling EE_Object_Collection::set_identifier()
36
+	 *
37
+	 * @access public
38
+	 * @param  mixed $object
39
+	 * @param  mixed $identifier
40
+	 * @return bool
41
+	 * @throws InvalidEntityException
42
+	 */
43
+	public function add($object, $identifier = null)
44
+	{
45
+		if (! is_object($object)) {
46
+			throw new InvalidEntityException($object, 'object');
47
+		}
48
+		$this->attach($object);
49
+		$this->setIdentifier($object, $identifier);
50
+		return $this->contains($object);
51
+	}
52 52
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
      */
43 43
     public function add($object, $identifier = null)
44 44
     {
45
-        if (! is_object($object)) {
45
+        if ( ! is_object($object)) {
46 46
             throw new InvalidEntityException($object, 'object');
47 47
         }
48 48
         $this->attach($object);
Please login to merge, or discard this patch.
core/services/notices/NoticeConverter.php 1 patch
Indentation   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -12,71 +12,71 @@
 block discarded – undo
12 12
 abstract class NoticeConverter implements NoticeConverterInterface
13 13
 {
14 14
 
15
-    /**
16
-     * @var NoticesContainerInterface $notices
17
-     */
18
-    private $notices;
19
-
20
-    /**
21
-     * if set to true, then errors will be thrown as exceptions
22
-     *
23
-     * @var boolean $throw_exceptions
24
-     */
25
-    private $throw_exceptions;
26
-
27
-
28
-    /**
29
-     * NoticeConverter constructor.
30
-     *
31
-     * @param bool $throw_exceptions
32
-     */
33
-    public function __construct($throw_exceptions = false)
34
-    {
35
-        $this->throw_exceptions = $throw_exceptions;
36
-    }
37
-
38
-
39
-    /**
40
-     * @return NoticesContainerInterface
41
-     */
42
-    public function getNotices()
43
-    {
44
-        return $this->notices;
45
-    }
46
-
47
-
48
-    /**
49
-     * @param NoticesContainerInterface $notices
50
-     */
51
-    protected function setNotices(NoticesContainerInterface $notices)
52
-    {
53
-        $this->notices = $notices;
54
-    }
55
-
56
-
57
-    /**
58
-     * @return bool
59
-     */
60
-    public function getThrowExceptions()
61
-    {
62
-        return $this->throw_exceptions;
63
-    }
64
-
65
-
66
-    /**
67
-     * @param bool $throw_exceptions
68
-     */
69
-    public function setThrowExceptions($throw_exceptions)
70
-    {
71
-        $this->throw_exceptions = filter_var($throw_exceptions, FILTER_VALIDATE_BOOLEAN);
72
-    }
73
-
74
-
75
-    /**
76
-     * @return void;
77
-     */
78
-    public function clearNotices()
79
-    {
80
-        $this->notices = null;
81
-    }
15
+	/**
16
+	 * @var NoticesContainerInterface $notices
17
+	 */
18
+	private $notices;
19
+
20
+	/**
21
+	 * if set to true, then errors will be thrown as exceptions
22
+	 *
23
+	 * @var boolean $throw_exceptions
24
+	 */
25
+	private $throw_exceptions;
26
+
27
+
28
+	/**
29
+	 * NoticeConverter constructor.
30
+	 *
31
+	 * @param bool $throw_exceptions
32
+	 */
33
+	public function __construct($throw_exceptions = false)
34
+	{
35
+		$this->throw_exceptions = $throw_exceptions;
36
+	}
37
+
38
+
39
+	/**
40
+	 * @return NoticesContainerInterface
41
+	 */
42
+	public function getNotices()
43
+	{
44
+		return $this->notices;
45
+	}
46
+
47
+
48
+	/**
49
+	 * @param NoticesContainerInterface $notices
50
+	 */
51
+	protected function setNotices(NoticesContainerInterface $notices)
52
+	{
53
+		$this->notices = $notices;
54
+	}
55
+
56
+
57
+	/**
58
+	 * @return bool
59
+	 */
60
+	public function getThrowExceptions()
61
+	{
62
+		return $this->throw_exceptions;
63
+	}
64
+
65
+
66
+	/**
67
+	 * @param bool $throw_exceptions
68
+	 */
69
+	public function setThrowExceptions($throw_exceptions)
70
+	{
71
+		$this->throw_exceptions = filter_var($throw_exceptions, FILTER_VALIDATE_BOOLEAN);
72
+	}
73
+
74
+
75
+	/**
76
+	 * @return void;
77
+	 */
78
+	public function clearNotices()
79
+	{
80
+		$this->notices = null;
81
+	}
82 82
 }
Please login to merge, or discard this patch.
core/services/notices/AdminNotice.php 2 patches
Indentation   +115 added lines, -115 removed lines patch added patch discarded remove patch
@@ -13,119 +13,119 @@
 block discarded – undo
13 13
 class AdminNotice
14 14
 {
15 15
 
16
-    const ERROR = 'notice-error';
17
-
18
-    const WARNING = 'notice-warning';
19
-
20
-    const SUCCESS = 'notice-success';
21
-
22
-    const INFORMATION = 'notice-info';
23
-
24
-    const DISMISSABLE = ' is-dismissible';
25
-
26
-    /**
27
-     * generic system notice to be converted into a WP admin notice
28
-     *
29
-     * @var NoticeInterface $notice
30
-     */
31
-    private $notice;
32
-
33
-
34
-    /**
35
-     * AdminNotice constructor.
36
-     *
37
-     * @param NoticeInterface $notice
38
-     * @param bool            $display_now
39
-     */
40
-    public function __construct(NoticeInterface $notice, $display_now = true)
41
-    {
42
-        $this->notice = $notice;
43
-        if (! did_action('admin_notices')) {
44
-            add_action('admin_notices', array($this, 'displayNotice'));
45
-        } elseif ($display_now) {
46
-            $this->displayNotice();
47
-        }
48
-    }
49
-
50
-
51
-    /**
52
-     * @return void
53
-     */
54
-    public function displayNotice()
55
-    {
56
-        echo $this->getNotice();
57
-    }
58
-
59
-
60
-    /**
61
-     * produces something  like:
62
-     *  <div class="notice notice-success is-dismissible event-espresso-admin-notice">
63
-     *      <p>YOU DID IT!</p>
64
-     *      <button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this
65
-     *      notice.</span></button>
66
-     *  </div>
67
-     *
68
-     * @return string
69
-     */
70
-    public function getNotice()
71
-    {
72
-        return sprintf(
73
-            '<div class="notice %1$s%2$s event-espresso-admin-notice"><p>%3$s</p></div>',
74
-            $this->getType(),
75
-            $this->notice->isDismissible() ? AdminNotice::DISMISSABLE : '',
76
-            $this->getMessage()
77
-        );
78
-    }
79
-
80
-
81
-    /**
82
-     * @return string
83
-     */
84
-    private function getType()
85
-    {
86
-        switch ($this->notice->type()) {
87
-            case Notice::ERROR:
88
-                return AdminNotice::ERROR;
89
-                break;
90
-            case Notice::ATTENTION:
91
-                return AdminNotice::WARNING;
92
-                break;
93
-            case Notice::SUCCESS:
94
-                return AdminNotice::SUCCESS;
95
-                break;
96
-            case Notice::INFORMATION:
97
-            default:
98
-                return AdminNotice::INFORMATION;
99
-                break;
100
-        }
101
-    }
102
-
103
-
104
-    /**
105
-     * @return string
106
-     */
107
-    protected function getMessage()
108
-    {
109
-        $message = $this->notice->message();
110
-        if (WP_DEBUG && $this->getType() === AdminNotice::ERROR) {
111
-            $message .= '<br/><span class="tiny-text">' . $this->generateErrorCode() . '</span>';
112
-        }
113
-        return $message;
114
-    }
115
-
116
-
117
-    /**
118
-     * create error code from filepath, function name,
119
-     * and line number where notice was generated
120
-     *
121
-     * @return string
122
-     */
123
-    protected function generateErrorCode()
124
-    {
125
-        $file = explode('.', basename($this->notice->file()));
126
-        $error_code = ! empty($file[0]) ? $file[0] : '';
127
-        $error_code .= ! empty($error_code) ? ' - ' . $this->notice->func() : $this->notice->func();
128
-        $error_code .= ' - ' . $this->notice->line();
129
-        return $error_code;
130
-    }
16
+	const ERROR = 'notice-error';
17
+
18
+	const WARNING = 'notice-warning';
19
+
20
+	const SUCCESS = 'notice-success';
21
+
22
+	const INFORMATION = 'notice-info';
23
+
24
+	const DISMISSABLE = ' is-dismissible';
25
+
26
+	/**
27
+	 * generic system notice to be converted into a WP admin notice
28
+	 *
29
+	 * @var NoticeInterface $notice
30
+	 */
31
+	private $notice;
32
+
33
+
34
+	/**
35
+	 * AdminNotice constructor.
36
+	 *
37
+	 * @param NoticeInterface $notice
38
+	 * @param bool            $display_now
39
+	 */
40
+	public function __construct(NoticeInterface $notice, $display_now = true)
41
+	{
42
+		$this->notice = $notice;
43
+		if (! did_action('admin_notices')) {
44
+			add_action('admin_notices', array($this, 'displayNotice'));
45
+		} elseif ($display_now) {
46
+			$this->displayNotice();
47
+		}
48
+	}
49
+
50
+
51
+	/**
52
+	 * @return void
53
+	 */
54
+	public function displayNotice()
55
+	{
56
+		echo $this->getNotice();
57
+	}
58
+
59
+
60
+	/**
61
+	 * produces something  like:
62
+	 *  <div class="notice notice-success is-dismissible event-espresso-admin-notice">
63
+	 *      <p>YOU DID IT!</p>
64
+	 *      <button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this
65
+	 *      notice.</span></button>
66
+	 *  </div>
67
+	 *
68
+	 * @return string
69
+	 */
70
+	public function getNotice()
71
+	{
72
+		return sprintf(
73
+			'<div class="notice %1$s%2$s event-espresso-admin-notice"><p>%3$s</p></div>',
74
+			$this->getType(),
75
+			$this->notice->isDismissible() ? AdminNotice::DISMISSABLE : '',
76
+			$this->getMessage()
77
+		);
78
+	}
79
+
80
+
81
+	/**
82
+	 * @return string
83
+	 */
84
+	private function getType()
85
+	{
86
+		switch ($this->notice->type()) {
87
+			case Notice::ERROR:
88
+				return AdminNotice::ERROR;
89
+				break;
90
+			case Notice::ATTENTION:
91
+				return AdminNotice::WARNING;
92
+				break;
93
+			case Notice::SUCCESS:
94
+				return AdminNotice::SUCCESS;
95
+				break;
96
+			case Notice::INFORMATION:
97
+			default:
98
+				return AdminNotice::INFORMATION;
99
+				break;
100
+		}
101
+	}
102
+
103
+
104
+	/**
105
+	 * @return string
106
+	 */
107
+	protected function getMessage()
108
+	{
109
+		$message = $this->notice->message();
110
+		if (WP_DEBUG && $this->getType() === AdminNotice::ERROR) {
111
+			$message .= '<br/><span class="tiny-text">' . $this->generateErrorCode() . '</span>';
112
+		}
113
+		return $message;
114
+	}
115
+
116
+
117
+	/**
118
+	 * create error code from filepath, function name,
119
+	 * and line number where notice was generated
120
+	 *
121
+	 * @return string
122
+	 */
123
+	protected function generateErrorCode()
124
+	{
125
+		$file = explode('.', basename($this->notice->file()));
126
+		$error_code = ! empty($file[0]) ? $file[0] : '';
127
+		$error_code .= ! empty($error_code) ? ' - ' . $this->notice->func() : $this->notice->func();
128
+		$error_code .= ' - ' . $this->notice->line();
129
+		return $error_code;
130
+	}
131 131
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     public function __construct(NoticeInterface $notice, $display_now = true)
41 41
     {
42 42
         $this->notice = $notice;
43
-        if (! did_action('admin_notices')) {
43
+        if ( ! did_action('admin_notices')) {
44 44
             add_action('admin_notices', array($this, 'displayNotice'));
45 45
         } elseif ($display_now) {
46 46
             $this->displayNotice();
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
     {
109 109
         $message = $this->notice->message();
110 110
         if (WP_DEBUG && $this->getType() === AdminNotice::ERROR) {
111
-            $message .= '<br/><span class="tiny-text">' . $this->generateErrorCode() . '</span>';
111
+            $message .= '<br/><span class="tiny-text">'.$this->generateErrorCode().'</span>';
112 112
         }
113 113
         return $message;
114 114
     }
@@ -124,8 +124,8 @@  discard block
 block discarded – undo
124 124
     {
125 125
         $file = explode('.', basename($this->notice->file()));
126 126
         $error_code = ! empty($file[0]) ? $file[0] : '';
127
-        $error_code .= ! empty($error_code) ? ' - ' . $this->notice->func() : $this->notice->func();
128
-        $error_code .= ' - ' . $this->notice->line();
127
+        $error_code .= ! empty($error_code) ? ' - '.$this->notice->func() : $this->notice->func();
128
+        $error_code .= ' - '.$this->notice->line();
129 129
         return $error_code;
130 130
     }
131 131
 }
Please login to merge, or discard this patch.