Lint
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
Philipp Lang 2023-09-19 20:14:52 +02:00
parent e4ff680e4f
commit ff245397d5
5 changed files with 24 additions and 27 deletions

View File

@ -14,15 +14,27 @@ class Subactivity extends Model
use HasNamiField;
use Sluggable;
/**
* @var array<int, string>
*/
public $fillable = ['is_age_group', 'is_filterable', 'slug', 'name', 'nami_id'];
/**
* @var bool
*/
public $timestamps = false;
/**
* @var array<string, string>
*/
public $casts = [
'is_age_group' => 'boolean',
'is_filterable' => 'boolean',
];
/**
* @return array<string, array{source: string}>
*/
public function sluggable(): array
{
return [

View File

@ -34,7 +34,7 @@ class SubactivityFactory extends Factory
/**
* Define the model's default state.
*
* @return array
* @return array<string, mixed>
*/
public function definition()
{

View File

@ -163,11 +163,6 @@ parameters:
count: 1
path: app/Providers/AuthServiceProvider.php
-
message: "#^Method App\\\\Subactivity\\:\\:sluggable\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: app/Subactivity.php
-
message: "#^Method Database\\\\Factories\\\\ActivityFactory\\:\\:definition\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
@ -198,32 +193,12 @@ parameters:
count: 1
path: database/factories/Payment/StatusFactory.php
-
message: "#^Method Database\\\\Factories\\\\SubactivityFactory\\:\\:definition\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: database/factories/SubactivityFactory.php
-
message: "#^Call to an undefined method Phake\\\\Proxies\\\\StubberProxy.*#"
-
message: "#^Call to an undefined method Phake\\\\Proxies\\\\VerifierProxy.*#"
-
message: "#^Method Tests\\\\Feature\\\\Member\\\\StoreTest\\:\\:attributes\\(\\) has parameter \\$overwrites with no value type specified in iterable type array\\.$#"
count: 1
path: tests/Feature/Member/StoreTest.php
-
message: "#^Method Tests\\\\Feature\\\\Member\\\\StoreTest\\:\\:attributes\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: tests/Feature/Member/StoreTest.php
-
message: "#^Method Tests\\\\Feature\\\\Member\\\\StoreTest\\:\\:defaults\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: tests/Feature/Member/StoreTest.php
-
message: "#^PHPDoc tag @param has invalid value \\(\\<class\\-string\\> \\$class\\)\\: Unexpected token \"\\<\", expected type at offset 18$#"
count: 1

View File

@ -211,6 +211,9 @@ class StoreTest extends TestCase
->assertSessionHasErrors(['subscription_id' => 'Beitragsart ist erforderlich.']);
}
/**
* @return array<string, mixed>
*/
public function defaults(): array
{
$country = Country::factory()->create();

View File

@ -4,8 +4,15 @@ namespace Tests\Lib;
trait MergesAttributes
{
abstract public function defaults();
/**
* @return array<string, mixed>
*/
abstract public function defaults(): array;
/**
* @param array<string, mixed> $overwrites
* @return array<string, mixed>
*/
public function attributes(?array $overwrites = []): array
{
$defaults = collect($this->defaults());