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
<?php is_subclass_of(mixed $object_or_class, string $class, bool $allow_string = true): bool
<?php             throw new JsonResourceException("[{$bindable}] is not a valid Statamic API resource");

        }



        if (! is_subclass_of($class, JsonResource::class)) {

            throw new JsonResourceException("[{$class}] must be a subclass of ".JsonResource::class);

        }

    }
<?php         foreach ($this->app['files']->files($path) as $file) {

            $class = $file->getBasename('.php');

            $fqcn = $this->app->getNamespace()."{$folder}\\{$class}";

            if (is_subclass_of($fqcn, $requiredClass)) {

                $fqcn::register();

            }

        }