@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | /** @var WP_Admin_Bar $wp_admin_bar */ |
| 39 | 39 | global $wp_admin_bar; |
| 40 | 40 | |
| 41 | - if( is_admin() || ! GVCommon::has_cap( array( 'edit_gravityviews', 'gravityview_edit_entry', 'gravityforms_edit_forms' ) ) ) { |
|
| 41 | + if ( is_admin() || ! GVCommon::has_cap( array( 'edit_gravityviews', 'gravityview_edit_entry', 'gravityforms_edit_forms' ) ) ) { |
|
| 42 | 42 | return; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -110,9 +110,9 @@ discard block |
||
| 110 | 110 | 'parent' => 'gravityview', |
| 111 | 111 | 'title' => __( 'Edit Entry', 'gravityview' ), |
| 112 | 112 | 'meta' => array( |
| 113 | - 'title' => sprintf( __( 'Edit Entry %s', 'gravityview' ), GravityView_API::get_entry_slug( $entry['id'], $entry ) ), |
|
| 113 | + 'title' => sprintf( __( 'Edit Entry %s', 'gravityview' ), GravityView_API::get_entry_slug( $entry[ 'id' ], $entry ) ), |
|
| 114 | 114 | ), |
| 115 | - 'href' => esc_url_raw( admin_url( sprintf( 'admin.php?page=gf_entries&screen_mode=edit&view=entry&id=%d&lid=%d', $entry['form_id'], $entry['id'] ) ) ), |
|
| 115 | + 'href' => esc_url_raw( admin_url( sprintf( 'admin.php?page=gf_entries&screen_mode=edit&view=entry&id=%d&lid=%d', $entry[ 'form_id' ], $entry[ 'id' ] ) ) ), |
|
| 116 | 116 | ) ); |
| 117 | 117 | |
| 118 | 118 | } |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | /** @var WP_Admin_Bar $wp_admin_bar */ |
| 129 | 129 | global $wp_admin_bar; |
| 130 | 130 | |
| 131 | - if( GVCommon::has_cap( array( 'edit_gravityviews', 'edit_gravityview', 'gravityforms_edit_forms' ) ) ) { |
|
| 131 | + if ( GVCommon::has_cap( array( 'edit_gravityviews', 'edit_gravityview', 'gravityforms_edit_forms' ) ) ) { |
|
| 132 | 132 | |
| 133 | 133 | if ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) ) { |
| 134 | 134 | $views = gravityview()->views->all(); |
@@ -152,21 +152,21 @@ discard block |
||
| 152 | 152 | $form_id = $view->form ? $view->form->ID : null; |
| 153 | 153 | } else { |
| 154 | 154 | /** Deprecated. */ |
| 155 | - $view_id = $view['id']; |
|
| 156 | - $form_id = $view['form_id']; |
|
| 155 | + $view_id = $view[ 'id' ]; |
|
| 156 | + $form_id = $view[ 'form_id' ]; |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | $edit_view_title = __( 'Edit View', 'gravityview' ); |
| 160 | 160 | $edit_form_title = __( 'Edit Form', 'gravityview' ); |
| 161 | 161 | |
| 162 | - if( sizeof( $views ) > 1 ) { |
|
| 162 | + if ( sizeof( $views ) > 1 ) { |
|
| 163 | 163 | $edit_view_title = sprintf( _x( 'Edit View #%d', 'Edit View with the ID of %d', 'gravityview' ), $view_id ); |
| 164 | 164 | $edit_form_title = sprintf( __( 'Edit Form #%d', 'Edit Form with the ID of %d', 'gravityview' ), $form_id ); |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - if( GVCommon::has_cap( 'edit_gravityview', $view_id ) && ! in_array( $view_id, $added_views ) ) { |
|
| 167 | + if ( GVCommon::has_cap( 'edit_gravityview', $view_id ) && ! in_array( $view_id, $added_views ) ) { |
|
| 168 | 168 | |
| 169 | - $added_views[] = $view_id; |
|
| 169 | + $added_views[ ] = $view_id; |
|
| 170 | 170 | |
| 171 | 171 | $wp_admin_bar->add_menu( array( |
| 172 | 172 | 'id' => 'edit-view-' . $view_id, |
@@ -176,9 +176,9 @@ discard block |
||
| 176 | 176 | ) ); |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | - if ( ! empty( $form_id ) && GVCommon::has_cap( array( 'gravityforms_edit_forms' ), $form_id ) && ! in_array( $form_id, $added_forms ) ) { |
|
| 179 | + if ( ! empty( $form_id ) && GVCommon::has_cap( array( 'gravityforms_edit_forms' ), $form_id ) && ! in_array( $form_id, $added_forms ) ) { |
|
| 180 | 180 | |
| 181 | - $added_forms[] = $form_id; |
|
| 181 | + $added_forms[ ] = $form_id; |
|
| 182 | 182 | |
| 183 | 183 | $wp_admin_bar->add_menu( array( |
| 184 | 184 | 'id' => 'edit-form-' . $form_id, |
@@ -129,12 +129,12 @@ |
||
| 129 | 129 | |
| 130 | 130 | /** Let's find us some [gravityview] shortcodes perhaps. */ |
| 131 | 131 | foreach ( Shortcode::parse( $content ) as $shortcode ) { |
| 132 | - if ( $shortcode->name != 'gravityview' || empty( $shortcode->atts['id'] ) ) { |
|
| 132 | + if ( $shortcode->name != 'gravityview' || empty( $shortcode->atts[ 'id' ] ) ) { |
|
| 133 | 133 | continue; |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - if ( is_numeric( $shortcode->atts['id'] ) ) { |
|
| 137 | - $view = View::by_id( $shortcode->atts['id'] ); |
|
| 136 | + if ( is_numeric( $shortcode->atts[ 'id' ] ) ) { |
|
| 137 | + $view = View::by_id( $shortcode->atts[ 'id' ] ); |
|
| 138 | 138 | if ( ! $view ) { |
| 139 | 139 | continue; |
| 140 | 140 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * @return void |
| 26 | 26 | */ |
| 27 | 27 | public function add( $value ) { |
| 28 | - $this->storage []= $value; |
|
| 28 | + $this->storage [ ] = $value; |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | * @return void |
| 50 | 50 | */ |
| 51 | 51 | public function merge( \GV\Collection $collection ) { |
| 52 | - array_map( array( $this, 'add'), $collection->all() ); |
|
| 52 | + array_map( array( $this, 'add' ), $collection->all() ); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | protected function log( $level, $message, $context ) { |
| 29 | 29 | |
| 30 | 30 | $backtrace = debug_backtrace(); |
| 31 | - $location = $this->interpolate( "{class}{type}{function}", $backtrace[2] ); |
|
| 31 | + $location = $this->interpolate( "{class}{type}{function}", $backtrace[ 2 ] ); |
|
| 32 | 32 | |
| 33 | 33 | $message = $this->interpolate( "[$level, $location] $message", $context ); |
| 34 | 34 | |
@@ -52,14 +52,14 @@ discard block |
||
| 52 | 52 | do_action( |
| 53 | 53 | sprintf( 'gravityview_log_%s_test', $action ), |
| 54 | 54 | $this->interpolate( $message, $context ), |
| 55 | - empty( $context['data'] ) ? array() : $context['data'] |
|
| 55 | + empty( $context[ 'data' ] ) ? array() : $context[ 'data' ] |
|
| 56 | 56 | ); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | do_action( |
| 60 | 60 | sprintf( 'gravityview_log_%s', $action ), |
| 61 | 61 | $this->interpolate( $message, $context ), |
| 62 | - empty( $context['data'] ) ? array() : $context['data'] |
|
| 62 | + empty( $context[ 'data' ] ) ? array() : $context[ 'data' ] |
|
| 63 | 63 | ); |
| 64 | 64 | } |
| 65 | 65 | } |
@@ -10,14 +10,14 @@ discard block |
||
| 10 | 10 | * Describes log levels. |
| 11 | 11 | */ |
| 12 | 12 | class LogLevel { |
| 13 | - const EMERGENCY = 'emergency'; |
|
| 14 | - const ALERT = 'alert'; |
|
| 15 | - const CRITICAL = 'critical'; |
|
| 16 | - const ERROR = 'error'; |
|
| 17 | - const WARNING = 'warning'; |
|
| 18 | - const NOTICE = 'notice'; |
|
| 19 | - const INFO = 'info'; |
|
| 20 | - const DEBUG = 'debug'; |
|
| 13 | + const EMERGENCY = 'emergency'; |
|
| 14 | + const ALERT = 'alert'; |
|
| 15 | + const CRITICAL = 'critical'; |
|
| 16 | + const ERROR = 'error'; |
|
| 17 | + const WARNING = 'warning'; |
|
| 18 | + const NOTICE = 'notice'; |
|
| 19 | + const INFO = 'info'; |
|
| 20 | + const DEBUG = 'debug'; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -28,127 +28,127 @@ discard block |
||
| 28 | 28 | * @see https://github.com/php-fig/log/blob/master/Psr/Log/AbstractLogger.php |
| 29 | 29 | */ |
| 30 | 30 | abstract class Logger /** @todo extends Psr\Log\AbstractLogger */ { |
| 31 | - /** |
|
| 32 | - * System is unusable. |
|
| 33 | - * |
|
| 34 | - * @param string $message |
|
| 35 | - * @param array $context |
|
| 36 | - * |
|
| 37 | - * @return void |
|
| 38 | - */ |
|
| 39 | - public function emergency($message, array $context = array()) |
|
| 40 | - { |
|
| 41 | - $this->log(LogLevel::EMERGENCY, $message, $context); |
|
| 42 | - } |
|
| 31 | + /** |
|
| 32 | + * System is unusable. |
|
| 33 | + * |
|
| 34 | + * @param string $message |
|
| 35 | + * @param array $context |
|
| 36 | + * |
|
| 37 | + * @return void |
|
| 38 | + */ |
|
| 39 | + public function emergency($message, array $context = array()) |
|
| 40 | + { |
|
| 41 | + $this->log(LogLevel::EMERGENCY, $message, $context); |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | - /** |
|
| 45 | - * Action must be taken immediately. |
|
| 46 | - * |
|
| 47 | - * Example: Entire website down, database unavailable, etc. This should |
|
| 48 | - * trigger the SMS alerts and wake you up. |
|
| 49 | - * |
|
| 50 | - * @param string $message |
|
| 51 | - * @param array $context |
|
| 52 | - * |
|
| 53 | - * @return void |
|
| 54 | - */ |
|
| 55 | - public function alert($message, array $context = array()) |
|
| 56 | - { |
|
| 57 | - $this->log(LogLevel::ALERT, $message, $context); |
|
| 58 | - } |
|
| 44 | + /** |
|
| 45 | + * Action must be taken immediately. |
|
| 46 | + * |
|
| 47 | + * Example: Entire website down, database unavailable, etc. This should |
|
| 48 | + * trigger the SMS alerts and wake you up. |
|
| 49 | + * |
|
| 50 | + * @param string $message |
|
| 51 | + * @param array $context |
|
| 52 | + * |
|
| 53 | + * @return void |
|
| 54 | + */ |
|
| 55 | + public function alert($message, array $context = array()) |
|
| 56 | + { |
|
| 57 | + $this->log(LogLevel::ALERT, $message, $context); |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - /** |
|
| 61 | - * Critical conditions. |
|
| 62 | - * |
|
| 63 | - * Example: Application component unavailable, unexpected exception. |
|
| 64 | - * |
|
| 65 | - * @param string $message |
|
| 66 | - * @param array $context |
|
| 67 | - * |
|
| 68 | - * @return void |
|
| 69 | - */ |
|
| 70 | - public function critical($message, array $context = array()) |
|
| 71 | - { |
|
| 72 | - $this->log(LogLevel::CRITICAL, $message, $context); |
|
| 73 | - } |
|
| 60 | + /** |
|
| 61 | + * Critical conditions. |
|
| 62 | + * |
|
| 63 | + * Example: Application component unavailable, unexpected exception. |
|
| 64 | + * |
|
| 65 | + * @param string $message |
|
| 66 | + * @param array $context |
|
| 67 | + * |
|
| 68 | + * @return void |
|
| 69 | + */ |
|
| 70 | + public function critical($message, array $context = array()) |
|
| 71 | + { |
|
| 72 | + $this->log(LogLevel::CRITICAL, $message, $context); |
|
| 73 | + } |
|
| 74 | 74 | |
| 75 | - /** |
|
| 76 | - * Runtime errors that do not require immediate action but should typically |
|
| 77 | - * be logged and monitored. |
|
| 78 | - * |
|
| 79 | - * @param string $message |
|
| 80 | - * @param array $context |
|
| 81 | - * |
|
| 82 | - * @return void |
|
| 83 | - */ |
|
| 84 | - public function error($message, array $context = array()) |
|
| 85 | - { |
|
| 86 | - $this->log(LogLevel::ERROR, $message, $context); |
|
| 87 | - } |
|
| 75 | + /** |
|
| 76 | + * Runtime errors that do not require immediate action but should typically |
|
| 77 | + * be logged and monitored. |
|
| 78 | + * |
|
| 79 | + * @param string $message |
|
| 80 | + * @param array $context |
|
| 81 | + * |
|
| 82 | + * @return void |
|
| 83 | + */ |
|
| 84 | + public function error($message, array $context = array()) |
|
| 85 | + { |
|
| 86 | + $this->log(LogLevel::ERROR, $message, $context); |
|
| 87 | + } |
|
| 88 | 88 | |
| 89 | - /** |
|
| 90 | - * Exceptional occurrences that are not errors. |
|
| 91 | - * |
|
| 92 | - * Example: Use of deprecated APIs, poor use of an API, undesirable things |
|
| 93 | - * that are not necessarily wrong. |
|
| 94 | - * |
|
| 95 | - * @param string $message |
|
| 96 | - * @param array $context |
|
| 97 | - * |
|
| 98 | - * @return void |
|
| 99 | - */ |
|
| 100 | - public function warning($message, array $context = array()) |
|
| 101 | - { |
|
| 102 | - $this->log(LogLevel::WARNING, $message, $context); |
|
| 103 | - } |
|
| 89 | + /** |
|
| 90 | + * Exceptional occurrences that are not errors. |
|
| 91 | + * |
|
| 92 | + * Example: Use of deprecated APIs, poor use of an API, undesirable things |
|
| 93 | + * that are not necessarily wrong. |
|
| 94 | + * |
|
| 95 | + * @param string $message |
|
| 96 | + * @param array $context |
|
| 97 | + * |
|
| 98 | + * @return void |
|
| 99 | + */ |
|
| 100 | + public function warning($message, array $context = array()) |
|
| 101 | + { |
|
| 102 | + $this->log(LogLevel::WARNING, $message, $context); |
|
| 103 | + } |
|
| 104 | 104 | |
| 105 | - /** |
|
| 106 | - * Normal but significant events. |
|
| 107 | - * |
|
| 108 | - * @param string $message |
|
| 109 | - * @param array $context |
|
| 110 | - * |
|
| 111 | - * @return void |
|
| 112 | - */ |
|
| 113 | - public function notice($message, array $context = array()) |
|
| 114 | - { |
|
| 115 | - $this->log(LogLevel::NOTICE, $message, $context); |
|
| 116 | - } |
|
| 105 | + /** |
|
| 106 | + * Normal but significant events. |
|
| 107 | + * |
|
| 108 | + * @param string $message |
|
| 109 | + * @param array $context |
|
| 110 | + * |
|
| 111 | + * @return void |
|
| 112 | + */ |
|
| 113 | + public function notice($message, array $context = array()) |
|
| 114 | + { |
|
| 115 | + $this->log(LogLevel::NOTICE, $message, $context); |
|
| 116 | + } |
|
| 117 | 117 | |
| 118 | - /** |
|
| 119 | - * Interesting events. |
|
| 120 | - * |
|
| 121 | - * Example: User logs in, SQL logs. |
|
| 122 | - * |
|
| 123 | - * @param string $message |
|
| 124 | - * @param array $context |
|
| 125 | - * |
|
| 126 | - * @return void |
|
| 127 | - */ |
|
| 128 | - public function info($message, array $context = array()) |
|
| 129 | - { |
|
| 130 | - $this->log(LogLevel::INFO, $message, $context); |
|
| 131 | - } |
|
| 118 | + /** |
|
| 119 | + * Interesting events. |
|
| 120 | + * |
|
| 121 | + * Example: User logs in, SQL logs. |
|
| 122 | + * |
|
| 123 | + * @param string $message |
|
| 124 | + * @param array $context |
|
| 125 | + * |
|
| 126 | + * @return void |
|
| 127 | + */ |
|
| 128 | + public function info($message, array $context = array()) |
|
| 129 | + { |
|
| 130 | + $this->log(LogLevel::INFO, $message, $context); |
|
| 131 | + } |
|
| 132 | 132 | |
| 133 | - /** |
|
| 134 | - * Detailed debug information. |
|
| 135 | - * |
|
| 136 | - * @param string $message |
|
| 137 | - * @param array $context |
|
| 138 | - * |
|
| 139 | - * @return void |
|
| 140 | - */ |
|
| 141 | - public function debug($message, array $context = array()) |
|
| 142 | - { |
|
| 143 | - $this->log(LogLevel::DEBUG, $message, $context); |
|
| 144 | - } |
|
| 133 | + /** |
|
| 134 | + * Detailed debug information. |
|
| 135 | + * |
|
| 136 | + * @param string $message |
|
| 137 | + * @param array $context |
|
| 138 | + * |
|
| 139 | + * @return void |
|
| 140 | + */ |
|
| 141 | + public function debug($message, array $context = array()) |
|
| 142 | + { |
|
| 143 | + $this->log(LogLevel::DEBUG, $message, $context); |
|
| 144 | + } |
|
| 145 | 145 | |
| 146 | 146 | /** |
| 147 | 147 | * Bake the context into { } placeholders in the message. |
| 148 | - * @param string $message |
|
| 149 | - * @param array $context |
|
| 150 | - * |
|
| 151 | - * @return string The baked message; |
|
| 148 | + * @param string $message |
|
| 149 | + * @param array $context |
|
| 150 | + * |
|
| 151 | + * @return string The baked message; |
|
| 152 | 152 | */ |
| 153 | 153 | protected function interpolate( $message, $context ) { |
| 154 | 154 | foreach ( $context as $key => $val ) { |
@@ -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 | /** |
@@ -36,8 +36,7 @@ discard block |
||
| 36 | 36 | * |
| 37 | 37 | * @return void |
| 38 | 38 | */ |
| 39 | - public function emergency($message, array $context = array()) |
|
| 40 | - { |
|
| 39 | + public function emergency($message, array $context = array()) { |
|
| 41 | 40 | $this->log(LogLevel::EMERGENCY, $message, $context); |
| 42 | 41 | } |
| 43 | 42 | |
@@ -52,8 +51,7 @@ discard block |
||
| 52 | 51 | * |
| 53 | 52 | * @return void |
| 54 | 53 | */ |
| 55 | - public function alert($message, array $context = array()) |
|
| 56 | - { |
|
| 54 | + public function alert($message, array $context = array()) { |
|
| 57 | 55 | $this->log(LogLevel::ALERT, $message, $context); |
| 58 | 56 | } |
| 59 | 57 | |
@@ -67,8 +65,7 @@ discard block |
||
| 67 | 65 | * |
| 68 | 66 | * @return void |
| 69 | 67 | */ |
| 70 | - public function critical($message, array $context = array()) |
|
| 71 | - { |
|
| 68 | + public function critical($message, array $context = array()) { |
|
| 72 | 69 | $this->log(LogLevel::CRITICAL, $message, $context); |
| 73 | 70 | } |
| 74 | 71 | |
@@ -81,8 +78,7 @@ discard block |
||
| 81 | 78 | * |
| 82 | 79 | * @return void |
| 83 | 80 | */ |
| 84 | - public function error($message, array $context = array()) |
|
| 85 | - { |
|
| 81 | + public function error($message, array $context = array()) { |
|
| 86 | 82 | $this->log(LogLevel::ERROR, $message, $context); |
| 87 | 83 | } |
| 88 | 84 | |
@@ -97,8 +93,7 @@ discard block |
||
| 97 | 93 | * |
| 98 | 94 | * @return void |
| 99 | 95 | */ |
| 100 | - public function warning($message, array $context = array()) |
|
| 101 | - { |
|
| 96 | + public function warning($message, array $context = array()) { |
|
| 102 | 97 | $this->log(LogLevel::WARNING, $message, $context); |
| 103 | 98 | } |
| 104 | 99 | |
@@ -110,8 +105,7 @@ discard block |
||
| 110 | 105 | * |
| 111 | 106 | * @return void |
| 112 | 107 | */ |
| 113 | - public function notice($message, array $context = array()) |
|
| 114 | - { |
|
| 108 | + public function notice($message, array $context = array()) { |
|
| 115 | 109 | $this->log(LogLevel::NOTICE, $message, $context); |
| 116 | 110 | } |
| 117 | 111 | |
@@ -125,8 +119,7 @@ discard block |
||
| 125 | 119 | * |
| 126 | 120 | * @return void |
| 127 | 121 | */ |
| 128 | - public function info($message, array $context = array()) |
|
| 129 | - { |
|
| 122 | + public function info($message, array $context = array()) { |
|
| 130 | 123 | $this->log(LogLevel::INFO, $message, $context); |
| 131 | 124 | } |
| 132 | 125 | |
@@ -138,8 +131,7 @@ discard block |
||
| 138 | 131 | * |
| 139 | 132 | * @return void |
| 140 | 133 | */ |
| 141 | - public function debug($message, array $context = array()) |
|
| 142 | - { |
|
| 134 | + public function debug($message, array $context = array()) { |
|
| 143 | 135 | $this->log(LogLevel::DEBUG, $message, $context); |
| 144 | 136 | } |
| 145 | 137 | |
@@ -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 | /** |