Skip to content

Commit

Permalink
[9.x] Register cutInternals casters for particularly noisy objects (#…
Browse files Browse the repository at this point in the history
…44514)

* Add a few `defaultCasters` to var dumper

* formatting

Co-authored-by: Taylor Otwell <[email protected]>
  • Loading branch information
inxilpro and taylorotwell authored Oct 7, 2022
1 parent 18b341c commit dfb215e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Illuminate/Foundation/Providers/FoundationServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

namespace Illuminate\Foundation\Providers;

use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Contracts\Foundation\MaintenanceMode as MaintenanceModeContract;
use Illuminate\Contracts\View\Factory;
use Illuminate\Database\ConnectionInterface;
use Illuminate\Database\Grammar;
use Illuminate\Foundation\Console\CliDumper;
use Illuminate\Foundation\Http\HtmlDumper;
use Illuminate\Foundation\MaintenanceModeManager;
Expand All @@ -15,6 +20,8 @@
use Illuminate\Testing\LoggedExceptionCollection;
use Illuminate\Testing\ParallelTestingServiceProvider;
use Illuminate\Validation\ValidationException;
use Symfony\Component\VarDumper\Caster\StubCaster;
use Symfony\Component\VarDumper\Cloner\AbstractCloner;

class FoundationServiceProvider extends AggregateServiceProvider
{
Expand Down Expand Up @@ -74,6 +81,12 @@ public function register()
*/
public function registerDumper()
{
AbstractCloner::$defaultCasters[ConnectionInterface::class] = [StubCaster::class, 'cutInternals'];
AbstractCloner::$defaultCasters[Container::class] = [StubCaster::class, 'cutInternals'];
AbstractCloner::$defaultCasters[Dispatcher::class] = [StubCaster::class, 'cutInternals'];
AbstractCloner::$defaultCasters[Factory::class] = [StubCaster::class, 'cutInternals'];
AbstractCloner::$defaultCasters[Grammar::class] = [StubCaster::class, 'cutInternals'];

$basePath = $this->app->basePath();

$compiledViewPath = $this->app['config']->get('view.compiled');
Expand Down

0 comments on commit dfb215e

Please sign in to comment.