Skip to content

Commit 562fed6

Browse files
committed
QA: don't unnecessarily use array_merge()
`array_merge()` is a "heavy" function in PHP and is not actually needed to achieve the desired result in this case.
1 parent fc0b5d8 commit 562fed6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Scaffold_Command.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,8 @@ private function _scaffold( $slug, $assoc_args, $defaults, $subdir, $templates )
173173
$raw_output = self::mustache_render( $raw_template, $vars );
174174

175175
if ( ! $control_args['raw'] ) {
176-
$vars = array_merge( $vars, array(
177-
'machine_name' => $machine_name,
178-
'output' => $raw_output,
179-
) );
176+
$vars['machine_name'] = $machine_name;
177+
$vars['output'] = $raw_output;
180178

181179
$final_output = self::mustache_render( $extended_template, $vars );
182180
} else {

0 commit comments

Comments
 (0)