@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | * |
37 | 37 | * @return void |
38 | 38 | */ |
39 | - public function emergency($message, array $context = array()) |
|
39 | + public function emergency( $message, array $context = array() ) |
|
40 | 40 | { |
41 | - $this->log(LogLevel::EMERGENCY, $message, $context); |
|
41 | + $this->log( LogLevel::EMERGENCY, $message, $context ); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | * |
53 | 53 | * @return void |
54 | 54 | */ |
55 | - public function alert($message, array $context = array()) |
|
55 | + public function alert( $message, array $context = array() ) |
|
56 | 56 | { |
57 | - $this->log(LogLevel::ALERT, $message, $context); |
|
57 | + $this->log( LogLevel::ALERT, $message, $context ); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -67,9 +67,9 @@ discard block |
||
67 | 67 | * |
68 | 68 | * @return void |
69 | 69 | */ |
70 | - public function critical($message, array $context = array()) |
|
70 | + public function critical( $message, array $context = array() ) |
|
71 | 71 | { |
72 | - $this->log(LogLevel::CRITICAL, $message, $context); |
|
72 | + $this->log( LogLevel::CRITICAL, $message, $context ); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | * |
82 | 82 | * @return void |
83 | 83 | */ |
84 | - public function error($message, array $context = array()) |
|
84 | + public function error( $message, array $context = array() ) |
|
85 | 85 | { |
86 | - $this->log(LogLevel::ERROR, $message, $context); |
|
86 | + $this->log( LogLevel::ERROR, $message, $context ); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
@@ -97,9 +97,9 @@ discard block |
||
97 | 97 | * |
98 | 98 | * @return void |
99 | 99 | */ |
100 | - public function warning($message, array $context = array()) |
|
100 | + public function warning( $message, array $context = array() ) |
|
101 | 101 | { |
102 | - $this->log(LogLevel::WARNING, $message, $context); |
|
102 | + $this->log( LogLevel::WARNING, $message, $context ); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -110,9 +110,9 @@ discard block |
||
110 | 110 | * |
111 | 111 | * @return void |
112 | 112 | */ |
113 | - public function notice($message, array $context = array()) |
|
113 | + public function notice( $message, array $context = array() ) |
|
114 | 114 | { |
115 | - $this->log(LogLevel::NOTICE, $message, $context); |
|
115 | + $this->log( LogLevel::NOTICE, $message, $context ); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
@@ -125,9 +125,9 @@ discard block |
||
125 | 125 | * |
126 | 126 | * @return void |
127 | 127 | */ |
128 | - public function info($message, array $context = array()) |
|
128 | + public function info( $message, array $context = array() ) |
|
129 | 129 | { |
130 | - $this->log(LogLevel::INFO, $message, $context); |
|
130 | + $this->log( LogLevel::INFO, $message, $context ); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -138,9 +138,9 @@ discard block |
||
138 | 138 | * |
139 | 139 | * @return void |
140 | 140 | */ |
141 | - public function debug($message, array $context = array()) |
|
141 | + public function debug( $message, array $context = array() ) |
|
142 | 142 | { |
143 | - $this->log(LogLevel::DEBUG, $message, $context); |
|
143 | + $this->log( LogLevel::DEBUG, $message, $context ); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @return void |
32 | 32 | */ |
33 | 33 | public function __set( $key, $value ) { |
34 | - $this->_context[$key] = $value; |
|
34 | + $this->_context[ $key ] = $value; |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @return mixed|null |
46 | 46 | */ |
47 | 47 | public function __get( $key ) { |
48 | - return isset( $this->_context[$key] ) ? $this->_context[$key] : null; |
|
48 | + return isset( $this->_context[ $key ] ) ? $this->_context[ $key ] : null; |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 |
@@ -55,10 +55,10 @@ |
||
55 | 55 | $search_criteria[ $key ] = $field_filters; |
56 | 56 | } |
57 | 57 | |
58 | - if ( ! empty( $b[ $key ]['mode'] ) ) { |
|
59 | - $search_criteria[ $key ]['mode' ] = $b[ $key ]['mode']; |
|
60 | - } else if ( ! empty( $a[ $key ]['mode'] ) ) { |
|
61 | - $search_criteria[ $key ]['mode' ] = $a[ $key ]['mode']; |
|
58 | + if ( ! empty( $b[ $key ][ 'mode' ] ) ) { |
|
59 | + $search_criteria[ $key ][ 'mode' ] = $b[ $key ][ 'mode' ]; |
|
60 | + } else if ( ! empty( $a[ $key ][ 'mode' ] ) ) { |
|
61 | + $search_criteria[ $key ][ 'mode' ] = $a[ $key ][ 'mode' ]; |
|
62 | 62 | } |
63 | 63 | break; |
64 | 64 | case 'start_date': |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * @return void |
27 | 27 | */ |
28 | 28 | public function set( $key, $value ) { |
29 | - $this->settings[$key] = $value; |
|
29 | + $this->settings[ $key ] = $value; |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * @return mixed|null |
41 | 41 | */ |
42 | 42 | public function get( $key, $default = null ) { |
43 | - return isset( $this->settings[$key] ) ? $this->settings[$key] : $default; |
|
43 | + return isset( $this->settings[ $key ] ) ? $this->settings[ $key ] : $default; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -144,19 +144,19 @@ |
||
144 | 144 | public function from_configuration( $configuration ) { |
145 | 145 | $configuration = wp_parse_args( $configuration, $this->as_configuration() ); |
146 | 146 | |
147 | - $this->ID = $configuration['id']; |
|
148 | - $this->label = $configuration['label']; |
|
149 | - $this->show_label = $configuration['show_label'] == '1'; |
|
150 | - $this->custom_label = $configuration['custom_label']; |
|
151 | - $this->custom_class = $configuration['custom_class']; |
|
152 | - $this->cap = $configuration['only_loggedin'] == '1' ? $configuration['only_loggedin_cap'] : ''; |
|
153 | - $this->search_filter = $configuration['search_filter'] == '1'; |
|
154 | - $this->show_as_link = $configuration['show_as_link'] == '1'; |
|
147 | + $this->ID = $configuration[ 'id' ]; |
|
148 | + $this->label = $configuration[ 'label' ]; |
|
149 | + $this->show_label = $configuration[ 'show_label' ] == '1'; |
|
150 | + $this->custom_label = $configuration[ 'custom_label' ]; |
|
151 | + $this->custom_class = $configuration[ 'custom_class' ]; |
|
152 | + $this->cap = $configuration[ 'only_loggedin' ] == '1' ? $configuration[ 'only_loggedin_cap' ] : ''; |
|
153 | + $this->search_filter = $configuration[ 'search_filter' ] == '1'; |
|
154 | + $this->show_as_link = $configuration[ 'show_as_link' ] == '1'; |
|
155 | 155 | |
156 | 156 | /** Shared among all field types (sort of). */ |
157 | 157 | $shared_configuration_keys = array( |
158 | 158 | 'id', 'label', 'show_label', 'custom_label', 'custom_class', |
159 | - 'only_loggedin' ,'only_loggedin_cap', 'search_filter', 'show_as_link', |
|
159 | + 'only_loggedin', 'only_loggedin_cap', 'search_filter', 'show_as_link', |
|
160 | 160 | ); |
161 | 161 | |
162 | 162 | /** Everything else goes into the properties for now. @todo subclasses! */ |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | public function set_template_data( array $data, $var_name = 'data' ) { |
118 | 118 | global $wp_query; |
119 | 119 | |
120 | - $wp_query->query_vars[ $var_name ] = (object) $data; |
|
120 | + $wp_query->query_vars[ $var_name ] = (object)$data; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
@@ -130,8 +130,8 @@ discard block |
||
130 | 130 | public function unset_template_data() { |
131 | 131 | global $wp_query; |
132 | 132 | |
133 | - if ( isset( $wp_query->query_vars['data'] ) ) { |
|
134 | - unset( $wp_query->query_vars['data'] ); |
|
133 | + if ( isset( $wp_query->query_vars[ 'data' ] ) ) { |
|
134 | + unset( $wp_query->query_vars[ 'data' ] ); |
|
135 | 135 | } |
136 | 136 | } |
137 | 137 | |
@@ -148,9 +148,9 @@ discard block |
||
148 | 148 | protected function get_template_file_names( $slug, $name ) { |
149 | 149 | $templates = array(); |
150 | 150 | if ( isset( $name ) ) { |
151 | - $templates[] = $slug . '-' . $name . '.php'; |
|
151 | + $templates[ ] = $slug . '-' . $name . '.php'; |
|
152 | 152 | } |
153 | - $templates[] = $slug . '.php'; |
|
153 | + $templates[ ] = $slug . '.php'; |
|
154 | 154 | |
155 | 155 | /** |
156 | 156 | * Allow template choices to be filtered. |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | $located = false; |
189 | 189 | |
190 | 190 | // Remove empty entries. |
191 | - $template_names = array_filter( (array) $template_names ); |
|
191 | + $template_names = array_filter( (array)$template_names ); |
|
192 | 192 | $template_paths = $this->get_template_paths(); |
193 | 193 | |
194 | 194 | // Try to find a template file. |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | |
234 | 234 | // Only add this conditionally, so non-child themes don't redundantly check active theme twice. |
235 | 235 | if ( is_child_theme() ) { |
236 | - $file_paths[1] = trailingslashit( get_stylesheet_directory() ) . $theme_directory; |
|
236 | + $file_paths[ 1 ] = trailingslashit( get_stylesheet_directory() ) . $theme_directory; |
|
237 | 237 | } |
238 | 238 | |
239 | 239 | /** |
@@ -5,7 +5,7 @@ |
||
5 | 5 | } |
6 | 6 | |
7 | 7 | /** The future branch of GravityView requires PHP 5.3+ namespaces and SPL. */ |
8 | -if ( version_compare( phpversion(), '5.3' , '<' ) ) { |
|
8 | +if ( version_compare( phpversion(), '5.3', '<' ) ) { |
|
9 | 9 | return false; |
10 | 10 | |
11 | 11 | /** Tests with a suppressed future. */ |
@@ -56,16 +56,16 @@ discard block |
||
56 | 56 | public static function add() { |
57 | 57 | $shortcode = new static(); |
58 | 58 | if ( shortcode_exists( $shortcode->name ) ) { |
59 | - if ( empty( self::$shortcodes[$shortcode->name] ) ) { |
|
59 | + if ( empty( self::$shortcodes[ $shortcode->name ] ) ) { |
|
60 | 60 | gravityview()->log->error( 'Shortcode [{shortcode}] has already been registered elsewhere.', array( 'shortcode' => $shortcode->name ) ); |
61 | 61 | return null; |
62 | 62 | } |
63 | 63 | } else { |
64 | 64 | add_shortcode( $shortcode->name, array( get_class( $shortcode ), 'callback' ) ); |
65 | - self::$shortcodes[$shortcode->name] = $shortcode; |
|
65 | + self::$shortcodes[ $shortcode->name ] = $shortcode; |
|
66 | 66 | } |
67 | 67 | |
68 | - return self::$shortcodes[$shortcode->name]; |
|
68 | + return self::$shortcodes[ $shortcode->name ]; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public static function remove() { |
79 | 79 | $shortcode = new static(); |
80 | - unset( self::$shortcodes[$shortcode->name] ); |
|
80 | + unset( self::$shortcodes[ $shortcode->name ] ); |
|
81 | 81 | remove_shortcode( $shortcode->name ); |
82 | 82 | } |
83 | 83 | |
@@ -109,14 +109,14 @@ discard block |
||
109 | 109 | preg_match_all( '/' . get_shortcode_regex() . '/', $content, $matches, PREG_SET_ORDER ); |
110 | 110 | |
111 | 111 | foreach ( $matches as $shortcode ) { |
112 | - $shortcode_name = $shortcode[2]; |
|
112 | + $shortcode_name = $shortcode[ 2 ]; |
|
113 | 113 | |
114 | - $shortcode_atts = shortcode_parse_atts( $shortcode[3] ); |
|
115 | - $shortcode_content = $shortcode[5]; |
|
114 | + $shortcode_atts = shortcode_parse_atts( $shortcode[ 3 ] ); |
|
115 | + $shortcode_content = $shortcode[ 5 ]; |
|
116 | 116 | |
117 | 117 | /** This is a registered GravityView shortcode. */ |
118 | - if ( !empty( self::$shortcodes[$shortcode_name] ) ) { |
|
119 | - $shortcode = clone self::$shortcodes[$shortcode_name]; |
|
118 | + if ( ! empty( self::$shortcodes[ $shortcode_name ] ) ) { |
|
119 | + $shortcode = clone self::$shortcodes[ $shortcode_name ]; |
|
120 | 120 | } else { |
121 | 121 | /** This is some generic shortcode. */ |
122 | 122 | $shortcode = new self; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $supports = array( 'title', 'revisions' ); |
87 | 87 | |
88 | 88 | if ( $is_hierarchical ) { |
89 | - $supports[] = 'page-attributes'; |
|
89 | + $supports[ ] = 'page-attributes'; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | if ( ! $view->form ) { |
198 | 198 | gravityview()->log->error( 'View #{view_id} tried attaching non-existent Form #{form_id} to it.', array( |
199 | 199 | 'view_id' => $view->ID, |
200 | - 'form_id' => $view->_gravityview_form_id ? : 0, |
|
200 | + 'form_id' => $view->_gravityview_form_id ?: 0, |
|
201 | 201 | ) ); |
202 | 202 | } |
203 | 203 | |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | |
336 | 336 | gravityview()->log->notice( 'This is a \GV\View object should not be accessed as an array.' ); |
337 | 337 | |
338 | - if ( ! isset( $this[$offset] ) ) { |
|
338 | + if ( ! isset( $this[ $offset ] ) ) { |
|
339 | 339 | return null; |
340 | 340 | } |
341 | 341 | |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | return $this->template ? $this->template->ID : null; |
354 | 354 | default: |
355 | 355 | /** @todo move the rest out and get rid of _data completely! */ |
356 | - return $this->_data[$offset]; |
|
356 | + return $this->_data[ $offset ]; |
|
357 | 357 | } |
358 | 358 | } |
359 | 359 | |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | array( 'form' => $this->form ? gravityview_get_form( $this->form->ID ) : null ), |
403 | 403 | array( 'atts' => $this->settings->as_atts() ), |
404 | 404 | array( 'fields' => $this->fields->by_visible()->as_configuration() ), |
405 | - array( 'template_id' => $this->template? $this->template->ID : null ), |
|
405 | + array( 'template_id' => $this->template ? $this->template->ID : null ), |
|
406 | 406 | $this->_data |
407 | 407 | ); |
408 | 408 | } |