@@ -26,24 +26,24 @@ |
||
26 | 26 | function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
27 | 27 | |
28 | 28 | // Don't link to entry; doesn't make sense. |
29 | - unset( $field_options['show_as_link'] ); |
|
29 | + unset( $field_options[ 'show_as_link' ] ); |
|
30 | 30 | |
31 | - if( 'edit' === $context ) { |
|
31 | + if ( 'edit' === $context ) { |
|
32 | 32 | return $field_options; |
33 | 33 | } |
34 | 34 | |
35 | 35 | $add_options = array(); |
36 | - $add_options['link_to_source'] = array( |
|
36 | + $add_options[ 'link_to_source' ] = array( |
|
37 | 37 | 'type' => 'checkbox', |
38 | 38 | 'label' => __( 'Link to URL:', 'gravityview' ), |
39 | - 'desc' => __('Display as a link to the Source URL', 'gravityview'), |
|
39 | + 'desc' => __( 'Display as a link to the Source URL', 'gravityview' ), |
|
40 | 40 | 'value' => false, |
41 | 41 | 'merge_tags' => false, |
42 | 42 | ); |
43 | - $add_options['source_link_text'] = array( |
|
43 | + $add_options[ 'source_link_text' ] = array( |
|
44 | 44 | 'type' => 'text', |
45 | 45 | 'label' => __( 'Link Text:', 'gravityview' ), |
46 | - 'desc' => __('Customize the link text. If empty, the link text will be the URL.', 'gravityview'), |
|
46 | + 'desc' => __( 'Customize the link text. If empty, the link text will be the URL.', 'gravityview' ), |
|
47 | 47 | 'value' => NULL, |
48 | 48 | 'merge_tags' => true, |
49 | 49 | ); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * |
37 | 37 | * @api |
38 | 38 | * @since future |
39 | - * @return \GV\Entry|null An instance of this entry or null if not found. |
|
39 | + * @return null|GF_Entry An instance of this entry or null if not found. |
|
40 | 40 | */ |
41 | 41 | public static function by_id( $entry_id ) { |
42 | 42 | $entry = \GFAPI::get_entry( $entry_id ); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * |
53 | 53 | * @param array $entry The array ID. |
54 | 54 | * |
55 | - * @return \GV\Entry|null An instance of this entry or null if not found. |
|
55 | + * @return null|GF_Entry An instance of this entry or null if not found. |
|
56 | 56 | */ |
57 | 57 | public static function from_entry( $entry ) { |
58 | 58 | if ( empty( $entry['id'] ) ) { |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public static function by_id( $entry_id ) { |
42 | 42 | $entry = \GFAPI::get_entry( $entry_id ); |
43 | - if ( !$entry ) { |
|
43 | + if ( ! $entry ) { |
|
44 | 44 | return null; |
45 | 45 | } |
46 | 46 | |
@@ -55,14 +55,14 @@ discard block |
||
55 | 55 | * @return \GV\Entry|null An instance of this entry or null if not found. |
56 | 56 | */ |
57 | 57 | public static function from_entry( $entry ) { |
58 | - if ( empty( $entry['id'] ) ) { |
|
58 | + if ( empty( $entry[ 'id' ] ) ) { |
|
59 | 59 | return null; |
60 | 60 | } |
61 | 61 | |
62 | 62 | $self = new self(); |
63 | 63 | $self->entry = $entry; |
64 | 64 | |
65 | - $self->ID = $self->entry['id']; |
|
65 | + $self->ID = $self->entry[ 'id' ]; |
|
66 | 66 | |
67 | 67 | return $self; |
68 | 68 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * @return bool Whether the offset exists or not. |
77 | 77 | */ |
78 | 78 | public function offsetExists( $offset ) { |
79 | - return isset( $this->entry[$offset] ); |
|
79 | + return isset( $this->entry[ $offset ] ); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * @return mixed The value of the requested entry data. |
92 | 92 | */ |
93 | 93 | public function offsetGet( $offset ) { |
94 | - return $this->entry[$offset]; |
|
94 | + return $this->entry[ $offset ]; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -40,14 +40,14 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public static function by_id( $form_id ) { |
42 | 42 | $form = \GFAPI::get_form( $form_id ); |
43 | - if ( !$form ) { |
|
43 | + if ( ! $form ) { |
|
44 | 44 | return null; |
45 | 45 | } |
46 | 46 | |
47 | 47 | $self = new self(); |
48 | 48 | $self->form = $form; |
49 | 49 | |
50 | - $self->ID = $self->form['id']; |
|
50 | + $self->ID = $self->form[ 'id' ]; |
|
51 | 51 | |
52 | 52 | return $self; |
53 | 53 | } |
@@ -90,11 +90,11 @@ discard block |
||
90 | 90 | |
91 | 91 | /** The offset and limit */ |
92 | 92 | if ( ! empty( $offset->limit ) ) { |
93 | - $paging['page_size'] = $offset->limit; |
|
93 | + $paging[ 'page_size' ] = $offset->limit; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | if ( ! empty( $offset->offset ) ) { |
97 | - $paging['offset'] = $offset->offset; |
|
97 | + $paging[ 'offset' ] = $offset->offset; |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | foreach ( \GFAPI::get_entries( $form->ID, $search_criteria, $sorting, $paging ) as $entry ) { |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | * @return bool Whether the offset exists or not. |
131 | 131 | */ |
132 | 132 | public function offsetExists( $offset ) { |
133 | - return isset( $this->form[$offset] ); |
|
133 | + return isset( $this->form[ $offset ] ); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | /** |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | * @return mixed The value of the requested form data. |
146 | 146 | */ |
147 | 147 | public function offsetGet( $offset ) { |
148 | - return $this->form[$offset]; |
|
148 | + return $this->form[ $offset ]; |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | /** |
@@ -12,10 +12,10 @@ discard block |
||
12 | 12 | add_action( 'gravityview_log_debug', array( $this, 'log_debug'), 10, 2 ); |
13 | 13 | |
14 | 14 | // Enable debug with Gravity Forms Logging Add-on |
15 | - add_filter( 'gform_logging_supported', array( $this, 'enable_gform_logging' ) ); |
|
15 | + add_filter( 'gform_logging_supported', array( $this, 'enable_gform_logging' ) ); |
|
16 | 16 | |
17 | - // Load Debug Bar integration |
|
18 | - add_filter( 'debug_bar_panels', array( $this, 'add_debug_bar' ) ); |
|
17 | + // Load Debug Bar integration |
|
18 | + add_filter( 'debug_bar_panels', array( $this, 'add_debug_bar' ) ); |
|
19 | 19 | |
20 | 20 | } |
21 | 21 | |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | * @param array $supported_plugins List of plugins |
45 | 45 | */ |
46 | 46 | public function enable_gform_logging( $supported_plugins ) { |
47 | - $supported_plugins['gravityview'] = 'GravityView'; |
|
48 | - return $supported_plugins; |
|
47 | + $supported_plugins['gravityview'] = 'GravityView'; |
|
48 | + return $supported_plugins; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -96,8 +96,8 @@ discard block |
||
96 | 96 | |
97 | 97 | if ( class_exists("GFLogging") ) { |
98 | 98 | GFLogging::include_logger(); |
99 | - GFLogging::log_message( 'gravityview', $function( $message, true ) . $function($data, true), KLogger::DEBUG ); |
|
100 | - } |
|
99 | + GFLogging::log_message( 'gravityview', $function( $message, true ) . $function($data, true), KLogger::DEBUG ); |
|
100 | + } |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | static function log_error( $message = '', $data = null ) { |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | } |
116 | 116 | |
117 | 117 | if ( class_exists("GFLogging") ) { |
118 | - GFLogging::include_logger(); |
|
119 | - GFLogging::log_message( 'gravityview', $function ( $message, true ) . $function ( $error, true), KLogger::ERROR ); |
|
118 | + GFLogging::include_logger(); |
|
119 | + GFLogging::log_message( 'gravityview', $function ( $message, true ) . $function ( $error, true), KLogger::ERROR ); |
|
120 | 120 | } |
121 | 121 | } |
122 | 122 |
@@ -7,9 +7,9 @@ discard block |
||
7 | 7 | |
8 | 8 | function __construct() { |
9 | 9 | |
10 | - add_action( 'gravityview_log_error', array( $this, 'log_error'), 10, 2 ); |
|
10 | + add_action( 'gravityview_log_error', array( $this, 'log_error' ), 10, 2 ); |
|
11 | 11 | |
12 | - add_action( 'gravityview_log_debug', array( $this, 'log_debug'), 10, 2 ); |
|
12 | + add_action( 'gravityview_log_debug', array( $this, 'log_debug' ), 10, 2 ); |
|
13 | 13 | |
14 | 14 | // Enable debug with Gravity Forms Logging Add-on |
15 | 15 | add_filter( 'gform_logging_supported', array( $this, 'enable_gform_logging' ) ); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | include_once( GRAVITYVIEW_DIR . 'includes/class-debug-bar.php' ); |
35 | 35 | } |
36 | 36 | |
37 | - $panels[] = new GravityView_Debug_Bar; |
|
37 | + $panels[ ] = new GravityView_Debug_Bar; |
|
38 | 38 | |
39 | 39 | return $panels; |
40 | 40 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @param array $supported_plugins List of plugins |
45 | 45 | */ |
46 | 46 | public function enable_gform_logging( $supported_plugins ) { |
47 | - $supported_plugins['gravityview'] = 'GravityView'; |
|
47 | + $supported_plugins[ 'gravityview' ] = 'GravityView'; |
|
48 | 48 | return $supported_plugins; |
49 | 49 | } |
50 | 50 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * @return string "print_r" or "var_export" |
73 | 73 | */ |
74 | 74 | static function get_print_function() { |
75 | - if( ob_get_level() > 0 ) { |
|
75 | + if ( ob_get_level() > 0 ) { |
|
76 | 76 | $function = 'var_export'; |
77 | 77 | } else { |
78 | 78 | $function = 'print_r'; |
@@ -90,17 +90,17 @@ discard block |
||
90 | 90 | 'data' => $data, |
91 | 91 | ); |
92 | 92 | |
93 | - if( !in_array( $notice, self::$notices ) ) { |
|
94 | - self::$notices[] = $notice; |
|
93 | + if ( ! in_array( $notice, self::$notices ) ) { |
|
94 | + self::$notices[ ] = $notice; |
|
95 | 95 | } |
96 | 96 | |
97 | - if ( class_exists("GFLogging") ) { |
|
97 | + if ( class_exists( "GFLogging" ) ) { |
|
98 | 98 | GFLogging::include_logger(); |
99 | - GFLogging::log_message( 'gravityview', $function( $message, true ) . $function($data, true), KLogger::DEBUG ); |
|
99 | + GFLogging::log_message( 'gravityview', $function( $message, true ) . $function( $data, true ), KLogger::DEBUG ); |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 | |
103 | - static function log_error( $message = '', $data = null ) { |
|
103 | + static function log_error( $message = '', $data = null ) { |
|
104 | 104 | |
105 | 105 | $function = self::get_print_function(); |
106 | 106 | |
@@ -110,13 +110,13 @@ discard block |
||
110 | 110 | 'backtrace' => function_exists( 'wp_debug_backtrace_summary' ) ? wp_debug_backtrace_summary( null, 3 ) : '', |
111 | 111 | ); |
112 | 112 | |
113 | - if( !in_array( $error, self::$errors ) ) { |
|
114 | - self::$errors[] = $error; |
|
113 | + if ( ! in_array( $error, self::$errors ) ) { |
|
114 | + self::$errors[ ] = $error; |
|
115 | 115 | } |
116 | 116 | |
117 | - if ( class_exists("GFLogging") ) { |
|
117 | + if ( class_exists( "GFLogging" ) ) { |
|
118 | 118 | GFLogging::include_logger(); |
119 | - GFLogging::log_message( 'gravityview', $function ( $message, true ) . $function ( $error, true), KLogger::ERROR ); |
|
119 | + GFLogging::log_message( 'gravityview', $function( $message, true ) . $function( $error, true ), KLogger::ERROR ); |
|
120 | 120 | } |
121 | 121 | } |
122 | 122 |