You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Comments in the related issue also experience this
↪️ To Reproduce
Create new package
Create dto
Try convert to array
class BaseData extends Data
{
publicfunction__construct(
publicbool$something,
) {
}
}
$data = BaseData::fromArray([
'something' => false,
]);
$data->toArray(); // Error is thrown here
Spatie\LaravelData\Support\Transformation\TransformationContext::__construct(): Argument #11 ($throwWhenMaxDepthReached) must be of type bool, null given, called in /***/vendor/spatie/laravel-data/src/Concerns/TransformableData.php on line 24
✅ Expected behavior
DTO to be converted to Array successfully
🖥️ Versions
Laravel: 11
Laravel Data: 4.4.1
PHP: 8.3
The text was updated successfully, but these errors were encountered:
✏️ Describe the bug
Seems that in packages that require laravel-data, we have to set the following for tests to work.
Related to: #699
↪️ To Reproduce
Create new package
Create dto
Try convert to array
Spatie\LaravelData\Support\Transformation\TransformationContext::__construct(): Argument #11 ($throwWhenMaxDepthReached) must be of type bool, null given, called in /***/vendor/spatie/laravel-data/src/Concerns/TransformableData.php on line 24
✅ Expected behavior
DTO to be converted to Array successfully
🖥️ Versions
Laravel: 11
Laravel Data: 4.4.1
PHP: 8.3
The text was updated successfully, but these errors were encountered: