@@ -47,11 +47,11 @@ discard block |
||
| 47 | 47 | function modify_entry_value_workflow_step( $output, $entry, $field_settings, $field ) { |
| 48 | 48 | |
| 49 | 49 | // If not set, the entry hasn't started a workflow |
| 50 | - $has_workflow_step = isset( $entry['workflow_step'] ); |
|
| 50 | + $has_workflow_step = isset( $entry[ 'workflow_step' ] ); |
|
| 51 | 51 | |
| 52 | - if( $has_workflow_step ) { |
|
| 52 | + if ( $has_workflow_step ) { |
|
| 53 | 53 | |
| 54 | - $GFlow = new Gravity_Flow_API( $entry['form_id'] ); |
|
| 54 | + $GFlow = new Gravity_Flow_API( $entry[ 'form_id' ] ); |
|
| 55 | 55 | |
| 56 | 56 | if ( $current_step = $GFlow->get_current_step( $entry ) ) { |
| 57 | 57 | $output = esc_html( $current_step->get_name() ); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | preg_match( '/workflow_step_status_(\d+)/', $key, $matches ); |
| 80 | 80 | |
| 81 | 81 | if ( ! empty( $matches ) ) { |
| 82 | - $workflow_step_id = intval( $matches[1] ); |
|
| 82 | + $workflow_step_id = intval( $matches[ 1 ] ); |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | return $workflow_step_id; |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | $return = $label; |
| 100 | 100 | |
| 101 | - if ( '' === $label && $workflow_step_id = $this->get_step_id_from_key( $field['field'] ) ) { |
|
| 101 | + if ( '' === $label && $workflow_step_id = $this->get_step_id_from_key( $field[ 'field' ] ) ) { |
|
| 102 | 102 | |
| 103 | 103 | $step = $this->get_workflow_step( $workflow_step_id ); |
| 104 | 104 | |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | $workflow_step = $GFlow->get_step( $workflow_step_id ); |
| 130 | 130 | |
| 131 | - if( ! $GFlow || ! $workflow_step ) { |
|
| 131 | + if ( ! $GFlow || ! $workflow_step ) { |
|
| 132 | 132 | return false; |
| 133 | 133 | } |
| 134 | 134 | |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | |
| 151 | 151 | foreach ( $search_fields as & $search_field ) { |
| 152 | 152 | |
| 153 | - if ( $this->name === $search_field['key'] ) { |
|
| 153 | + if ( $this->name === $search_field[ 'key' ] ) { |
|
| 154 | 154 | |
| 155 | 155 | $form_id = GravityView_View::getInstance()->getFormId(); |
| 156 | 156 | |
@@ -159,21 +159,21 @@ discard block |
||
| 159 | 159 | $choices = array(); |
| 160 | 160 | |
| 161 | 161 | foreach ( $workflow_steps as $step ) { |
| 162 | - $choices[] = array( |
|
| 162 | + $choices[ ] = array( |
|
| 163 | 163 | 'text' => $step->get_name(), |
| 164 | 164 | 'value' => $step->get_id(), |
| 165 | 165 | ); |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | - $search_field['choices'] = $choices; |
|
| 168 | + $search_field[ 'choices' ] = $choices; |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | // Workflow Step Statuses |
| 172 | - else if ( $workflow_step_id = $this->get_step_id_from_key( $search_field['key'] ) ) { |
|
| 172 | + else if ( $workflow_step_id = $this->get_step_id_from_key( $search_field[ 'key' ] ) ) { |
|
| 173 | 173 | |
| 174 | 174 | $status_key = sprintf( 'workflow_step_status_%d', $workflow_step_id ); |
| 175 | 175 | |
| 176 | - $search_field['choices'] = GravityView_Plugin_Hooks_Gravity_Flow::get_status_options( null, $status_key ); |
|
| 176 | + $search_field[ 'choices' ] = GravityView_Plugin_Hooks_Gravity_Flow::get_status_options( null, $status_key ); |
|
| 177 | 177 | } |
| 178 | 178 | } |
| 179 | 179 | |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | |
| 15 | 15 | var $is_numeric = true; |
| 16 | 16 | |
| 17 | - var $search_operators = array( 'is', 'isnot', 'starts_with', 'ends_with' ); |
|
| 17 | + var $search_operators = array( 'is', 'isnot', 'starts_with', 'ends_with' ); |
|
| 18 | 18 | |
| 19 | 19 | var $group = 'pricing'; |
| 20 | 20 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | function clear_product_info_cache( $form = array(), $entry_id = 0, $Edit_Entry_Render = null ) { |
| 51 | 51 | |
| 52 | - if( $this->should_hide_product_fields( $Edit_Entry_Render->entry ) ) { |
|
| 52 | + if ( $this->should_hide_product_fields( $Edit_Entry_Render->entry ) ) { |
|
| 53 | 53 | return; |
| 54 | 54 | } |
| 55 | 55 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * @see GVCommon::entry_has_transaction_data() |
| 102 | 102 | * @param boolean $hide_product_fields Whether to hide product fields in the editor. Uses $entry data to determine. |
| 103 | 103 | */ |
| 104 | - $hide_product_fields = (bool) apply_filters( 'gravityview/edit_entry/hide-product-fields', $has_transaction_data ); |
|
| 104 | + $hide_product_fields = (bool)apply_filters( 'gravityview/edit_entry/hide-product-fields', $has_transaction_data ); |
|
| 105 | 105 | |
| 106 | 106 | return $hide_product_fields; |
| 107 | 107 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | public function get_content( $output, $entry = array(), $field_settings = array(), $field = array() ) { |
| 60 | 60 | |
| 61 | 61 | /** Overridden by a template. */ |
| 62 | - if( ! empty( $field['field_path'] ) ) { return $output; } |
|
| 62 | + if ( ! empty( $field[ 'field_path' ] ) ) { return $output; } |
|
| 63 | 63 | |
| 64 | 64 | return $this->get_string_from_value( $output ); |
| 65 | 65 | } |
@@ -78,11 +78,11 @@ discard block |
||
| 78 | 78 | switch ( intval( $value ) ) { |
| 79 | 79 | case self::ONE_TIME_PAYMENT: |
| 80 | 80 | default: |
| 81 | - $return = __('One-Time Payment', 'gravityview'); |
|
| 81 | + $return = __( 'One-Time Payment', 'gravityview' ); |
|
| 82 | 82 | break; |
| 83 | 83 | |
| 84 | 84 | case self::SUBSCRIPTION: |
| 85 | - $return = __('Subscription', 'gravityview'); |
|
| 85 | + $return = __( 'Subscription', 'gravityview' ); |
|
| 86 | 86 | break; |
| 87 | 87 | } |
| 88 | 88 | |
@@ -40,7 +40,6 @@ |
||
| 40 | 40 | * Get the default date format for a field based on the field ID and the time format setting |
| 41 | 41 | * |
| 42 | 42 | * @since 1.16.4 |
| 43 | - |
|
| 44 | 43 | * @param string $date_format The Gravity Forms date format for the field. Default: "mdy" |
| 45 | 44 | * @param int $field_id The ID of the field. Used to figure out full date/day/month/year |
| 46 | 45 | * |
@@ -31,11 +31,11 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
| 33 | 33 | |
| 34 | - if( 'edit' === $context ) { |
|
| 34 | + if ( 'edit' === $context ) { |
|
| 35 | 35 | return $field_options; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - $this->add_field_support('date_display', $field_options ); |
|
| 38 | + $this->add_field_support( 'date_display', $field_options ); |
|
| 39 | 39 | |
| 40 | 40 | return $field_options; |
| 41 | 41 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $field_input_id = gravityview_get_input_id_from_id( $field_id ); |
| 84 | 84 | |
| 85 | 85 | $date_field_output = ''; |
| 86 | - switch( $field_input_id ) { |
|
| 86 | + switch ( $field_input_id ) { |
|
| 87 | 87 | case 1: |
| 88 | 88 | $date_field_output = \GV\Utils::get( $parsed_date, 'month' ); |
| 89 | 89 | break; |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | ?> |
| 14 | 14 | <label for="<?php echo $this->get_field_id(); ?>" class="<?php echo $this->get_label_class(); ?>"><?php |
| 15 | 15 | |
| 16 | - echo '<span class="gv-label">'.$this->get_field_label().'</span>'; |
|
| 16 | + echo '<span class="gv-label">' . $this->get_field_label() . '</span>'; |
|
| 17 | 17 | |
| 18 | 18 | echo $this->get_tooltip() . $this->get_field_desc(); |
| 19 | 19 | |
@@ -26,14 +26,14 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | function render_input( $override_input = null ) { |
| 28 | 28 | |
| 29 | - if( isset( $override_input ) ) { |
|
| 29 | + if ( isset( $override_input ) ) { |
|
| 30 | 30 | echo $override_input; |
| 31 | 31 | return; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | ?> |
| 35 | 35 | <select name="<?php echo esc_attr( $this->name ); ?>[]" id="<?php echo $this->get_field_id(); ?>" multiple="multiple"> |
| 36 | - <?php foreach( $this->field['options'] as $value => $label ) : ?> |
|
| 36 | + <?php foreach ( $this->field[ 'options' ] as $value => $label ) : ?> |
|
| 37 | 37 | <option value="<?php echo esc_attr( $value ); ?>" <?php selected( in_array( $value, (array)$this->value ), true, true ); ?>><?php echo esc_html( $label ); ?></option> |
| 38 | 38 | <?php endforeach; ?> |
| 39 | 39 | </select> |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | |
| 327 | - if( GFCommon::is_product_field( $field['type'] ) ){ |
|
| 327 | + if( GFCommon::is_product_field( $field['type'] ) ) { |
|
| 328 | 328 | $has_product_fields = true; |
| 329 | 329 | } |
| 330 | 330 | |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | |
| 385 | 385 | $fields = array(); |
| 386 | 386 | |
| 387 | - foreach ( $extra_fields as $key => $field ){ |
|
| 387 | + foreach ( $extra_fields as $key => $field ) { |
|
| 388 | 388 | if ( ! empty( $only_default_column ) && ! empty( $field['is_default_column'] ) ) { |
| 389 | 389 | $fields[ $key ] = array( 'label' => $field['label'], 'type' => 'entry_meta' ); |
| 390 | 390 | } |
@@ -978,7 +978,7 @@ discard block |
||
| 978 | 978 | $form = GFAPI::get_form( $form ); |
| 979 | 979 | } |
| 980 | 980 | |
| 981 | - if ( class_exists( 'GFFormsModel' ) ){ |
|
| 981 | + if ( class_exists( 'GFFormsModel' ) ) { |
|
| 982 | 982 | return GFFormsModel::get_field( $form, $field_id ); |
| 983 | 983 | } else { |
| 984 | 984 | return null; |
@@ -1025,7 +1025,7 @@ discard block |
||
| 1025 | 1025 | $shortcodes = array(); |
| 1026 | 1026 | |
| 1027 | 1027 | preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER ); |
| 1028 | - if ( empty( $matches ) ){ |
|
| 1028 | + if ( empty( $matches ) ) { |
|
| 1029 | 1029 | return false; |
| 1030 | 1030 | } |
| 1031 | 1031 | |
@@ -316,12 +316,12 @@ discard block |
||
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | /** |
| 319 | - * @hack |
|
| 320 | - * In case of email/email confirmation, the input for email has the same id as the parent field |
|
| 321 | - */ |
|
| 319 | + * @hack |
|
| 320 | + * In case of email/email confirmation, the input for email has the same id as the parent field |
|
| 321 | + */ |
|
| 322 | 322 | if( 'email' === $field['type'] && false === strpos( $input['id'], '.' ) ) { |
| 323 | - continue; |
|
| 324 | - } |
|
| 323 | + continue; |
|
| 324 | + } |
|
| 325 | 325 | $fields["{$input['id']}"] = array( |
| 326 | 326 | 'label' => \GV\Utils::get( $input, 'label' ), |
| 327 | 327 | 'customLabel' => \GV\Utils::get( $input, 'customLabel' ), |
@@ -1421,7 +1421,7 @@ discard block |
||
| 1421 | 1421 | ), |
| 1422 | 1422 | ); |
| 1423 | 1423 | |
| 1424 | - $fields = $date_created + $fields; |
|
| 1424 | + $fields = $date_created + $fields; |
|
| 1425 | 1425 | |
| 1426 | 1426 | $blocklist_field_types = $blocklist; |
| 1427 | 1427 | |
@@ -1453,13 +1453,13 @@ discard block |
||
| 1453 | 1453 | |
| 1454 | 1454 | } |
| 1455 | 1455 | |
| 1456 | - /** |
|
| 1457 | - * @filter `gravityview/common/sortable_fields` Filter the sortable fields |
|
| 1458 | - * @since 1.12 |
|
| 1459 | - * @param array $fields Sub-set of GF form fields that are sortable |
|
| 1460 | - * @param int $formid The Gravity Forms form ID that the fields are from |
|
| 1461 | - */ |
|
| 1462 | - $fields = apply_filters( 'gravityview/common/sortable_fields', $fields, $formid ); |
|
| 1456 | + /** |
|
| 1457 | + * @filter `gravityview/common/sortable_fields` Filter the sortable fields |
|
| 1458 | + * @since 1.12 |
|
| 1459 | + * @param array $fields Sub-set of GF form fields that are sortable |
|
| 1460 | + * @param int $formid The Gravity Forms form ID that the fields are from |
|
| 1461 | + */ |
|
| 1462 | + $fields = apply_filters( 'gravityview/common/sortable_fields', $fields, $formid ); |
|
| 1463 | 1463 | |
| 1464 | 1464 | return $fields; |
| 1465 | 1465 | } |
@@ -1752,26 +1752,26 @@ discard block |
||
| 1752 | 1752 | } |
| 1753 | 1753 | |
| 1754 | 1754 | |
| 1755 | - /** |
|
| 1756 | - * Display updated/error notice |
|
| 1757 | - * |
|
| 1758 | - * @since 1.19.2 Added $cap and $object_id parameters |
|
| 1759 | - * |
|
| 1760 | - * @param string $notice text/HTML of notice |
|
| 1761 | - * @param string $class CSS class for notice (`updated` or `error`) |
|
| 1762 | - * @param string $cap [Optional] Define a capability required to show a notice. If not set, displays to all caps. |
|
| 1763 | - * |
|
| 1764 | - * @return string |
|
| 1765 | - */ |
|
| 1766 | - public static function generate_notice( $notice, $class = '', $cap = '', $object_id = null ) { |
|
| 1767 | - |
|
| 1768 | - // If $cap is defined, only show notice if user has capability |
|
| 1769 | - if( $cap && ! GVCommon::has_cap( $cap, $object_id ) ) { |
|
| 1770 | - return ''; |
|
| 1771 | - } |
|
| 1772 | - |
|
| 1773 | - return '<div class="gv-notice '.gravityview_sanitize_html_class( $class ) .'">'. $notice .'</div>'; |
|
| 1774 | - } |
|
| 1755 | + /** |
|
| 1756 | + * Display updated/error notice |
|
| 1757 | + * |
|
| 1758 | + * @since 1.19.2 Added $cap and $object_id parameters |
|
| 1759 | + * |
|
| 1760 | + * @param string $notice text/HTML of notice |
|
| 1761 | + * @param string $class CSS class for notice (`updated` or `error`) |
|
| 1762 | + * @param string $cap [Optional] Define a capability required to show a notice. If not set, displays to all caps. |
|
| 1763 | + * |
|
| 1764 | + * @return string |
|
| 1765 | + */ |
|
| 1766 | + public static function generate_notice( $notice, $class = '', $cap = '', $object_id = null ) { |
|
| 1767 | + |
|
| 1768 | + // If $cap is defined, only show notice if user has capability |
|
| 1769 | + if( $cap && ! GVCommon::has_cap( $cap, $object_id ) ) { |
|
| 1770 | + return ''; |
|
| 1771 | + } |
|
| 1772 | + |
|
| 1773 | + return '<div class="gv-notice '.gravityview_sanitize_html_class( $class ) .'">'. $notice .'</div>'; |
|
| 1774 | + } |
|
| 1775 | 1775 | |
| 1776 | 1776 | /** |
| 1777 | 1777 | * Inspired on \GFCommon::encode_shortcodes, reverse the encoding by replacing the ascii characters by the shortcode brackets |
@@ -124,8 +124,8 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | $form = false; |
| 126 | 126 | |
| 127 | - if( $entry ) { |
|
| 128 | - $form = GFAPI::get_form( $entry['form_id'] ); |
|
| 127 | + if ( $entry ) { |
|
| 128 | + $form = GFAPI::get_form( $entry[ 'form_id' ] ); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | return $form; |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | } |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | - return (bool) $has_transaction_data; |
|
| 204 | + return (bool)$has_transaction_data; |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | /** |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | |
| 240 | 240 | $results = GFAPI::get_entries( intval( $form_id ), $search_criteria, null, $paging ); |
| 241 | 241 | |
| 242 | - $result = ( ! empty( $results ) && ! empty( $results[0]['id'] ) ) ? $results[0]['id'] : null; |
|
| 242 | + $result = ( ! empty( $results ) && ! empty( $results[ 0 ][ 'id' ] ) ) ? $results[ 0 ][ 'id' ] : null; |
|
| 243 | 243 | |
| 244 | 244 | return $result; |
| 245 | 245 | } |
@@ -259,13 +259,13 @@ discard block |
||
| 259 | 259 | * |
| 260 | 260 | * @return array Empty array if GFAPI class isn't available or no forms. Otherwise, the array of Forms |
| 261 | 261 | */ |
| 262 | - public static function get_forms( $active = true, $trash = false, $order_by = 'id', $order = 'ASC' ) { |
|
| 262 | + public static function get_forms( $active = true, $trash = false, $order_by = 'id', $order = 'ASC' ) { |
|
| 263 | 263 | $forms = array(); |
| 264 | 264 | if ( ! class_exists( 'GFAPI' ) ) { |
| 265 | 265 | return array(); |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | - if( 'any' === $active ) { |
|
| 268 | + if ( 'any' === $active ) { |
|
| 269 | 269 | $active_forms = GFAPI::get_forms( true, $trash ); |
| 270 | 270 | $inactive_forms = GFAPI::get_forms( false, $trash ); |
| 271 | 271 | $forms = array_merge( array_filter( $active_forms ), array_filter( $inactive_forms ) ); |
@@ -297,9 +297,9 @@ discard block |
||
| 297 | 297 | $has_post_fields = false; |
| 298 | 298 | |
| 299 | 299 | if ( $form ) { |
| 300 | - foreach ( $form['fields'] as $field ) { |
|
| 301 | - if ( $include_parent_field || empty( $field['inputs'] ) ) { |
|
| 302 | - $fields["{$field['id']}"] = array( |
|
| 300 | + foreach ( $form[ 'fields' ] as $field ) { |
|
| 301 | + if ( $include_parent_field || empty( $field[ 'inputs' ] ) ) { |
|
| 302 | + $fields[ "{$field[ 'id' ]}" ] = array( |
|
| 303 | 303 | 'label' => \GV\Utils::get( $field, 'label' ), |
| 304 | 304 | 'parent' => null, |
| 305 | 305 | 'type' => \GV\Utils::get( $field, 'type' ), |
@@ -308,10 +308,10 @@ discard block |
||
| 308 | 308 | ); |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | - if ( $add_default_properties && ! empty( $field['inputs'] ) ) { |
|
| 312 | - foreach ( $field['inputs'] as $input ) { |
|
| 311 | + if ( $add_default_properties && ! empty( $field[ 'inputs' ] ) ) { |
|
| 312 | + foreach ( $field[ 'inputs' ] as $input ) { |
|
| 313 | 313 | |
| 314 | - if( ! empty( $input['isHidden'] ) ) { |
|
| 314 | + if ( ! empty( $input[ 'isHidden' ] ) ) { |
|
| 315 | 315 | continue; |
| 316 | 316 | } |
| 317 | 317 | |
@@ -319,10 +319,10 @@ discard block |
||
| 319 | 319 | * @hack |
| 320 | 320 | * In case of email/email confirmation, the input for email has the same id as the parent field |
| 321 | 321 | */ |
| 322 | - if( 'email' === $field['type'] && false === strpos( $input['id'], '.' ) ) { |
|
| 322 | + if ( 'email' === $field[ 'type' ] && false === strpos( $input[ 'id' ], '.' ) ) { |
|
| 323 | 323 | continue; |
| 324 | 324 | } |
| 325 | - $fields["{$input['id']}"] = array( |
|
| 325 | + $fields[ "{$input[ 'id' ]}" ] = array( |
|
| 326 | 326 | 'label' => \GV\Utils::get( $input, 'label' ), |
| 327 | 327 | 'customLabel' => \GV\Utils::get( $input, 'customLabel' ), |
| 328 | 328 | 'parent' => $field, |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | } |
| 335 | 335 | |
| 336 | 336 | |
| 337 | - if( GFCommon::is_product_field( $field['type'] ) ){ |
|
| 337 | + if ( GFCommon::is_product_field( $field[ 'type' ] ) ) { |
|
| 338 | 338 | $has_product_fields = true; |
| 339 | 339 | } |
| 340 | 340 | |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | * @since 1.7 |
| 349 | 349 | */ |
| 350 | 350 | if ( $has_post_fields ) { |
| 351 | - $fields['post_id'] = array( |
|
| 351 | + $fields[ 'post_id' ] = array( |
|
| 352 | 352 | 'label' => __( 'Post ID', 'gravityview' ), |
| 353 | 353 | 'type' => 'post_id', |
| 354 | 354 | ); |
@@ -361,11 +361,11 @@ discard block |
||
| 361 | 361 | foreach ( $payment_fields as $payment_field ) { |
| 362 | 362 | |
| 363 | 363 | // Either the field exists ($fields['shipping']) or the form explicitly contains a `shipping` field with numeric key |
| 364 | - if( isset( $fields["{$payment_field->name}"] ) || GFCommon::get_fields_by_type( $form, $payment_field->name ) ) { |
|
| 364 | + if ( isset( $fields[ "{$payment_field->name}" ] ) || GFCommon::get_fields_by_type( $form, $payment_field->name ) ) { |
|
| 365 | 365 | continue; |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | - $fields["{$payment_field->name}"] = array( |
|
| 368 | + $fields[ "{$payment_field->name}" ] = array( |
|
| 369 | 369 | 'label' => $payment_field->label, |
| 370 | 370 | 'desc' => $payment_field->description, |
| 371 | 371 | 'type' => $payment_field->name, |
@@ -397,9 +397,9 @@ discard block |
||
| 397 | 397 | |
| 398 | 398 | $fields = array(); |
| 399 | 399 | |
| 400 | - foreach ( $extra_fields as $key => $field ){ |
|
| 401 | - if ( ! empty( $only_default_column ) && ! empty( $field['is_default_column'] ) ) { |
|
| 402 | - $fields[ $key ] = array( 'label' => $field['label'], 'type' => 'entry_meta' ); |
|
| 400 | + foreach ( $extra_fields as $key => $field ) { |
|
| 401 | + if ( ! empty( $only_default_column ) && ! empty( $field[ 'is_default_column' ] ) ) { |
|
| 402 | + $fields[ $key ] = array( 'label' => $field[ 'label' ], 'type' => 'entry_meta' ); |
|
| 403 | 403 | } |
| 404 | 404 | } |
| 405 | 405 | |
@@ -439,33 +439,33 @@ discard block |
||
| 439 | 439 | 'search_criteria' => null, |
| 440 | 440 | 'sorting' => null, |
| 441 | 441 | 'paging' => null, |
| 442 | - 'cache' => (isset( $passed_criteria['cache'] ) ? (bool) $passed_criteria['cache'] : true), |
|
| 442 | + 'cache' => ( isset( $passed_criteria[ 'cache' ] ) ? (bool)$passed_criteria[ 'cache' ] : true ), |
|
| 443 | 443 | 'context_view_id' => null, |
| 444 | 444 | ); |
| 445 | 445 | |
| 446 | 446 | $criteria = wp_parse_args( $passed_criteria, $search_criteria_defaults ); |
| 447 | 447 | |
| 448 | - if ( ! empty( $criteria['search_criteria']['field_filters'] ) && is_array( $criteria['search_criteria']['field_filters'] ) ) { |
|
| 449 | - foreach ( $criteria['search_criteria']['field_filters'] as &$filter ) { |
|
| 448 | + if ( ! empty( $criteria[ 'search_criteria' ][ 'field_filters' ] ) && is_array( $criteria[ 'search_criteria' ][ 'field_filters' ] ) ) { |
|
| 449 | + foreach ( $criteria[ 'search_criteria' ][ 'field_filters' ] as &$filter ) { |
|
| 450 | 450 | |
| 451 | 451 | if ( ! is_array( $filter ) ) { |
| 452 | 452 | continue; |
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | // By default, we want searches to be wildcard for each field. |
| 456 | - $filter['operator'] = empty( $filter['operator'] ) ? 'contains' : $filter['operator']; |
|
| 456 | + $filter[ 'operator' ] = empty( $filter[ 'operator' ] ) ? 'contains' : $filter[ 'operator' ]; |
|
| 457 | 457 | |
| 458 | 458 | /** |
| 459 | 459 | * @filter `gravityview_search_operator` Modify the search operator for the field (contains, is, isnot, etc) |
| 460 | 460 | * @param string $operator Existing search operator |
| 461 | 461 | * @param array $filter array with `key`, `value`, `operator`, `type` keys |
| 462 | 462 | */ |
| 463 | - $filter['operator'] = apply_filters( 'gravityview_search_operator', $filter['operator'], $filter ); |
|
| 463 | + $filter[ 'operator' ] = apply_filters( 'gravityview_search_operator', $filter[ 'operator' ], $filter ); |
|
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | // don't send just the [mode] without any field filter. |
| 467 | - if( count( $criteria['search_criteria']['field_filters'] ) === 1 && array_key_exists( 'mode' , $criteria['search_criteria']['field_filters'] ) ) { |
|
| 468 | - unset( $criteria['search_criteria']['field_filters']['mode'] ); |
|
| 467 | + if ( count( $criteria[ 'search_criteria' ][ 'field_filters' ] ) === 1 && array_key_exists( 'mode', $criteria[ 'search_criteria' ][ 'field_filters' ] ) ) { |
|
| 468 | + unset( $criteria[ 'search_criteria' ][ 'field_filters' ][ 'mode' ] ); |
|
| 469 | 469 | } |
| 470 | 470 | |
| 471 | 471 | } |
@@ -476,33 +476,33 @@ discard block |
||
| 476 | 476 | * Prepare date formats to be in Gravity Forms DB format; |
| 477 | 477 | * $passed_criteria may include date formats incompatible with Gravity Forms. |
| 478 | 478 | */ |
| 479 | - foreach ( array('start_date', 'end_date' ) as $key ) { |
|
| 479 | + foreach ( array( 'start_date', 'end_date' ) as $key ) { |
|
| 480 | 480 | |
| 481 | - if ( ! empty( $criteria['search_criteria'][ $key ] ) ) { |
|
| 481 | + if ( ! empty( $criteria[ 'search_criteria' ][ $key ] ) ) { |
|
| 482 | 482 | |
| 483 | 483 | // Use date_create instead of new DateTime so it returns false if invalid date format. |
| 484 | - $date = date_create( $criteria['search_criteria'][ $key ] ); |
|
| 484 | + $date = date_create( $criteria[ 'search_criteria' ][ $key ] ); |
|
| 485 | 485 | |
| 486 | 486 | if ( $date ) { |
| 487 | 487 | // Gravity Forms wants dates in the `Y-m-d H:i:s` format. |
| 488 | - $criteria['search_criteria'][ $key ] = $date->format( 'Y-m-d H:i:s' ); |
|
| 488 | + $criteria[ 'search_criteria' ][ $key ] = $date->format( 'Y-m-d H:i:s' ); |
|
| 489 | 489 | } else { |
| 490 | - gravityview()->log->error( '{key} Date format not valid:', array( 'key' => $key, $criteria['search_criteria'][ $key ] ) ); |
|
| 490 | + gravityview()->log->error( '{key} Date format not valid:', array( 'key' => $key, $criteria[ 'search_criteria' ][ $key ] ) ); |
|
| 491 | 491 | |
| 492 | 492 | // If it's an invalid date, unset it. Gravity Forms freaks out otherwise. |
| 493 | - unset( $criteria['search_criteria'][ $key ] ); |
|
| 493 | + unset( $criteria[ 'search_criteria' ][ $key ] ); |
|
| 494 | 494 | } |
| 495 | 495 | } |
| 496 | 496 | } |
| 497 | 497 | |
| 498 | - if ( empty( $criteria['context_view_id'] ) ) { |
|
| 498 | + if ( empty( $criteria[ 'context_view_id' ] ) ) { |
|
| 499 | 499 | // Calculate the context view id and send it to the advanced filter |
| 500 | 500 | if ( GravityView_frontend::getInstance()->getSingleEntry() ) { |
| 501 | - $criteria['context_view_id'] = GravityView_frontend::getInstance()->get_context_view_id(); |
|
| 501 | + $criteria[ 'context_view_id' ] = GravityView_frontend::getInstance()->get_context_view_id(); |
|
| 502 | 502 | } else if ( class_exists( 'GravityView_View_Data' ) && GravityView_View_Data::getInstance() && GravityView_View_Data::getInstance()->has_multiple_views() ) { |
| 503 | - $criteria['context_view_id'] = GravityView_frontend::getInstance()->get_context_view_id(); |
|
| 503 | + $criteria[ 'context_view_id' ] = GravityView_frontend::getInstance()->get_context_view_id(); |
|
| 504 | 504 | } else if ( 'delete' === GFForms::get( 'action' ) ) { |
| 505 | - $criteria['context_view_id'] = isset( $_GET['view_id'] ) ? intval( $_GET['view_id'] ) : null; |
|
| 505 | + $criteria[ 'context_view_id' ] = isset( $_GET[ 'view_id' ] ) ? intval( $_GET[ 'view_id' ] ) : null; |
|
| 506 | 506 | } |
| 507 | 507 | } |
| 508 | 508 | |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | * @param array $form_ids Forms to search |
| 513 | 513 | * @param int $view_id ID of the view being used to search |
| 514 | 514 | */ |
| 515 | - $criteria = apply_filters( 'gravityview_search_criteria', $criteria, $form_ids, $criteria['context_view_id'] ); |
|
| 515 | + $criteria = apply_filters( 'gravityview_search_criteria', $criteria, $form_ids, $criteria[ 'context_view_id' ] ); |
|
| 516 | 516 | |
| 517 | 517 | return (array)$criteria; |
| 518 | 518 | } |
@@ -546,7 +546,7 @@ discard block |
||
| 546 | 546 | /** Reduce # of database calls */ |
| 547 | 547 | add_filter( 'gform_is_encrypted_field', '__return_false' ); |
| 548 | 548 | |
| 549 | - if ( ! empty( $criteria['cache'] ) ) { |
|
| 549 | + if ( ! empty( $criteria[ 'cache' ] ) ) { |
|
| 550 | 550 | |
| 551 | 551 | $Cache = new GravityView_Cache( $form_ids, $criteria ); |
| 552 | 552 | |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | |
| 555 | 555 | // Still update the total count when using cached results |
| 556 | 556 | if ( ! is_null( $total ) ) { |
| 557 | - $total = GFAPI::count_entries( $form_ids, $criteria['search_criteria'] ); |
|
| 557 | + $total = GFAPI::count_entries( $form_ids, $criteria[ 'search_criteria' ] ); |
|
| 558 | 558 | } |
| 559 | 559 | |
| 560 | 560 | $return = $entries; |
@@ -576,9 +576,9 @@ discard block |
||
| 576 | 576 | $entries = apply_filters_ref_array( 'gravityview_before_get_entries', array( null, $criteria, $passed_criteria, &$total ) ); |
| 577 | 577 | |
| 578 | 578 | // No entries returned from gravityview_before_get_entries |
| 579 | - if( is_null( $entries ) ) { |
|
| 579 | + if ( is_null( $entries ) ) { |
|
| 580 | 580 | |
| 581 | - $entries = GFAPI::get_entries( $form_ids, $criteria['search_criteria'], $criteria['sorting'], $criteria['paging'], $total ); |
|
| 581 | + $entries = GFAPI::get_entries( $form_ids, $criteria[ 'search_criteria' ], $criteria[ 'sorting' ], $criteria[ 'paging' ], $total ); |
|
| 582 | 582 | |
| 583 | 583 | if ( is_wp_error( $entries ) ) { |
| 584 | 584 | gravityview()->log->error( '{error}', array( 'error' => $entries->get_error_message(), 'data' => $entries ) ); |
@@ -589,7 +589,7 @@ discard block |
||
| 589 | 589 | } |
| 590 | 590 | } |
| 591 | 591 | |
| 592 | - if ( ! empty( $criteria['cache'] ) && isset( $Cache ) ) { |
|
| 592 | + if ( ! empty( $criteria[ 'cache' ] ) && isset( $Cache ) ) { |
|
| 593 | 593 | |
| 594 | 594 | // Cache results |
| 595 | 595 | $Cache->set( $entries, 'entries' ); |
@@ -706,18 +706,18 @@ discard block |
||
| 706 | 706 | $check_entry_display = apply_filters( 'gravityview/common/get_entry/check_entry_display', $check_entry_display, $entry, $view ); |
| 707 | 707 | |
| 708 | 708 | // Is the entry allowed |
| 709 | - if( $check_entry_display ) { |
|
| 709 | + if ( $check_entry_display ) { |
|
| 710 | 710 | |
| 711 | 711 | $gvid = \GV\Utils::_GET( 'gvid' ); |
| 712 | 712 | |
| 713 | - if( $gvid ) { |
|
| 713 | + if ( $gvid ) { |
|
| 714 | 714 | $view = \GV\View::by_id( $gvid ); |
| 715 | 715 | } |
| 716 | 716 | |
| 717 | 717 | $entry = self::check_entry_display( $entry, $view ); |
| 718 | 718 | } |
| 719 | 719 | |
| 720 | - if( is_wp_error( $entry ) ) { |
|
| 720 | + if ( is_wp_error( $entry ) ) { |
|
| 721 | 721 | gravityview()->log->error( '{error}', array( 'error' => $entry->get_error_message() ) ); |
| 722 | 722 | return false; |
| 723 | 723 | } |
@@ -751,12 +751,12 @@ discard block |
||
| 751 | 751 | |
| 752 | 752 | $value = false; |
| 753 | 753 | |
| 754 | - if( 'context' === $val1 ) { |
|
| 754 | + if ( 'context' === $val1 ) { |
|
| 755 | 755 | |
| 756 | 756 | $matching_contexts = array( $val2 ); |
| 757 | 757 | |
| 758 | 758 | // We allow for non-standard contexts. |
| 759 | - switch( $val2 ) { |
|
| 759 | + switch ( $val2 ) { |
|
| 760 | 760 | // Check for either single or edit |
| 761 | 761 | case 'singular': |
| 762 | 762 | $matching_contexts = array( 'single', 'edit' ); |
@@ -799,18 +799,18 @@ discard block |
||
| 799 | 799 | $json_val_1 = json_decode( $val1, true ); |
| 800 | 800 | $json_val_2 = json_decode( $val2, true ); |
| 801 | 801 | |
| 802 | - if( ! empty( $json_val_1 ) || ! empty( $json_val_2 ) ) { |
|
| 802 | + if ( ! empty( $json_val_1 ) || ! empty( $json_val_2 ) ) { |
|
| 803 | 803 | |
| 804 | 804 | $json_in = false; |
| 805 | - $json_val_1 = $json_val_1 ? (array) $json_val_1 : array( $val1 ); |
|
| 806 | - $json_val_2 = $json_val_2 ? (array) $json_val_2 : array( $val2 ); |
|
| 805 | + $json_val_1 = $json_val_1 ? (array)$json_val_1 : array( $val1 ); |
|
| 806 | + $json_val_2 = $json_val_2 ? (array)$json_val_2 : array( $val2 ); |
|
| 807 | 807 | |
| 808 | 808 | // For JSON, we want to compare as "in" or "not in" rather than "contains" |
| 809 | 809 | foreach ( $json_val_1 as $item_1 ) { |
| 810 | 810 | foreach ( $json_val_2 as $item_2 ) { |
| 811 | 811 | $json_in = self::matches_operation( $item_1, $item_2, 'is' ); |
| 812 | 812 | |
| 813 | - if( $json_in ) { |
|
| 813 | + if ( $json_in ) { |
|
| 814 | 814 | break 2; |
| 815 | 815 | } |
| 816 | 816 | } |
@@ -861,10 +861,10 @@ discard block |
||
| 861 | 861 | public static function check_entry_display( $entry, $view = null ) { |
| 862 | 862 | |
| 863 | 863 | if ( ! $entry || is_wp_error( $entry ) ) { |
| 864 | - return new WP_Error('entry_not_found', 'Entry was not found.', $entry ); |
|
| 864 | + return new WP_Error( 'entry_not_found', 'Entry was not found.', $entry ); |
|
| 865 | 865 | } |
| 866 | 866 | |
| 867 | - if ( empty( $entry['form_id'] ) ) { |
|
| 867 | + if ( empty( $entry[ 'form_id' ] ) ) { |
|
| 868 | 868 | return new WP_Error( 'form_id_not_set', '[apply_filters_to_entry] Entry is empty!', $entry ); |
| 869 | 869 | } |
| 870 | 870 | |
@@ -879,19 +879,19 @@ discard block |
||
| 879 | 879 | |
| 880 | 880 | $_gvid = \GV\Utils::_GET( 'gvid' ); |
| 881 | 881 | |
| 882 | - if ( $_gvid && $view->ID !== (int) $_gvid ) { |
|
| 882 | + if ( $_gvid && $view->ID !== (int)$_gvid ) { |
|
| 883 | 883 | return new WP_Error( 'view_id_not_match_gvid', 'View does not match passed $_GET["gvid"].', $view->ID ); |
| 884 | 884 | } |
| 885 | 885 | |
| 886 | 886 | $view_form_id = $view->form->ID; |
| 887 | 887 | |
| 888 | 888 | if ( $view->joins ) { |
| 889 | - if ( in_array( (int) $entry['form_id'], array_keys( $view::get_joined_forms( $view->ID ) ), true ) ) { |
|
| 890 | - $view_form_id = $entry['form_id']; |
|
| 889 | + if ( in_array( (int)$entry[ 'form_id' ], array_keys( $view::get_joined_forms( $view->ID ) ), true ) ) { |
|
| 890 | + $view_form_id = $entry[ 'form_id' ]; |
|
| 891 | 891 | } |
| 892 | 892 | } |
| 893 | 893 | |
| 894 | - if ( (int) $view_form_id !== (int) $entry['form_id'] ) { |
|
| 894 | + if ( (int)$view_form_id !== (int)$entry[ 'form_id' ] ) { |
|
| 895 | 895 | return new WP_Error( 'view_id_not_match', 'View form source does not match entry form source ID.', $entry ); |
| 896 | 896 | } |
| 897 | 897 | |
@@ -899,13 +899,13 @@ discard block |
||
| 899 | 899 | * Check whether the entry is in the entries subset by running a modified query. |
| 900 | 900 | */ |
| 901 | 901 | add_action( 'gravityview/view/query', $entry_subset_callback = function( &$query, $view, $request ) use ( $entry, $view_form_id ) { |
| 902 | - $_tmp_query = new \GF_Query( $view_form_id, array( |
|
| 902 | + $_tmp_query = new \GF_Query( $view_form_id, array( |
|
| 903 | 903 | 'field_filters' => array( |
| 904 | 904 | 'mode' => 'all', |
| 905 | 905 | array( |
| 906 | 906 | 'key' => 'id', |
| 907 | 907 | 'operation' => 'is', |
| 908 | - 'value' => $entry['id'] |
|
| 908 | + 'value' => $entry[ 'id' ] |
|
| 909 | 909 | ) |
| 910 | 910 | ) |
| 911 | 911 | ) ); |
@@ -915,14 +915,14 @@ discard block |
||
| 915 | 915 | /** @type \GF_Query $query */ |
| 916 | 916 | $query_parts = $query->_introspect(); |
| 917 | 917 | |
| 918 | - $query->where( \GF_Query_Condition::_and( $_tmp_query_parts['where'], $query_parts['where'] ) ); |
|
| 918 | + $query->where( \GF_Query_Condition::_and( $_tmp_query_parts[ 'where' ], $query_parts[ 'where' ] ) ); |
|
| 919 | 919 | |
| 920 | 920 | }, 10, 3 ); |
| 921 | 921 | |
| 922 | 922 | // Prevent page offset from being applied to the single entry query; it's used to return to the referring page number |
| 923 | 923 | add_filter( 'gravityview_search_criteria', $remove_pagenum = function( $criteria ) { |
| 924 | 924 | |
| 925 | - $criteria['paging'] = array( |
|
| 925 | + $criteria[ 'paging' ] = array( |
|
| 926 | 926 | 'offset' => 0, |
| 927 | 927 | 'page_size' => 25 |
| 928 | 928 | ); |
@@ -941,20 +941,20 @@ discard block |
||
| 941 | 941 | } |
| 942 | 942 | |
| 943 | 943 | // This entry is on a View with joins |
| 944 | - if ( $entries[0]->is_multi() ) { |
|
| 944 | + if ( $entries[ 0 ]->is_multi() ) { |
|
| 945 | 945 | |
| 946 | 946 | $multi_entry_ids = array(); |
| 947 | 947 | |
| 948 | - foreach ( $entries[0]->entries as $multi_entry ) { |
|
| 949 | - $multi_entry_ids[] = (int) $multi_entry->ID; |
|
| 948 | + foreach ( $entries[ 0 ]->entries as $multi_entry ) { |
|
| 949 | + $multi_entry_ids[ ] = (int)$multi_entry->ID; |
|
| 950 | 950 | } |
| 951 | 951 | |
| 952 | - if ( ! in_array( (int) $entry['id'], $multi_entry_ids, true ) ) { |
|
| 952 | + if ( ! in_array( (int)$entry[ 'id' ], $multi_entry_ids, true ) ) { |
|
| 953 | 953 | remove_action( 'gravityview/view/query', $entry_subset_callback ); |
| 954 | 954 | return new \WP_Error( 'failed_criteria', 'Entry failed search_criteria and field_filters' ); |
| 955 | 955 | } |
| 956 | 956 | |
| 957 | - } elseif ( (int) $entries[0]->ID !== (int) $entry['id'] ) { |
|
| 957 | + } elseif ( (int)$entries[ 0 ]->ID !== (int)$entry[ 'id' ] ) { |
|
| 958 | 958 | remove_action( 'gravityview/view/query', $entry_subset_callback ); |
| 959 | 959 | return new \WP_Error( 'failed_criteria', 'Entry failed search_criteria and field_filters' ); |
| 960 | 960 | } |
@@ -999,18 +999,18 @@ discard block |
||
| 999 | 999 | * Gravity Forms code to adjust date to locally-configured Time Zone |
| 1000 | 1000 | * @see GFCommon::format_date() for original code |
| 1001 | 1001 | */ |
| 1002 | - $date_gmt_time = mysql2date( 'G', $date_string ); |
|
| 1002 | + $date_gmt_time = mysql2date( 'G', $date_string ); |
|
| 1003 | 1003 | $date_local_timestamp = GFCommon::get_local_timestamp( $date_gmt_time ); |
| 1004 | 1004 | |
| 1005 | - $format = \GV\Utils::get( $atts, 'format' ); |
|
| 1006 | - $is_human = ! empty( $atts['human'] ); |
|
| 1007 | - $is_diff = ! empty( $atts['diff'] ); |
|
| 1008 | - $is_raw = ! empty( $atts['raw'] ); |
|
| 1009 | - $is_timestamp = ! empty( $atts['timestamp'] ); |
|
| 1010 | - $include_time = ! empty( $atts['time'] ); |
|
| 1005 | + $format = \GV\Utils::get( $atts, 'format' ); |
|
| 1006 | + $is_human = ! empty( $atts[ 'human' ] ); |
|
| 1007 | + $is_diff = ! empty( $atts[ 'diff' ] ); |
|
| 1008 | + $is_raw = ! empty( $atts[ 'raw' ] ); |
|
| 1009 | + $is_timestamp = ! empty( $atts[ 'timestamp' ] ); |
|
| 1010 | + $include_time = ! empty( $atts[ 'time' ] ); |
|
| 1011 | 1011 | |
| 1012 | 1012 | // If we're using time diff, we want to have a different default format |
| 1013 | - if( empty( $format ) ) { |
|
| 1013 | + if ( empty( $format ) ) { |
|
| 1014 | 1014 | /* translators: %s: relative time from now, used for generic date comparisons. "1 day ago", or "20 seconds ago" */ |
| 1015 | 1015 | $format = $is_diff ? esc_html__( '%s ago', 'gravityview' ) : get_option( 'date_format' ); |
| 1016 | 1016 | } |
@@ -1018,7 +1018,7 @@ discard block |
||
| 1018 | 1018 | // If raw was specified, don't modify the stored value |
| 1019 | 1019 | if ( $is_raw ) { |
| 1020 | 1020 | $formatted_date = $date_string; |
| 1021 | - } elseif( $is_timestamp ) { |
|
| 1021 | + } elseif ( $is_timestamp ) { |
|
| 1022 | 1022 | $formatted_date = $date_local_timestamp; |
| 1023 | 1023 | } elseif ( $is_diff ) { |
| 1024 | 1024 | $formatted_date = sprintf( $format, human_time_diff( $date_gmt_time ) ); |
@@ -1051,7 +1051,7 @@ discard block |
||
| 1051 | 1051 | |
| 1052 | 1052 | $label = \GV\Utils::get( $field, 'label' ); |
| 1053 | 1053 | |
| 1054 | - if( floor( $field_id ) !== floatval( $field_id ) ) { |
|
| 1054 | + if ( floor( $field_id ) !== floatval( $field_id ) ) { |
|
| 1055 | 1055 | $label = GFFormsModel::get_choice_text( $field, $field_value, $field_id ); |
| 1056 | 1056 | } |
| 1057 | 1057 | |
@@ -1078,7 +1078,7 @@ discard block |
||
| 1078 | 1078 | $form = GFAPI::get_form( $form ); |
| 1079 | 1079 | } |
| 1080 | 1080 | |
| 1081 | - if ( class_exists( 'GFFormsModel' ) ){ |
|
| 1081 | + if ( class_exists( 'GFFormsModel' ) ) { |
|
| 1082 | 1082 | return GFFormsModel::get_field( $form, $field_id ); |
| 1083 | 1083 | } else { |
| 1084 | 1084 | return null; |
@@ -1125,19 +1125,19 @@ discard block |
||
| 1125 | 1125 | $shortcodes = array(); |
| 1126 | 1126 | |
| 1127 | 1127 | preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER ); |
| 1128 | - if ( empty( $matches ) ){ |
|
| 1128 | + if ( empty( $matches ) ) { |
|
| 1129 | 1129 | return false; |
| 1130 | 1130 | } |
| 1131 | 1131 | |
| 1132 | 1132 | foreach ( $matches as $shortcode ) { |
| 1133 | - if ( $tag === $shortcode[2] ) { |
|
| 1133 | + if ( $tag === $shortcode[ 2 ] ) { |
|
| 1134 | 1134 | |
| 1135 | 1135 | // Changed this to $shortcode instead of true so we get the parsed atts. |
| 1136 | - $shortcodes[] = $shortcode; |
|
| 1136 | + $shortcodes[ ] = $shortcode; |
|
| 1137 | 1137 | |
| 1138 | - } else if ( isset( $shortcode[5] ) && $results = self::has_shortcode_r( $shortcode[5], $tag ) ) { |
|
| 1139 | - foreach( $results as $result ) { |
|
| 1140 | - $shortcodes[] = $result; |
|
| 1138 | + } else if ( isset( $shortcode[ 5 ] ) && $results = self::has_shortcode_r( $shortcode[ 5 ], $tag ) ) { |
|
| 1139 | + foreach ( $results as $result ) { |
|
| 1140 | + $shortcodes[ ] = $result; |
|
| 1141 | 1141 | } |
| 1142 | 1142 | } |
| 1143 | 1143 | } |
@@ -1169,7 +1169,7 @@ discard block |
||
| 1169 | 1169 | 'post_type' => 'gravityview', |
| 1170 | 1170 | 'posts_per_page' => 100, |
| 1171 | 1171 | 'meta_key' => '_gravityview_form_id', |
| 1172 | - 'meta_value' => (int) $form_id, |
|
| 1172 | + 'meta_value' => (int)$form_id, |
|
| 1173 | 1173 | ); |
| 1174 | 1174 | $args = wp_parse_args( $args, $defaults ); |
| 1175 | 1175 | $views = get_posts( $args ); |
@@ -1181,21 +1181,21 @@ discard block |
||
| 1181 | 1181 | |
| 1182 | 1182 | $data = unserialize( $view->meta_value ); |
| 1183 | 1183 | |
| 1184 | - if( ! $data || ! is_array( $data ) ) { |
|
| 1184 | + if ( ! $data || ! is_array( $data ) ) { |
|
| 1185 | 1185 | continue; |
| 1186 | 1186 | } |
| 1187 | 1187 | |
| 1188 | 1188 | foreach ( $data as $datum ) { |
| 1189 | - if ( ! empty( $datum[2] ) && (int) $datum[2] === (int) $form_id ) { |
|
| 1190 | - $joined_forms[] = $view->post_id; |
|
| 1189 | + if ( ! empty( $datum[ 2 ] ) && (int)$datum[ 2 ] === (int)$form_id ) { |
|
| 1190 | + $joined_forms[ ] = $view->post_id; |
|
| 1191 | 1191 | } |
| 1192 | 1192 | } |
| 1193 | 1193 | } |
| 1194 | 1194 | |
| 1195 | 1195 | if ( $joined_forms ) { |
| 1196 | - $joined_args = array( |
|
| 1196 | + $joined_args = array( |
|
| 1197 | 1197 | 'post_type' => 'gravityview', |
| 1198 | - 'posts_per_page' => $args['posts_per_page'], |
|
| 1198 | + 'posts_per_page' => $args[ 'posts_per_page' ], |
|
| 1199 | 1199 | 'post__in' => $joined_forms, |
| 1200 | 1200 | ); |
| 1201 | 1201 | $views = array_merge( $views, get_posts( $joined_args ) ); |
@@ -1351,7 +1351,7 @@ discard block |
||
| 1351 | 1351 | |
| 1352 | 1352 | $directory_widgets = wp_parse_args( $view_widgets, $defaults ); |
| 1353 | 1353 | |
| 1354 | - if( $json_decode ) { |
|
| 1354 | + if ( $json_decode ) { |
|
| 1355 | 1355 | $directory_widgets = gv_map_deep( $directory_widgets, 'gv_maybe_json_decode' ); |
| 1356 | 1356 | } |
| 1357 | 1357 | |
@@ -1366,7 +1366,7 @@ discard block |
||
| 1366 | 1366 | * @return string html |
| 1367 | 1367 | */ |
| 1368 | 1368 | public static function get_sortable_fields( $formid, $current = '' ) { |
| 1369 | - $output = '<option value="" ' . selected( '', $current, false ).'>' . esc_html__( 'Default (Entry ID)', 'gravityview' ) .'</option>'; |
|
| 1369 | + $output = '<option value="" ' . selected( '', $current, false ) . '>' . esc_html__( 'Default (Entry ID)', 'gravityview' ) . '</option>'; |
|
| 1370 | 1370 | |
| 1371 | 1371 | if ( empty( $formid ) ) { |
| 1372 | 1372 | return $output; |
@@ -1383,11 +1383,11 @@ discard block |
||
| 1383 | 1383 | $blocklist_field_types = apply_filters( 'gravityview_blocklist_field_types', $blocklist_field_types, null ); |
| 1384 | 1384 | |
| 1385 | 1385 | foreach ( $fields as $id => $field ) { |
| 1386 | - if ( in_array( $field['type'], $blocklist_field_types ) ) { |
|
| 1386 | + if ( in_array( $field[ 'type' ], $blocklist_field_types ) ) { |
|
| 1387 | 1387 | continue; |
| 1388 | 1388 | } |
| 1389 | 1389 | |
| 1390 | - $output .= '<option value="'. $id .'" '. selected( $id, $current, false ).'>'. esc_attr( $field['label'] ) .'</option>'; |
|
| 1390 | + $output .= '<option value="' . $id . '" ' . selected( $id, $current, false ) . '>' . esc_attr( $field[ 'label' ] ) . '</option>'; |
|
| 1391 | 1391 | } |
| 1392 | 1392 | } |
| 1393 | 1393 | |
@@ -1430,16 +1430,16 @@ discard block |
||
| 1430 | 1430 | $blocklist_field_types = apply_filters( 'gravityview_blocklist_field_types', $blocklist_field_types, null ); |
| 1431 | 1431 | |
| 1432 | 1432 | // TODO: Convert to using array_filter |
| 1433 | - foreach( $fields as $id => $field ) { |
|
| 1433 | + foreach ( $fields as $id => $field ) { |
|
| 1434 | 1434 | |
| 1435 | - if( in_array( $field['type'], $blocklist_field_types ) ) { |
|
| 1435 | + if ( in_array( $field[ 'type' ], $blocklist_field_types ) ) { |
|
| 1436 | 1436 | unset( $fields[ $id ] ); |
| 1437 | 1437 | } |
| 1438 | 1438 | |
| 1439 | 1439 | /** |
| 1440 | 1440 | * Merge date and time subfields. |
| 1441 | 1441 | */ |
| 1442 | - if ( in_array( $field['type'], array( 'date', 'time' ) ) && ! empty( $field['parent'] ) ) { |
|
| 1442 | + if ( in_array( $field[ 'type' ], array( 'date', 'time' ) ) && ! empty( $field[ 'parent' ] ) ) { |
|
| 1443 | 1443 | $fields[ intval( $id ) ] = array( |
| 1444 | 1444 | 'label' => \GV\Utils::get( $field, 'parent/label' ), |
| 1445 | 1445 | 'parent' => null, |
@@ -1489,14 +1489,14 @@ discard block |
||
| 1489 | 1489 | * @param int|array $field field key or field array |
| 1490 | 1490 | * @return boolean |
| 1491 | 1491 | */ |
| 1492 | - public static function is_field_numeric( $form = null, $field = '' ) { |
|
| 1492 | + public static function is_field_numeric( $form = null, $field = '' ) { |
|
| 1493 | 1493 | |
| 1494 | 1494 | if ( ! is_array( $form ) && ! is_array( $field ) ) { |
| 1495 | 1495 | $form = self::get_form( $form ); |
| 1496 | 1496 | } |
| 1497 | 1497 | |
| 1498 | 1498 | // If entry meta, it's a string. Otherwise, numeric |
| 1499 | - if( ! is_numeric( $field ) && is_string( $field ) ) { |
|
| 1499 | + if ( ! is_numeric( $field ) && is_string( $field ) ) { |
|
| 1500 | 1500 | $type = $field; |
| 1501 | 1501 | } else { |
| 1502 | 1502 | $type = self::get_field_type( $form, $field ); |
@@ -1510,9 +1510,9 @@ discard block |
||
| 1510 | 1510 | $numeric_types = apply_filters( 'gravityview/common/numeric_types', array( 'number', 'time' ) ); |
| 1511 | 1511 | |
| 1512 | 1512 | // Defer to GravityView_Field setting, if the field type is registered and `is_numeric` is true |
| 1513 | - if( $gv_field = GravityView_Fields::get( $type ) ) { |
|
| 1514 | - if( true === $gv_field->is_numeric ) { |
|
| 1515 | - $numeric_types[] = $gv_field->is_numeric; |
|
| 1513 | + if ( $gv_field = GravityView_Fields::get( $type ) ) { |
|
| 1514 | + if ( true === $gv_field->is_numeric ) { |
|
| 1515 | + $numeric_types[ ] = $gv_field->is_numeric; |
|
| 1516 | 1516 | } |
| 1517 | 1517 | } |
| 1518 | 1518 | |
@@ -1663,18 +1663,18 @@ discard block |
||
| 1663 | 1663 | $final_atts = array_filter( $final_atts ); |
| 1664 | 1664 | |
| 1665 | 1665 | // If the href wasn't passed as an attribute, use the value passed to the function |
| 1666 | - if ( empty( $final_atts['href'] ) && ! empty( $href ) ) { |
|
| 1667 | - $final_atts['href'] = $href; |
|
| 1666 | + if ( empty( $final_atts[ 'href' ] ) && ! empty( $href ) ) { |
|
| 1667 | + $final_atts[ 'href' ] = $href; |
|
| 1668 | 1668 | } |
| 1669 | 1669 | |
| 1670 | - $final_atts['href'] = esc_url_raw( $href ); |
|
| 1670 | + $final_atts[ 'href' ] = esc_url_raw( $href ); |
|
| 1671 | 1671 | |
| 1672 | 1672 | /** |
| 1673 | 1673 | * Fix potential security issue with target=_blank |
| 1674 | 1674 | * @see https://dev.to/ben/the-targetblank-vulnerability-by-example |
| 1675 | 1675 | */ |
| 1676 | - if( '_blank' === \GV\Utils::get( $final_atts, 'target' ) ) { |
|
| 1677 | - $final_atts['rel'] = trim( \GV\Utils::get( $final_atts, 'rel', '' ) . ' noopener noreferrer' ); |
|
| 1676 | + if ( '_blank' === \GV\Utils::get( $final_atts, 'target' ) ) { |
|
| 1677 | + $final_atts[ 'rel' ] = trim( \GV\Utils::get( $final_atts, 'rel', '' ) . ' noopener noreferrer' ); |
|
| 1678 | 1678 | } |
| 1679 | 1679 | |
| 1680 | 1680 | // Sort the attributes alphabetically, to help testing |
@@ -1686,7 +1686,7 @@ discard block |
||
| 1686 | 1686 | $output .= sprintf( ' %s="%s"', $attr, esc_attr( $value ) ); |
| 1687 | 1687 | } |
| 1688 | 1688 | |
| 1689 | - if( '' !== $output ) { |
|
| 1689 | + if ( '' !== $output ) { |
|
| 1690 | 1690 | $output = '<a' . $output . '>' . $anchor_text . '</a>'; |
| 1691 | 1691 | } |
| 1692 | 1692 | |
@@ -1713,7 +1713,7 @@ discard block |
||
| 1713 | 1713 | if ( is_array( $value ) && isset( $merged[ $key ] ) && is_array( $merged[ $key ] ) ) { |
| 1714 | 1714 | $merged[ $key ] = self::array_merge_recursive_distinct( $merged[ $key ], $value ); |
| 1715 | 1715 | } else if ( is_numeric( $key ) && isset( $merged[ $key ] ) ) { |
| 1716 | - $merged[] = $value; |
|
| 1716 | + $merged[ ] = $value; |
|
| 1717 | 1717 | } else { |
| 1718 | 1718 | $merged[ $key ] = $value; |
| 1719 | 1719 | } |
@@ -1746,7 +1746,7 @@ discard block |
||
| 1746 | 1746 | * `$context` is where are we using this information (e.g. change_entry_creator, search_widget ..) |
| 1747 | 1747 | * @param array $settings Settings array, with `number` key defining the # of users to display |
| 1748 | 1748 | */ |
| 1749 | - $get_users_settings = apply_filters( 'gravityview/get_users/'. $context, apply_filters( 'gravityview_change_entry_creator_user_parameters', $get_users_settings ) ); |
|
| 1749 | + $get_users_settings = apply_filters( 'gravityview/get_users/' . $context, apply_filters( 'gravityview_change_entry_creator_user_parameters', $get_users_settings ) ); |
|
| 1750 | 1750 | |
| 1751 | 1751 | return get_users( $get_users_settings ); |
| 1752 | 1752 | } |
@@ -1766,11 +1766,11 @@ discard block |
||
| 1766 | 1766 | public static function generate_notice( $notice, $class = '', $cap = '', $object_id = null ) { |
| 1767 | 1767 | |
| 1768 | 1768 | // If $cap is defined, only show notice if user has capability |
| 1769 | - if( $cap && ! GVCommon::has_cap( $cap, $object_id ) ) { |
|
| 1769 | + if ( $cap && ! GVCommon::has_cap( $cap, $object_id ) ) { |
|
| 1770 | 1770 | return ''; |
| 1771 | 1771 | } |
| 1772 | 1772 | |
| 1773 | - return '<div class="gv-notice '.gravityview_sanitize_html_class( $class ) .'">'. $notice .'</div>'; |
|
| 1773 | + return '<div class="gv-notice ' . gravityview_sanitize_html_class( $class ) . '">' . $notice . '</div>'; |
|
| 1774 | 1774 | } |
| 1775 | 1775 | |
| 1776 | 1776 | /** |
@@ -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 | /** |
@@ -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 | |