Skip to content

Commit

Permalink
Fix issue with vardumper
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenvanassche committed Aug 13, 2024
1 parent 614ee5e commit c5bb5d8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Support/VarDumper/VarDumperManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

namespace Spatie\LaravelData\Support\VarDumper;

use Spatie\LaravelData\Contracts\BaseData;
use Spatie\LaravelData\Contracts\BaseDataCollectable;
use Spatie\LaravelData\Contracts\TransformableData;
use Symfony\Component\VarDumper\Cloner\AbstractCloner;

class VarDumperManager
{
public function initialize(): void
{
AbstractCloner::$defaultCasters[BaseData::class] = [DataVarDumperCaster::class, 'castDataObject'];
AbstractCloner::$defaultCasters[BaseDataCollectable::class] = [DataVarDumperCaster::class, 'castDataCollectable'];
AbstractCloner::$defaultCasters[TransformableData::class] = [DataVarDumperCaster::class, 'castDataObject'];
AbstractCloner::$defaultCasters[TransformableData::class] = [DataVarDumperCaster::class, 'castDataCollectable'];
}
}

0 comments on commit c5bb5d8

Please sign in to comment.