Skip to content

Commit a6542b0

Browse files
committed
formatting
1 parent a6d2705 commit a6542b0

File tree

1 file changed

+7
-5
lines changed
  • src/Illuminate/Foundation/Console/Presets

1 file changed

+7
-5
lines changed

Diff for: src/Illuminate/Foundation/Console/Presets/Preset.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,24 @@ protected static function ensureComponentDirectoryExists()
2323
/**
2424
* Update the "package.json" file.
2525
*
26+
* @param bool $dev
2627
* @return void
2728
*/
28-
protected static function updatePackages($devDependency = true)
29+
protected static function updatePackages($dev = true)
2930
{
3031
if (! file_exists(base_path('package.json'))) {
3132
return;
3233
}
3334

34-
$dependenciesBlock = $devDependency ? 'devDependencies' : 'dependencies';
35+
$configurationKey = $dev ? 'devDependencies' : 'dependencies';
36+
3537
$packages = json_decode(file_get_contents(base_path('package.json')), true);
3638

37-
$packages[$dependenciesBlock] = static::updatePackageArray(
38-
array_key_exists($dependenciesBlock, $packages) ? $packages[$dependenciesBlock] : []
39+
$packages[$configurationKey] = static::updatePackageArray(
40+
array_key_exists($configurationKey, $packages) ? $packages[$configurationKey] : []
3941
);
4042

41-
ksort($packages[$dependenciesBlock]);
43+
ksort($packages[$configurationKey]);
4244

4345
file_put_contents(
4446
base_path('package.json'),

0 commit comments

Comments
 (0)