diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 8dd0e07..4df4fb9 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -75,14 +75,6 @@ parameters: count: 1 path: src/Domain/Models/Actions/FindModels.php - - - message: """ - #^Call to deprecated method getName\\(\\) of class Doctrine\\\\DBAL\\\\Types\\\\Type\\: - this method will be removed in Doctrine DBAL 4\\.0\\.$# - """ - count: 1 - path: src/Domain/Models/Actions/ResolveModelAttributes.php - - message: "#^PHPDoc tag @var contains generic class Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\Relation but does not specify its types\\: TRelatedModel$#" count: 1 diff --git a/src/Domain/Models/Actions/ResolveModelAttributes.php b/src/Domain/Models/Actions/ResolveModelAttributes.php index 9e250c4..c9dca56 100644 --- a/src/Domain/Models/Actions/ResolveModelAttributes.php +++ b/src/Domain/Models/Actions/ResolveModelAttributes.php @@ -2,6 +2,7 @@ namespace Soyhuce\NextIdeHelper\Domain\Models\Actions; +use Doctrine\DBAL\Types\Type; use Soyhuce\NextIdeHelper\Contracts\ModelResolver; use Soyhuce\NextIdeHelper\Domain\Models\AttributeTypeCaster; use Soyhuce\NextIdeHelper\Domain\Models\Entities\Attribute; @@ -16,7 +17,7 @@ public function execute(Model $model): void $typeCaster = new AttributeTypeCaster($model); foreach ($columns as $column) { - $attribute = new Attribute($column->getName(), $column->getType()->getName()); + $attribute = new Attribute($column->getName(), Type::getTypeRegistry()->lookupName($column->getType())); $attribute->inDatabase = true; if (!$column->getNotnull() && !$this->isLaravelTimestamp($model, $attribute)) { $attribute->nullable = true;