method_exists

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Checks if the class method exists
<?php method_exists(object|string $object_or_class, string $method): bool
<?php             return;

        }



        if (method_exists($event->sandbox['log']->driver(), 'withoutContext')) {

            $event->sandbox['log']->withoutContext();

        }

    }
<?php     public function handle($event): void

    {

        if (method_exists($event->app, 'resetScope')) {

            $event->app->resetScope();

        }
<?php     public function handle($event): void

    {

        if (! $event->sandbox->resolved('db') ||

            ! method_exists($event->sandbox->make('db'), 'setApplication')) {

            return;

        }
<?php         $handler = $event->sandbox->make('session')->driver()->getHandler();



        if (! $handler instanceof DatabaseSessionHandler ||

            ! method_exists($handler, 'setContainer')) {

            return;

        }
<?php         $factory = $event->sandbox->make(ResponseFactory::class);



        if (method_exists($factory, 'flushShared')) {

            $factory->flushShared();

        }

    }
<?php         $factory = $event->sandbox->make(EngineManager::class);



        if (! method_exists($factory, 'forgetEngines')) {

            return;

        }
<?php         $factory = $event->sandbox->make(Factory::class);



        if (! method_exists($factory, 'forgetDrivers')) {

            return;

        }