Skip to content

Commit

Permalink
Apply fixes from StyleCI (#1304)
Browse files Browse the repository at this point in the history
  • Loading branch information
austintoddj authored Jun 22, 2023
1 parent 391a7f8 commit 13a020f
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/Console/UiCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ public function handle()
$this->updateNodeScripts(function ($scripts) {
return [
'canvas.ui.dev' => 'mix',
'canvas.ui.prod' => 'mix --production'
'canvas.ui.prod' => 'mix --production',
] + $scripts;
});

// Sass configuration...
copy(dirname(__DIR__, 2) . '/resources/sass/ui.scss', resource_path('sass/canvas-ui.scss'));
copy(dirname(__DIR__, 2).'/resources/sass/ui.scss', resource_path('sass/canvas-ui.scss'));

// Single page application...
(new Filesystem)->copyDirectory(dirname(__DIR__, 2) . '/resources/js/ui', resource_path('js/canvas-ui'));
(new Filesystem)->copyDirectory(dirname(__DIR__, 2).'/resources/js/ui', resource_path('js/canvas-ui'));

$this->updateWebpackConfiguration();
$this->flushNodeModules();
Expand All @@ -90,7 +90,7 @@ public function handle()
*/
protected function updateNodePackages(callable $callback, $dev = true)
{
if (!file_exists(base_path('package.json'))) {
if (! file_exists(base_path('package.json'))) {
return;
}

Expand All @@ -107,7 +107,7 @@ protected function updateNodePackages(callable $callback, $dev = true)

file_put_contents(
base_path('package.json'),
json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT) . PHP_EOL
json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL
);
}

Expand All @@ -120,7 +120,7 @@ protected function updateNodePackages(callable $callback, $dev = true)
*/
protected function updateNodeScripts(callable $callback)
{
if (!file_exists(base_path('package.json'))) {
if (! file_exists(base_path('package.json'))) {
return;
}

Expand All @@ -137,7 +137,7 @@ protected function updateNodeScripts(callable $callback)

file_put_contents(
base_path('package.json'),
json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT) . PHP_EOL
json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL
);
}

Expand All @@ -148,13 +148,13 @@ protected function updateNodeScripts(callable $callback)
*/
protected function exportViews()
{
if (file_exists($view = $this->getViewPath('canvas-ui.blade.php')) && !$this->option('force')) {
if (!$this->confirm('The [canvas-ui.blade.php] view already exists. Do you want to replace it?')) {
if (file_exists($view = $this->getViewPath('canvas-ui.blade.php')) && ! $this->option('force')) {
if (! $this->confirm('The [canvas-ui.blade.php] view already exists. Do you want to replace it?')) {
return;
}
}

copy(dirname(__DIR__, 2) . '/resources/views/ui.blade.php', $view);
copy(dirname(__DIR__, 2).'/resources/views/ui.blade.php', $view);
}

/**
Expand All @@ -169,13 +169,13 @@ protected function exportBackend()
str_replace(
'{{namespace}}',
$this->laravel->getNamespace(),
file_get_contents(dirname(__DIR__, 2) . '/resources/stubs/controllers/CanvasUiController.stub')
file_get_contents(dirname(__DIR__, 2).'/resources/stubs/controllers/CanvasUiController.stub')
)
);

file_put_contents(
base_path('routes/web.php'),
file_get_contents(dirname(__DIR__, 2) . '/resources/stubs/routes/web.stub'),
file_get_contents(dirname(__DIR__, 2).'/resources/stubs/routes/web.stub'),
FILE_APPEND
);
}
Expand Down Expand Up @@ -217,7 +217,7 @@ protected function updateWebpackConfiguration()
{
file_put_contents(
base_path('webpack.mix.js'),
file_get_contents(dirname(__DIR__, 2) . '/resources/stubs/webpack.mix.stub'),
file_get_contents(dirname(__DIR__, 2).'/resources/stubs/webpack.mix.stub'),
FILE_APPEND
);
}
Expand Down

0 comments on commit 13a020f

Please sign in to comment.