Skip to content

Commit

Permalink
PHPStan fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
LastDragon-ru committed Jul 13, 2024
1 parent 16686b9 commit ff8650a
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 21 deletions.
9 changes: 4 additions & 5 deletions packages/eloquent/src/Testing/Package/Models/TestObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace LastDragon_ru\LaraASP\Eloquent\Testing\Package\Models;

use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use LastDragon_ru\LaraASP\Eloquent\Concerns\WithoutTimestamps;
Expand All @@ -11,6 +10,9 @@
* @internal
*/
class TestObject extends Model {
/**
* @use HasFactory<TestObjectFactory>
*/
use HasFactory;
use WithoutTimestamps;

Expand All @@ -20,10 +22,7 @@ class TestObject extends Model {
*/
protected $table = 'test_objects';

/**
* @return Factory<self>
*/
protected static function newFactory(): Factory {
protected static function newFactory(): TestObjectFactory {
return TestObjectFactory::new();
}
}
2 changes: 1 addition & 1 deletion packages/graphql/src/Stream/Directives/Directive.php
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ public function getResolverClass(ResolverProvider $provider, FieldValue $value,
}

/**
* @return Closure(mixed, array<string, mixed>, GraphQLContext, ResolveInfo): EloquentBuilder<EloquentModel>
* @return Closure(mixed,array<string,mixed>,GraphQLContext,ResolveInfo):EloquentBuilder<covariant EloquentModel>
*/
protected function getResolverModel(string $model): Closure {
$class = $this->namespaceModelClass($model);
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql/src/Stream/Directives/OffsetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static function dataProviderGetFieldArgumentValue(): array {
// <editor-fold desc="Helpers">
// =========================================================================
/**
* @param array<int, string|int> $path
* @param list<string|int> $path
*/
private static function getResolveInfo(array $path): ResolveInfo {
$info = Mockery::mock(ResolveInfo::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace LastDragon_ru\LaraASP\GraphQL\Testing\Package\Data\Models;

use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use LastDragon_ru\LaraASP\Eloquent\Concerns\WithoutTimestamps;
Expand All @@ -14,6 +13,9 @@
* @property string $value
*/
class TestObject extends Model {
/**
* @use HasFactory<TestObjectFactory>
*/
use HasFactory;
use WithoutTimestamps;

Expand All @@ -35,10 +37,7 @@ class TestObject extends Model {
*/
public $incrementing = false;

/**
* @return Factory<self>
*/
protected static function newFactory(): Factory {
protected static function newFactory(): TestObjectFactory {
return TestObjectFactory::new();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace LastDragon_ru\LaraASP\GraphQL\Testing\Package\Data\Models;

use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Laravel\Scout\Searchable;
Expand All @@ -15,8 +14,11 @@
* @property string $value
*/
class TestObjectSearchable extends Model {
use Searchable;
/**
* @use HasFactory<TestObjectSearchableFactory>
*/
use HasFactory;
use Searchable;
use WithoutTimestamps;

/**
Expand All @@ -37,10 +39,7 @@ class TestObjectSearchable extends Model {
*/
public $incrementing = false;

/**
* @return Factory<self>
*/
protected static function newFactory(): Factory {
protected static function newFactory(): TestObjectSearchableFactory {
return TestObjectSearchableFactory::new();
}
}
4 changes: 1 addition & 3 deletions packages/migrator/src/Extenders/SmartMigrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ public static function create(Migrator $migrator): self {
// =========================================================================
/**
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
*
* @inheritDoc
* @param array<array-key, mixed>|string $paths
*
* @return array<array-key, string>
*/
#[Override]
public function getMigrationFiles($paths): array {
Expand Down

0 comments on commit ff8650a

Please sign in to comment.