Skip to content

Commit 8ae6a67

Browse files
committed
rename InspireCmsManager
1 parent ef14f96 commit 8ae6a67

6 files changed

Lines changed: 19 additions & 16 deletions

File tree

src/CmsPanelProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ protected function configureTourGuideElements(Panel $panel): Panel
178178
'aria-label' => 'Reset Tour Guide',
179179
], true),
180180
\SolutionForest\InspireCms\Filament\Navigation\MenuItem::make()
181-
->label('Version: ' . InspireCmsConfig::getVersion())
181+
->label('Version: ' . InspireCms::version())
182182
->icon('heroicon-s-information-circle')
183183
->url('#')
184184
->extraAttributes([

src/Facades/InspireCms.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Illuminate\Support\Facades\Facade;
66

77
/**
8+
* @method static ?stirng version()
89
* @method static bool needInstall() Determine if there is a need to go to the install page
910
* @method static ?string getInstallUrl()
1011
* @method static ?string getImportDataUrl()
@@ -19,7 +20,7 @@
1920
* @method static array getContentRoutes()
2021
* @method static void forgetCachedContentRoutes()
2122
*
22-
* @see \SolutionForest\InspireCms\InspireCmsManager
23+
* @see \SolutionForest\InspireCms\InspireCms
2324
*/
2425
class InspireCms extends Facade
2526
{
@@ -28,6 +29,6 @@ class InspireCms extends Facade
2829
*/
2930
protected static function getFacadeAccessor()
3031
{
31-
return \SolutionForest\InspireCms\InspireCmsManager::class;
32+
return \SolutionForest\InspireCms\InspireCms::class;
3233
}
3334
}
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace SolutionForest\InspireCms;
44

5+
use Composer\InstalledVersions;
56
use Filament\Facades\Filament;
67
use Illuminate\Auth\EloquentUserProvider;
78
use Illuminate\Cache\CacheManager;
@@ -19,8 +20,11 @@
1920
use SolutionForest\InspireCms\Models\Contracts\Language;
2021
use Symfony\Component\Routing\Exception\RouteNotFoundException;
2122

22-
class InspireCmsManager
23+
class InspireCms
2324
{
25+
const CORE_SLUG = 'inspirecms';
26+
const PACKAGE = 'solution-forest/inspirecms-core';
27+
2428
protected CacheManager $cacheManager;
2529

2630
protected Collection $sections;
@@ -38,6 +42,11 @@ public function __construct(CacheManager $cacheManager)
3842
$this->sections = collect(InspireCmsConfig::get('filament.clusters'))->map(fn ($fqcn, $name) => new ClusterSection($name, $fqcn));
3943
}
4044

45+
public static function version(): string|null
46+
{
47+
return InstalledVersions::getPrettyVersion(static::PACKAGE);
48+
}
49+
4150
/**
4251
* Determine if there is a need to go to the install page
4352
*/

src/InspireCmsConfig.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace SolutionForest\InspireCms;
44

5-
use Composer\InstalledVersions;
65
use Illuminate\Database\Eloquent\Model;
76
use SolutionForest\InspireCms\Facades\ModelManifest;
87
use SolutionForest\InspireCms\Support\Models as SupportModels;
@@ -20,11 +19,6 @@ public static function set(string $key, mixed $value): void
2019
config()->set("inspirecms.{$key}", $value);
2120
}
2221

23-
public static function getVersion(): string
24-
{
25-
return InstalledVersions::getPrettyVersion('solution-forest/inspirecms-core');
26-
}
27-
2822
public static function getGuardName(): string
2923
{
3024
return static::get('auth.guard.name', 'inspirecms');

src/InspireCmsServiceProvider.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace SolutionForest\InspireCms;
44

5-
use Composer\InstalledVersions;
65
use Filament\Http\Responses\Auth\Contracts\RegistrationResponse as RegistrationResponseContract;
76
use Filament\Support\Assets\Asset;
87
use Filament\Support\Assets\Js;
@@ -34,9 +33,9 @@
3433

3534
class InspireCmsServiceProvider extends PackageServiceProvider
3635
{
37-
public static string $name = 'inspirecms';
36+
public static string $name = InspireCms::CORE_SLUG;
3837

39-
public static string $viewNamespace = 'inspirecms';
38+
public static string $viewNamespace = InspireCms::CORE_SLUG;
4039

4140
public function configurePackage(Package $package): void
4241
{
@@ -579,7 +578,7 @@ private function addAboutPluginInfo()
579578
$currentTheme = inspirecms_templates()->getCurrentTheme();
580579

581580
AboutCommand::add('InspireCms', fn () => [
582-
'Version' => InstalledVersions::getPrettyVersion('solution-forest/inspirecms-core'),
581+
'Version' => InspireCms::version(),
583582
'Theme' => filled($currentTheme)
584583
? "<fg=green;options=bold>{$currentTheme}</>"
585584
: '<fg=yellow;options=bold>NOT SET</>',

src/helpers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77

88
if (! function_exists('inspirecms')) {
99
/**
10-
* @return \SolutionForest\InspireCms\InspireCmsManager
10+
* @return \SolutionForest\InspireCms\InspireCms
1111
*/
1212
function inspirecms()
1313
{
14-
return app(\SolutionForest\InspireCms\InspireCmsManager::class);
14+
return app(\SolutionForest\InspireCms\InspireCms::class);
1515
}
1616
}
1717

0 commit comments

Comments
 (0)