is_subclass_of

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Checks if the object has this class as one of its parents or implements it
is_subclass_of(mixed $object_or_classstring $classbool $allow_string true): bool
        }



        foreach (
$this->policies as $expected => $policy) {

            if (
is_subclass_of($class$expected)) {

                return 
$this->resolvePolicy($policy);

            }

        }
    protected function parseCommand($command$parameters)

    {

        if (
is_subclass_of($commandSymfonyCommand::class)) {

            
$callingClass true;



            
$command $this->laravel->make($command)->getName();
    public function resolve($command)

    {

        if (
is_subclass_of($commandSymfonyCommand::class) && ($commandName $command::getDefaultName())) {

            
$this->commandMap[$commandName] = $command;



            return 
null;
        $this->fireBeforeCallbackArray($abstract$parameters$this->globalBeforeResolvingCallbacks);



        foreach (
$this->beforeResolvingCallbacks as $type => $callbacks) {

            if (
$type === $abstract || is_subclass_of($abstract$type)) {

                
$this->fireBeforeCallbackArray($abstract$parameters$callbacks);

            }

        }
            $arguments explode(','$segments[1]);

        }



        if (
is_subclass_of($castTypeCastable::class)) {

            
$castType $castType::castUsing($arguments);

        }
        }



        foreach (static::
$ignoreOnTouch as $ignoredClass) {

            if (
$class === $ignoredClass || is_subclass_of($class$ignoredClass)) {

                return 
true;

            }

        }
                Str::after($command->getRealPath(), realpath(app_path()).DIRECTORY_SEPARATOR)

            );



            if (
is_subclass_of($commandCommand::class) &&

                ! (new 
ReflectionClass($command))->isAbstract()) {

                
Artisan::starting(function ($artisan) use ($command) {

                    
$artisan->resolve($command);
    protected function newModelFor($table)

    {

        return 
is_subclass_of($tableModel::class) ? (new $table) : null;

    }
    protected function wasDispatched($needle, array $haystack)

    {

        foreach (
$haystack as $dispatched) {

            if ((
is_string($dispatched) && ($dispatched === $needle || is_subclass_of($dispatched$needle))) ||

                
$dispatched instanceof $needle) {

                return 
true;

            }
            return $table;

        }



        if (
is_subclass_of($tableModel::class)) {

            
$model = new $table;



            if (
str_contains($model->getTable(), '.')) {