Skip to content

Commit 2b56d0b

Browse files
committed
refactor: remove AbacResourceModel and disable PHPStan unused-trait check
1 parent e544b2b commit 2b56d0b

32 files changed

Lines changed: 217 additions & 388 deletions

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jobs:
1818
- name: Setup PHP
1919
uses: shivammathur/setup-php@v2
2020
with:
21-
php-version: '8.3'
2221
tools: composer:v2
2322
coverage: none
2423

database/factories/AbacCheckFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class AbacCheckFactory extends Factory
1515
public function definition(): array
1616
{
1717
return [
18-
'operator' => $this->faker->randomElement(AllOperators::values(LogicalOperators::cases())),
18+
'operator' => $this->faker->randomElement(AllOperators::values([LogicalOperators::class])),
1919
'chain_id' => AbacChain::factory()->create()->id,
2020
'key' => $this->faker->word,
2121
'value' => $this->faker->word,

database/migrations/create_abac_tables.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function up(): void
5353
$table->id();
5454
$table->timestamps();
5555
$table->foreignId('chain_id')->constrained('abac_chains')->cascadeOnDelete();
56-
$table->enum('operator', AllOperators::values(LogicalOperators::cases()));
56+
$table->enum('operator', AllOperators::values([LogicalOperators::class]));
5757
$table->string('key');
5858
$table->string('value');
5959
});

phpstan-baseline.neon

Lines changed: 0 additions & 295 deletions
This file was deleted.

phpstan.neon.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
includes:
22
- vendor/larastan/larastan/extension.neon
3-
- phpstan-baseline.neon
43

54
parameters:
65
paths:

src/Commands/PublishAbacEnvCommand.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ class PublishAbacEnvCommand extends Command
1414

1515
protected $description = 'Publish ABAC environment variables';
1616

17+
/**
18+
* @var array<string, scalar>
19+
*/
1720
private array $envVariables;
1821

1922
public function __construct()

src/Commands/ScaffoldAbacPoliciesCommand.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,14 @@ public function handle(): void
5050
],
5151
];
5252

53-
$targetPath = resource_path($this->option('path'));
53+
$pathOption = $this->option('path');
54+
if (! is_string($pathOption) || $pathOption === '') {
55+
$this->error('Invalid --path option provided.');
56+
57+
return;
58+
}
59+
60+
$targetPath = resource_path($pathOption);
5461
if (File::exists($targetPath) && ! $this->option('force')) {
5562
$this->error("File already exists: $targetPath (use --force to overwrite)");
5663

0 commit comments

Comments
 (0)