Skip to content

Commit efb208f

Browse files
committed
First set of PHPCS fixes in templates
1 parent 87b16ce commit efb208f

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

templates/block-php.mustache

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function {{machine_name}}_block_init() {
1818
return;
1919
}
2020
{{#plugin}}
21-
$dir = dirname( __FILE__ );
21+
$dir = __DIR__;
2222
{{/plugin}}
2323
{{#theme}}
2424
$dir = get_stylesheet_directory() . '/blocks';
@@ -38,7 +38,8 @@ function {{machine_name}}_block_init() {
3838
'wp-i18n',
3939
'wp-element',
4040
],
41-
filemtime( "{$dir}/{$index_js}" )
41+
filemtime( "{$dir}/{$index_js}" ),
42+
false
4243
);
4344

4445
$editor_css = '{{slug}}/editor.css';
@@ -67,11 +68,14 @@ function {{machine_name}}_block_init() {
6768
filemtime( "{$dir}/{$style_css}" )
6869
);
6970

70-
register_block_type( '{{namespace}}/{{slug}}', [
71-
'editor_script' => '{{slug}}-block-editor',
72-
'editor_style' => '{{slug}}-block-editor',
73-
'style' => '{{slug}}-block',
74-
] );
71+
register_block_type(
72+
'{{namespace}}/{{slug}}',
73+
[
74+
'editor_script' => '{{slug}}-block-editor',
75+
'editor_style' => '{{slug}}-block-editor',
76+
'style' => '{{slug}}-block',
77+
]
78+
);
7579
}
7680

7781
add_action( 'init', '{{machine_name}}_block_init' );

templates/plugin-bootstrap.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ require_once "{$_tests_dir}/includes/functions.php";
2929
* Manually load the plugin being tested.
3030
*/
3131
function _manually_load_plugin() {
32-
require dirname( dirname( __FILE__ ) ) . '/{{plugin_main_file}}';
32+
require dirname( __DIR__ ) . '/{{plugin_main_file}}';
3333
}
3434

3535
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );

0 commit comments

Comments
 (0)