Completed
Push — develop ( 24c9de...c5d946 )
by Zack
16:00
created
vendor/composer/platform_check.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -4,23 +4,23 @@
 block discarded – undo
4 4
 
5 5
 $issues = array();
6 6
 
7
-if (!(PHP_VERSION_ID >= 50300)) {
8
-    $issues[] = 'Your Composer dependencies require a PHP version ">= 5.3.0". You are running ' . PHP_VERSION . '.';
7
+if ( ! ( PHP_VERSION_ID >= 50300 ) ) {
8
+    $issues[ ] = 'Your Composer dependencies require a PHP version ">= 5.3.0". You are running ' . PHP_VERSION . '.';
9 9
 }
10 10
 
11
-if ($issues) {
12
-    if (!headers_sent()) {
13
-        header('HTTP/1.1 500 Internal Server Error');
11
+if ( $issues ) {
12
+    if ( ! headers_sent() ) {
13
+        header( 'HTTP/1.1 500 Internal Server Error' );
14 14
     }
15
-    if (!ini_get('display_errors')) {
16
-        if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
17
-            fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
18
-        } elseif (!headers_sent()) {
19
-            echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
15
+    if ( ! ini_get( 'display_errors' ) ) {
16
+        if ( PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg' ) {
17
+            fwrite( STDERR, 'Composer detected issues in your platform:' . PHP_EOL . PHP_EOL . implode( PHP_EOL, $issues ) . PHP_EOL . PHP_EOL );
18
+        } elseif ( ! headers_sent() ) {
19
+            echo 'Composer detected issues in your platform:' . PHP_EOL . PHP_EOL . str_replace( 'You are running ' . PHP_VERSION . '.', '', implode( PHP_EOL, $issues ) ) . PHP_EOL . PHP_EOL;
20 20
         }
21 21
     }
22 22
     trigger_error(
23
-        'Composer detected issues in your platform: ' . implode(' ', $issues),
23
+        'Composer detected issues in your platform: ' . implode( ' ', $issues ),
24 24
         E_USER_ERROR
25 25
     );
26 26
 }
Please login to merge, or discard this patch.
vendor/composer/autoload_namespaces.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@
 block discarded – undo
2 2
 
3 3
 // autoload_namespaces.php @generated by Composer
4 4
 
5
-$vendorDir = dirname(dirname(__FILE__));
6
-$baseDir = dirname($vendorDir);
5
+$vendorDir = dirname( dirname( __FILE__ ) );
6
+$baseDir = dirname( $vendorDir );
7 7
 
8 8
 return array(
9 9
 );
Please login to merge, or discard this patch.
vendor/psr/log/Psr/Log/LoggerAwareTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
      *
26 26
      * @param LoggerInterface $logger
27 27
      */
28
-    public function setLogger(LoggerInterface $logger)
28
+    public function setLogger( LoggerInterface $logger )
29 29
     {
30 30
         $this->logger = $logger;
31 31
     }
Please login to merge, or discard this patch.
vendor/psr/log/Psr/Log/AbstractLogger.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
      *
26 26
      * @return void
27 27
      */
28
-    public function emergency($message, array $context = array())
28
+    public function emergency( $message, array $context = array() )
29 29
     {
30
-        $this->log(LogLevel::EMERGENCY, $message, $context);
30
+        $this->log( LogLevel::EMERGENCY, $message, $context );
31 31
     }
32 32
 
33 33
     /**
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
      *
42 42
      * @return void
43 43
      */
44
-    public function alert($message, array $context = array())
44
+    public function alert( $message, array $context = array() )
45 45
     {
46
-        $this->log(LogLevel::ALERT, $message, $context);
46
+        $this->log( LogLevel::ALERT, $message, $context );
47 47
     }
48 48
 
49 49
     /**
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
      *
57 57
      * @return void
58 58
      */
59
-    public function critical($message, array $context = array())
59
+    public function critical( $message, array $context = array() )
60 60
     {
61
-        $this->log(LogLevel::CRITICAL, $message, $context);
61
+        $this->log( LogLevel::CRITICAL, $message, $context );
62 62
     }
63 63
 
64 64
     /**
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
      *
71 71
      * @return void
72 72
      */
73
-    public function error($message, array $context = array())
73
+    public function error( $message, array $context = array() )
74 74
     {
75
-        $this->log(LogLevel::ERROR, $message, $context);
75
+        $this->log( LogLevel::ERROR, $message, $context );
76 76
     }
77 77
 
78 78
     /**
@@ -86,9 +86,9 @@  discard block
 block discarded – undo
86 86
      *
87 87
      * @return void
88 88
      */
89
-    public function warning($message, array $context = array())
89
+    public function warning( $message, array $context = array() )
90 90
     {
91
-        $this->log(LogLevel::WARNING, $message, $context);
91
+        $this->log( LogLevel::WARNING, $message, $context );
92 92
     }
93 93
 
94 94
     /**
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
      *
100 100
      * @return void
101 101
      */
102
-    public function notice($message, array $context = array())
102
+    public function notice( $message, array $context = array() )
103 103
     {
104
-        $this->log(LogLevel::NOTICE, $message, $context);
104
+        $this->log( LogLevel::NOTICE, $message, $context );
105 105
     }
106 106
 
107 107
     /**
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
      *
115 115
      * @return void
116 116
      */
117
-    public function info($message, array $context = array())
117
+    public function info( $message, array $context = array() )
118 118
     {
119
-        $this->log(LogLevel::INFO, $message, $context);
119
+        $this->log( LogLevel::INFO, $message, $context );
120 120
     }
121 121
 
122 122
     /**
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
      *
128 128
      * @return void
129 129
      */
130
-    public function debug($message, array $context = array())
130
+    public function debug( $message, array $context = array() )
131 131
     {
132
-        $this->log(LogLevel::DEBUG, $message, $context);
132
+        $this->log( LogLevel::DEBUG, $message, $context );
133 133
     }
134 134
 }
Please login to merge, or discard this patch.
vendor/psr/log/Psr/Log/LoggerAwareInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,5 +20,5 @@
 block discarded – undo
20 20
      *
21 21
      * @return void
22 22
      */
23
-    public function setLogger(LoggerInterface $logger);
23
+    public function setLogger( LoggerInterface $logger );
24 24
 }
Please login to merge, or discard this patch.
vendor/psr/log/Psr/Log/Test/TestLogger.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -65,14 +65,14 @@  discard block
 block discarded – undo
65 65
     /**
66 66
      * @var array
67 67
      */
68
-    public $records = [];
68
+    public $records = [ ];
69 69
 
70
-    public $recordsByLevel = [];
70
+    public $recordsByLevel = [ ];
71 71
 
72 72
     /**
73 73
      * @inheritdoc
74 74
      */
75
-    public function log($level, $message, array $context = [])
75
+    public function log( $level, $message, array $context = [ ] )
76 76
     {
77 77
         $record = [
78 78
             'level' => $level,
@@ -80,74 +80,74 @@  discard block
 block discarded – undo
80 80
             'context' => $context,
81 81
         ];
82 82
 
83
-        $this->recordsByLevel[$record['level']][] = $record;
84
-        $this->records[] = $record;
83
+        $this->recordsByLevel[ $record[ 'level' ] ][ ] = $record;
84
+        $this->records[ ] = $record;
85 85
     }
86 86
 
87
-    public function hasRecords($level)
87
+    public function hasRecords( $level )
88 88
     {
89
-        return isset($this->recordsByLevel[$level]);
89
+        return isset( $this->recordsByLevel[ $level ] );
90 90
     }
91 91
 
92
-    public function hasRecord($record, $level)
92
+    public function hasRecord( $record, $level )
93 93
     {
94
-        if (is_string($record)) {
95
-            $record = ['message' => $record];
94
+        if ( is_string( $record ) ) {
95
+            $record = [ 'message' => $record ];
96 96
         }
97
-        return $this->hasRecordThatPasses(function ($rec) use ($record) {
98
-            if ($rec['message'] !== $record['message']) {
97
+        return $this->hasRecordThatPasses( function( $rec ) use ( $record ) {
98
+            if ( $rec[ 'message' ] !== $record[ 'message' ] ) {
99 99
                 return false;
100 100
             }
101
-            if (isset($record['context']) && $rec['context'] !== $record['context']) {
101
+            if ( isset( $record[ 'context' ] ) && $rec[ 'context' ] !== $record[ 'context' ] ) {
102 102
                 return false;
103 103
             }
104 104
             return true;
105
-        }, $level);
105
+        }, $level );
106 106
     }
107 107
 
108
-    public function hasRecordThatContains($message, $level)
108
+    public function hasRecordThatContains( $message, $level )
109 109
     {
110
-        return $this->hasRecordThatPasses(function ($rec) use ($message) {
111
-            return strpos($rec['message'], $message) !== false;
112
-        }, $level);
110
+        return $this->hasRecordThatPasses( function( $rec ) use ( $message ) {
111
+            return strpos( $rec[ 'message' ], $message ) !== false;
112
+        }, $level );
113 113
     }
114 114
 
115
-    public function hasRecordThatMatches($regex, $level)
115
+    public function hasRecordThatMatches( $regex, $level )
116 116
     {
117
-        return $this->hasRecordThatPasses(function ($rec) use ($regex) {
118
-            return preg_match($regex, $rec['message']) > 0;
119
-        }, $level);
117
+        return $this->hasRecordThatPasses( function( $rec ) use ( $regex ) {
118
+            return preg_match( $regex, $rec[ 'message' ] ) > 0;
119
+        }, $level );
120 120
     }
121 121
 
122
-    public function hasRecordThatPasses(callable $predicate, $level)
122
+    public function hasRecordThatPasses( callable $predicate, $level )
123 123
     {
124
-        if (!isset($this->recordsByLevel[$level])) {
124
+        if ( ! isset( $this->recordsByLevel[ $level ] ) ) {
125 125
             return false;
126 126
         }
127
-        foreach ($this->recordsByLevel[$level] as $i => $rec) {
128
-            if (call_user_func($predicate, $rec, $i)) {
127
+        foreach ( $this->recordsByLevel[ $level ] as $i => $rec ) {
128
+            if ( call_user_func( $predicate, $rec, $i ) ) {
129 129
                 return true;
130 130
             }
131 131
         }
132 132
         return false;
133 133
     }
134 134
 
135
-    public function __call($method, $args)
135
+    public function __call( $method, $args )
136 136
     {
137
-        if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) {
138
-            $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3];
139
-            $level = strtolower($matches[2]);
140
-            if (method_exists($this, $genericMethod)) {
141
-                $args[] = $level;
142
-                return call_user_func_array([$this, $genericMethod], $args);
137
+        if ( preg_match( '/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches ) > 0 ) {
138
+            $genericMethod = $matches[ 1 ] . ( 'Records' !== $matches[ 3 ] ? 'Record' : '' ) . $matches[ 3 ];
139
+            $level = strtolower( $matches[ 2 ] );
140
+            if ( method_exists( $this, $genericMethod ) ) {
141
+                $args[ ] = $level;
142
+                return call_user_func_array( [ $this, $genericMethod ], $args );
143 143
             }
144 144
         }
145
-        throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()');
145
+        throw new \BadMethodCallException( 'Call to undefined method ' . get_class( $this ) . '::' . $method . '()' );
146 146
     }
147 147
 
148 148
     public function reset()
149 149
     {
150
-        $this->records = [];
151
-        $this->recordsByLevel = [];
150
+        $this->records = [ ];
151
+        $this->recordsByLevel = [ ];
152 152
     }
153 153
 }
Please login to merge, or discard this patch.
trustedlogin/trustedlogin/client/src/Client.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 namespace GravityView\TrustedLogin;
25 25
 
26 26
 // Exit if accessed directly
27
-if ( ! defined('ABSPATH') ) {
27
+if ( ! defined( 'ABSPATH' ) ) {
28 28
 	exit;
29 29
 }
30 30
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 		$ns = $config->ns();
160 160
 
161 161
 		// Namespace isn't set; allow Config
162
-		if( empty( $ns ) ) {
162
+		if ( empty( $ns ) ) {
163 163
 			return true;
164 164
 		}
165 165
 
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 			return $created;
344 344
 		}
345 345
 
346
-		$return_data['timing']['remote'] = timer_stop( 0, 5 );
346
+		$return_data[ 'timing' ][ 'remote' ] = timer_stop( 0, 5 );
347 347
 
348 348
 		do_action( 'trustedlogin/' . $this->config->ns() . '/access/created', array(
349 349
 			'url'    => get_site_url(),
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 			return $updated;
448 448
 		}
449 449
 
450
-		$return_data['timing']['remote'] = timer_stop( 0, 5 );
450
+		$return_data[ 'timing' ][ 'remote' ] = timer_stop( 0, 5 );
451 451
 
452 452
 		do_action( 'trustedlogin/' . $this->config->ns() . '/access/extended', array(
453 453
 			'url'    => get_site_url(),
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 		$reference_id = self::get_reference_id();
544 544
 
545 545
 		if ( $reference_id ) {
546
-			$metadata['reference_id'] = $reference_id;
546
+			$metadata[ 'reference_id' ] = $reference_id;
547 547
 		}
548 548
 
549 549
 		return $metadata;
@@ -558,12 +558,12 @@  discard block
 block discarded – undo
558 558
 	 */
559 559
 	public static function get_reference_id() {
560 560
 
561
-		if ( isset( $_REQUEST['reference_id'] ) ) {
562
-			return esc_html( $_REQUEST['reference_id'] );
561
+		if ( isset( $_REQUEST[ 'reference_id' ] ) ) {
562
+			return esc_html( $_REQUEST[ 'reference_id' ] );
563 563
 		}
564 564
 
565
-		if ( isset( $_REQUEST['ref'] ) ) {
566
-			return esc_html( $_REQUEST['ref'] );
565
+		if ( isset( $_REQUEST[ 'ref' ] ) ) {
566
+			return esc_html( $_REQUEST[ 'ref' ] );
567 567
 		}
568 568
 
569 569
 		return null;
Please login to merge, or discard this patch.
trustedlogin/trustedlogin/client/src/SupportRole.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 namespace GravityView\TrustedLogin;
14 14
 
15 15
 // Exit if accessed directly
16
-if ( ! defined('ABSPATH') ) {
16
+if ( ! defined( 'ABSPATH' ) ) {
17 17
 	exit;
18 18
 }
19 19
 
@@ -72,14 +72,14 @@  discard block
 block discarded – undo
72 72
 		// TODO: Support multiple roles
73 73
 		$role = is_array( $roles ) ? array_key_first( $roles ) : $roles;
74 74
 
75
-		return (string) $role;
75
+		return (string)$role;
76 76
 	}
77 77
 
78 78
 	/**
79 79
 	 * @return string
80 80
 	 */
81 81
 	public function get_name() {
82
-		return (string) $this->role_name;
82
+		return (string)$this->role_name;
83 83
 	}
84 84
 
85 85
 	/**
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 
151 151
 		$add_caps = $this->config->get_setting( 'caps/add' );
152 152
 
153
-		foreach ( (array) $add_caps as $add_cap => $reason ) {
153
+		foreach ( (array)$add_caps as $add_cap => $reason ) {
154 154
 			$capabilities[ $add_cap ] = true;
155 155
 		}
156 156
 
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 
167 167
 		$new_role = add_role( $new_role_slug, $role_display_name, $capabilities );
168 168
 
169
-		if ( ! $new_role ){
169
+		if ( ! $new_role ) {
170 170
 
171 171
 			return new WP_Error(
172 172
 				'add_role_failed',
@@ -181,11 +181,11 @@  discard block
 block discarded – undo
181 181
 
182 182
 		$remove_caps = $this->config->get_setting( 'caps/remove' );
183 183
 
184
-		if ( ! empty( $remove_caps ) ){
184
+		if ( ! empty( $remove_caps ) ) {
185 185
 
186
-			foreach ( $remove_caps as $remove_cap => $description ){
186
+			foreach ( $remove_caps as $remove_cap => $description ) {
187 187
 				$new_role->remove_cap( $remove_cap );
188
-				$this->logging->log( 'Capability '. $remove_cap .' removed from role.', __METHOD__, 'info' );
188
+				$this->logging->log( 'Capability ' . $remove_cap . ' removed from role.', __METHOD__, 'info' );
189 189
 			}
190 190
 		}
191 191
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 		// Returns void; no way to tell if successful
205 205
 		remove_role( $this->get_name() );
206 206
 
207
-		if( get_role( $this->get_name() ) ) {
207
+		if ( get_role( $this->get_name() ) ) {
208 208
 
209 209
 			$this->logging->log( "Role " . $this->get_name() . " was not removed successfully.", __METHOD__, 'error' );
210 210
 
Please login to merge, or discard this patch.
trustedlogin/trustedlogin/client/src/Logging.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 
69 69
 		$configured_logging_dir = $config->get_setting( 'logging/directory', '' );
70 70
 
71
-		if( ! empty( $configured_logging_dir ) ) {
71
+		if ( ! empty( $configured_logging_dir ) ) {
72 72
 
73 73
 			$logging_directory = $this->check_directory( $configured_logging_dir );
74 74
 
@@ -82,12 +82,12 @@  discard block
 block discarded – undo
82 82
 		}
83 83
 
84 84
 		// Directory cannot be found or created. Cannot log.
85
-		if( ! $logging_directory ) {
85
+		if ( ! $logging_directory ) {
86 86
 			return false;
87 87
 		}
88 88
 
89 89
 		// Directory cannot be written to
90
-		if( ! $this->check_directory( $logging_directory ) ) {
90
+		if ( ! $this->check_directory( $logging_directory ) ) {
91 91
 			return false;
92 92
 		}
93 93
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 
110 110
 			$options = wp_parse_args( $settings_options, $default_options );
111 111
 
112
-			$klogger = new Logger (
112
+			$klogger = new Logger(
113 113
 				$logging_directory,
114 114
 				$config->get_setting( 'logging/threshold', 'notice' ),
115 115
 				$options
@@ -134,21 +134,21 @@  discard block
 block discarded – undo
134 134
 	 */
135 135
 	private function check_directory( $dirpath ) {
136 136
 
137
-		$dirpath = (string) $dirpath;
137
+		$dirpath = (string)$dirpath;
138 138
 		$file_exists = file_exists( $dirpath );
139 139
 		$is_writable = wp_is_writable( $dirpath );
140 140
 
141 141
 		// If the configured setting path exists and is writeable, use it.
142
-		if( $file_exists && $is_writable ) {
142
+		if ( $file_exists && $is_writable ) {
143 143
 			return $dirpath;
144 144
 		}
145 145
 
146 146
 		// Otherwise, try and log default errors
147
-		if( ! $file_exists ) {
147
+		if ( ! $file_exists ) {
148 148
 			$this->log( 'The defined logging directory does not exist: ' . $dirpath, __METHOD__, 'error' );
149 149
 		}
150 150
 
151
-		if( ! $is_writable ) {
151
+		if ( ! $is_writable ) {
152 152
 			$this->log( 'The defined logging directory exists but could not be written to: ' . $dirpath, __METHOD__, 'error' );
153 153
 		}
154 154
 
@@ -166,10 +166,10 @@  discard block
 block discarded – undo
166 166
 
167 167
 		$upload_dir = wp_upload_dir();
168 168
 
169
-		$log_dir = trailingslashit( $upload_dir['basedir'] ) . self::DIRECTORY_PATH;
169
+		$log_dir = trailingslashit( $upload_dir[ 'basedir' ] ) . self::DIRECTORY_PATH;
170 170
 
171 171
 		// Directory exists; return early
172
-		if( file_exists( $log_dir ) ) {
172
+		if ( file_exists( $log_dir ) ) {
173 173
 
174 174
 			$this->prevent_directory_browsing( $log_dir );
175 175
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 		$folder_created = wp_mkdir_p( $log_dir );
181 181
 
182 182
 		// Something went wrong mapping the directory
183
-		if( ! $folder_created ) {
183
+		if ( ! $folder_created ) {
184 184
 			$this->log( 'The log directory could not be created: ' . $log_dir, __METHOD__, 'error' );
185 185
 			return false;
186 186
 		}
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 		 */
242 242
 		$is_enabled = apply_filters( 'trustedlogin/' . $this->ns . '/logging/enabled', $is_enabled );
243 243
 
244
-		return (bool) $is_enabled;
244
+		return (bool)$is_enabled;
245 245
 	}
246 246
 
247 247
 	/**
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 			return;
320 320
 		}
321 321
 
322
-		$this->klogger->{$level}( $log_message, (array) $data );
322
+		$this->klogger->{$level}( $log_message, (array)$data );
323 323
 	}
324 324
 
325 325
 }
Please login to merge, or discard this patch.