Skip to content

Commit afd2401

Browse files
committed
Remove redundant guard clause
These were needed before Laravel 9, but since this package version requires Laravel 12/13, they are no longer necessary.
1 parent 134656b commit afd2401

3 files changed

Lines changed: 1 addition & 23 deletions

File tree

src/PermissionServiceProvider.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,6 @@ protected function registerOctaneListener(): void
135135

136136
protected function registerAbout(): void
137137
{
138-
if (! class_exists(InstalledVersions::class) || ! class_exists(AboutCommand::class)) {
139-
return;
140-
}
141-
142138
// array format: 'Display Text' => 'boolean-config-key name'
143139
$features = [
144140
'Teams' => 'teams',

tests/Commands/CommandTest.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
use Composer\InstalledVersions;
4-
use Illuminate\Foundation\Console\AboutCommand;
53
use Illuminate\Support\Facades\Artisan;
64
use Spatie\Permission\Models\Permission;
75
use Spatie\Permission\Models\Role;
@@ -214,13 +212,6 @@
214212
});
215213

216214
it('can respond to about command with default', function () {
217-
if (! class_exists(InstalledVersions::class) || ! class_exists(AboutCommand::class)) {
218-
$this->markTestSkipped();
219-
}
220-
if (! method_exists(AboutCommand::class, 'flushState')) {
221-
$this->markTestSkipped();
222-
}
223-
224215
app(PermissionRegistrar::class)->initializeCache();
225216

226217
Artisan::call('about');
@@ -231,13 +222,6 @@
231222
});
232223

233224
it('can respond to about command with teams', function () {
234-
if (! class_exists(InstalledVersions::class) || ! class_exists(AboutCommand::class)) {
235-
$this->markTestSkipped();
236-
}
237-
if (! method_exists(AboutCommand::class, 'flushState')) {
238-
$this->markTestSkipped();
239-
}
240-
241225
app(PermissionRegistrar::class)->initializeCache();
242226

243227
config()->set('permission.teams', true);

tests/TestSupport/TestCase.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ protected function tearDown(): void
7474
{
7575
parent::tearDown();
7676

77-
if (method_exists(AboutCommand::class, 'flushState')) {
78-
AboutCommand::flushState();
79-
}
77+
AboutCommand::flushState();
8078
}
8179

8280
/**

0 commit comments

Comments
 (0)