Skip to content

Commit 70ca395

Browse files
Simplified HasAbout trait
1 parent 35d73e7 commit 70ca395

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/Concerns/HasAbout.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,12 @@
55
namespace DragonCode\LaravelDeployOperations\Concerns;
66

77
use Composer\InstalledVersions;
8-
use DragonCode\Support\Facades\Helpers\Arr;
98
use DragonCode\Support\Facades\Helpers\Str;
109
use Illuminate\Foundation\Console\AboutCommand;
1110

1211
trait HasAbout
1312
{
14-
protected string $composer = __DIR__ . '/../../composer.json';
15-
16-
protected ?string $packageName = null;
13+
protected string $packageName = 'dragon-code/laravel-deploy-operations';
1714

1815
protected function registerAbout(): void
1916
{
@@ -24,7 +21,7 @@ protected function registerAbout(): void
2421

2522
protected function getPackageName(): string
2623
{
27-
return Str::of($this->loadPackageName())
24+
return Str::of($this->packageName)
2825
->after('/')
2926
->snake()
3027
->replace('_', ' ')
@@ -34,11 +31,6 @@ protected function getPackageName(): string
3431

3532
protected function getPackageVersion(): string
3633
{
37-
return InstalledVersions::getPrettyVersion($this->loadPackageName());
38-
}
39-
40-
protected function loadPackageName(): string
41-
{
42-
return $this->packageName ??= Arr::ofFile($this->composer)->get('name');
34+
return InstalledVersions::getPrettyVersion($this->packageName);
4335
}
4436
}

0 commit comments

Comments
 (0)