Completed
Push — develop ( 8d260f...de26c7 )
by
unknown
15:30
created
future/includes/gutenberg/class-gv-gutenberg-blocks.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 				$block_class = array_values( array_diff( get_declared_classes(), $declared_classes ) );
57 57
 
58 58
 				if ( ! empty( $block_class ) ) {
59
-					$block_class = new $block_class[0]();
59
+					$block_class = new $block_class[ 0 ]();
60 60
 
61 61
 					if ( is_callable( [ $block_class, 'modify_block_meta' ] ) ) {
62 62
 						$block_meta = array_merge( $block_meta, $block_class->modify_block_meta( $block_meta ) );
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 				$localization_data = Arr::get( $block_meta, 'localization' );
67 67
 
68 68
 				if ( $localization_data ) {
69
-					add_filter( 'gk/gravityview/gutenberg/blocks/localization', function ( $localization ) use ( $block_name, $localization_data ) {
69
+					add_filter( 'gk/gravityview/gutenberg/blocks/localization', function( $localization ) use ( $block_name, $localization_data ) {
70 70
 						$localization[ $block_name ] = $localization_data;
71 71
 
72 72
 						return $localization;
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 					true
96 96
 				);
97 97
 
98
-				add_action( 'enqueue_block_editor_assets', function () use ( $editor_script_handle ) {
98
+				add_action( 'enqueue_block_editor_assets', function() use ( $editor_script_handle ) {
99 99
 					wp_enqueue_script( $editor_script_handle );
100 100
 
101 101
 					wp_set_script_translations( $editor_script_handle, 'gk-gravityview' );
@@ -106,11 +106,11 @@  discard block
 block discarded – undo
106 106
 				wp_register_style(
107 107
 					$editor_style_handle,
108 108
 					plugins_url( $editor_style, GRAVITYVIEW_FILE ),
109
-					[],
109
+					[ ],
110 110
 					filemtime( GRAVITYVIEW_DIR . $editor_style )
111 111
 				);
112 112
 
113
-				add_action( 'enqueue_block_editor_assets', function () use ( $editor_style_handle ) {
113
+				add_action( 'enqueue_block_editor_assets', function() use ( $editor_style_handle ) {
114 114
 					wp_enqueue_style( $editor_style_handle );
115 115
 				} );
116 116
 			}
@@ -119,11 +119,11 @@  discard block
 block discarded – undo
119 119
 				wp_register_style(
120 120
 					$global_style_handle,
121 121
 					plugins_url( $global_style, GRAVITYVIEW_FILE ),
122
-					[],
122
+					[ ],
123 123
 					filemtime( GRAVITYVIEW_DIR . $global_style )
124 124
 				);
125 125
 
126
-				add_action( 'enqueue_block_editor_assets', function () use ( $global_style_handle) {
126
+				add_action( 'enqueue_block_editor_assets', function() use ( $global_style_handle ) {
127 127
 					wp_enqueue_style( $global_style_handle );
128 128
 				} );
129 129
 			}
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 			'views'               => $this->get_views()
177 177
 		] );
178 178
 
179
-		wp_register_script( self::SLUG, false, [] );
179
+		wp_register_script( self::SLUG, false, [ ] );
180 180
 
181 181
 		wp_enqueue_script( self::SLUG );
182 182
 
@@ -200,9 +200,9 @@  discard block
 block discarded – undo
200 200
 			'order'   => 'ASC',
201 201
 		] );
202 202
 
203
-		$formatted_views = array_map( function ( $view ) {
203
+		$formatted_views = array_map( function( $view ) {
204 204
 			return [
205
-				'value' => (string) $view->ID,
205
+				'value' => (string)$view->ID,
206 206
 				'label' => sprintf(
207 207
 					'%s (#%s)',
208 208
 					$view->post_title ?: esc_html__( 'View', 'gk-gravityview' ),
@@ -253,13 +253,13 @@  discard block
 block discarded – undo
253 253
 		$newly_registered_styles  = array_diff( $styles_after_shortcode, $styles_before_shortcode );
254 254
 
255 255
 		// This will return an array of all dependencies sorted in the order they should be loaded.
256
-		$get_dependencies = function ( $handle, $source, $dependencies = [] ) use ( &$get_dependencies ) {
256
+		$get_dependencies = function( $handle, $source, $dependencies = [ ] ) use ( &$get_dependencies ) {
257 257
 			if ( empty( $source->registered[ $handle ] ) ) {
258 258
 				return $dependencies;
259 259
 			}
260 260
 
261
-			if ( $source->registered[ $handle ]->extra && ! empty( $source->registered[ $handle ]->extra['data'] ) ) {
262
-				array_unshift( $dependencies, array_filter( [ 'src' => $source->registered[ $handle ]->src, 'data' => $source->registered[ $handle ]->extra['data'] ] ) );
261
+			if ( $source->registered[ $handle ]->extra && ! empty( $source->registered[ $handle ]->extra[ 'data' ] ) ) {
262
+				array_unshift( $dependencies, array_filter( [ 'src' => $source->registered[ $handle ]->src, 'data' => $source->registered[ $handle ]->extra[ 'data' ] ] ) );
263 263
 			} else if ( $source->registered[ $handle ]->src ) {
264 264
 				array_unshift( $dependencies, $source->registered[ $handle ]->src );
265 265
 			}
@@ -275,12 +275,12 @@  discard block
 block discarded – undo
275 275
 			return array_flatten( $dependencies );
276 276
 		};
277 277
 
278
-		$script_dependencies = [];
278
+		$script_dependencies = [ ];
279 279
 		foreach ( $newly_registered_scripts as $script ) {
280 280
 			$script_dependencies = array_merge( $script_dependencies, $get_dependencies( $script, $wp_scripts ) );
281 281
 		}
282 282
 
283
-		$style_dependencies = [];
283
+		$style_dependencies = [ ];
284 284
 		foreach ( $newly_registered_styles as $style ) {
285 285
 			$style_dependencies = array_merge( $style_dependencies, $get_dependencies( $style, $wp_styles ) );
286 286
 		}
Please login to merge, or discard this patch.