Skip to content

Commit bdf4c8a

Browse files
committed
Apply fixes from StyleCI
1 parent 3b3f9c6 commit bdf4c8a

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/Console/Commands/Views/PublishOrCreateViewBackpackCommand.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ abstract class PublishOrCreateViewBackpackCommand extends GeneratorCommand
1111
use \Backpack\CRUD\app\Console\Commands\Traits\PrettyCommandOutput;
1212

1313
/**
14-
* The source file to copy from.
14+
* The source file to copy from.
1515
*/
1616
public ?string $sourceFile = null;
1717

1818
/**
19-
* The source file view namespace
19+
* The source file view namespace.
2020
*/
2121
public ?string $sourceViewNamespace = null;
2222

@@ -53,12 +53,14 @@ public function handle()
5353
{
5454
$this->setupSourceFile();
5555

56-
if($this->sourceFile === false) { return false; }
56+
if ($this->sourceFile === false) {
57+
return false;
58+
}
5759

5860
$name = Str::of($this->getNameInput());
5961
$path = Str::of($this->getPath($name));
6062
$pathRelative = $path->after(base_path())->replace('\\', '/')->trim('/');
61-
63+
6264
$this->infoBlock("Creating {$name->replace('_', ' ')->title()} {$this->type}");
6365
$this->progressBlock("Creating view <fg=blue>{$pathRelative}</>");
6466

@@ -86,7 +88,7 @@ private function setupSourceFile()
8688
$namespaces = ViewNamespaces::getFor($this->viewNamespace);
8789
foreach ($namespaces as $namespace) {
8890
$viewPath = "$namespace.$from";
89-
91+
9092
if (view()->exists($viewPath)) {
9193
$this->sourceFile = view($viewPath)->getPath();
9294
$this->sourceViewNamespace = $viewPath;

src/Console/Commands/Views/WidgetBackpackCommand.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ class WidgetBackpackCommand extends PublishOrCreateViewBackpackCommand
5656
*/
5757
protected function getPath($name)
5858
{
59-
if($this->sourceViewNamespace) {
60-
$themePath = Str::contains($this->sourceViewNamespace, '::') ?
61-
Str::before($this->sourceViewNamespace, '::') :
62-
Str::beforeLast($this->sourceViewNamespace, '.');
59+
if ($this->sourceViewNamespace) {
60+
$themePath = Str::contains($this->sourceViewNamespace, '::') ?
61+
Str::before($this->sourceViewNamespace, '::') :
62+
Str::beforeLast($this->sourceViewNamespace, '.');
6363

6464
$themePath = Str::replace('.', '/', $themePath);
6565

@@ -71,6 +71,5 @@ protected function getPath($name)
7171
$path = 'views/vendor/backpack/ui/'.$this->viewNamespace.'/'.$name.'.blade.php';
7272

7373
return resource_path($path);
74-
7574
}
7675
}

0 commit comments

Comments
 (0)