Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add weak generics for array type objects #1621

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Console/ModelsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ public function castPropertiesType($model)
break;
case 'array':
case 'json':
$realType = 'array';
$realType = 'array<array-key, mixed>';
break;
case 'object':
$realType = 'object';
Expand All @@ -413,10 +413,10 @@ public function castPropertiesType($model)
$realType = '\Carbon\CarbonImmutable';
break;
case 'collection':
$realType = '\Illuminate\Support\Collection';
$realType = '\Illuminate\Support\Collection<array-key, mixed>';
break;
case AsArrayObject::class:
$realType = '\ArrayObject';
$realType = '\ArrayObject<array-key, mixed>';
break;
default:
// In case of an optional custom cast parameter , only evaluate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
* @property \Carbon\CarbonImmutable $cast_to_immutable_datetime
* @property int $cast_to_timestamp
* @property mixed $cast_to_encrypted
* @property array $cast_to_encrypted_array
* @property \Illuminate\Support\Collection $cast_to_encrypted_collection
* @property array $cast_to_encrypted_json
* @property array<array-key, mixed> $cast_to_encrypted_array
* @property \Illuminate\Support\Collection<array-key, mixed> $cast_to_encrypted_collection
* @property array<array-key, mixed> $cast_to_encrypted_json
* @property object $cast_to_encrypted_object
* @property \Illuminate\Support\Collection $cast_to_as_collection
* @property \Illuminate\Support\Collection $cast_to_as_enum_collection
* @property \ArrayObject $cast_to_as_array_object
* @property \ArrayObject<array-key, mixed> $cast_to_as_array_object
* @property AdvancedCastCollection $cast_to_as_collection_using
* @property \Illuminate\Support\Collection<int, AdvancedCastEnum> $cast_to_as_enum_collection_of
* @method static \Illuminate\Database\Eloquent\Builder<static>|AdvancedCast newModelQuery()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
* @property bool $cast_to_bool
* @property bool $cast_to_boolean
* @property object $cast_to_object
* @property array $cast_to_array
* @property array $cast_to_json
* @property \Illuminate\Support\Collection $cast_to_collection
* @property array<array-key, mixed> $cast_to_array
* @property array<array-key, mixed> $cast_to_json
* @property \Illuminate\Support\Collection<array-key, mixed> $cast_to_collection
* @property \Illuminate\Support\Carbon $cast_to_date
* @property \Illuminate\Support\Carbon $cast_to_datetime
* @property \Illuminate\Support\Carbon $cast_to_date_serialization
Expand All @@ -34,9 +34,9 @@
* @property \Carbon\CarbonImmutable $cast_to_immutable_datetime_serialization
* @property int $cast_to_timestamp
* @property mixed $cast_to_encrypted
* @property array $cast_to_encrypted_array
* @property \Illuminate\Support\Collection $cast_to_encrypted_collection
* @property array $cast_to_encrypted_json
* @property array<array-key, mixed> $cast_to_encrypted_array
* @property \Illuminate\Support\Collection<array-key, mixed> $cast_to_encrypted_collection
* @property array<array-key, mixed> $cast_to_encrypted_json
* @property object $cast_to_encrypted_object
* @method static \Illuminate\Database\Eloquent\Builder<static>|SimpleCast newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|SimpleCast newQuery()
Expand Down