is_a

Supported Versions: PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8
Checks whether the object is of a given type or subtype
<?php is_a(mixed $object_or_class, string $class, bool $allow_string = false): bool
<?php         $failed = $this->failedRules() ?: [];

        $failedRules = array_keys(Arr::get($failed, $key, []));

        $failedRules = array_map(function (string $rule) {

            if (is_a($rule, ValidationRule::class, true) || is_a($rule, Rule::class, true)) {

                return $rule;

            }
<?php     {

        if ($channel instanceof HasBroadcastChannel) {

            $channel = $channel->broadcastChannelRoute();

        } elseif (is_string($channel) && class_exists($channel) && is_a($channel, HasBroadcastChannel::class, true)) {

            $channel = (new $channel)->broadcastChannelRoute();

        }
<?php                 $collectionClass = $this->arguments[0] ?? Collection::class;



                if (! is_a($collectionClass, Collection::class, true)) {

                    throw new InvalidArgumentException('The provided class must extend ['.Collection::class.'].');

                }
<?php             {

                $collectionClass = $this->arguments[0] ?? Collection::class;



                if (! is_a($collectionClass, Collection::class, true)) {

                    throw new InvalidArgumentException('The provided class must extend ['.Collection::class.'].');

                }
<?php     {

        foreach ($this->throttleCallbacks as $throttleCallback) {

            foreach ($this->firstClosureParameterTypes($throttleCallback) as $type) {

                if (is_a($e, $type)) {

                    $response = $throttleCallback($e);



                    if (! is_null($response)) {
<?php         }



        foreach ($this->exceptionMap as $class => $mapper) {

            if (is_a($e, $class)) {

                return $mapper($e);

            }

        }
<?php     {

        foreach ($this->renderCallbacks as $renderCallback) {

            foreach ($this->firstClosureParameterTypes($renderCallback) as $type) {

                if (is_a($e, $type)) {

                    $response = $renderCallback($e, $request);



                    if (! is_null($response)) {
<?php     public function handles(Throwable $e)

    {

        foreach ($this->firstClosureParameterTypes($this->callback) as $type) {

            if (is_a($e, $type)) {

                return true;

            }

        }
<?php             $collects = $class;

        }



        if (! $collects || is_a($collects, JsonResource::class, true)) {

            return $collects;

        }
<?php     protected function createMonologDriver(array $config)

    {

        if (! is_a($config['handler'], HandlerInterface::class, true)) {

            throw new InvalidArgumentException(

                $config['handler'].' must be an instance of '.HandlerInterface::class

            );
<?php         collect($config['processors'] ?? [])->each(function ($processor) {

            $processor = $processor['processor'] ?? $processor;



            if (! is_a($processor, ProcessorInterface::class, true)) {

                throw new InvalidArgumentException(

                    $processor.' must be an instance of '.ProcessorInterface::class

                );
<?php             (new $value->class)->setConnection($value->connection), $value->id

        )->useWritePdo()->get();



        if (is_a($value->class, Pivot::class, true) ||

            in_array(AsPivot::class, class_uses($value->class))) {

            return $collection;

        }
<?php             $this->getControllerMethod(),

        ];



        if (is_a($controllerClass, HasMiddleware::class, true)) {

            return $this->staticallyProvidedControllerMiddleware(

                $controllerClass, $controllerMethod

            );
<?php                 $sessionErrors = $this->session()->get('errors');



                if ($hasErrors && is_a($sessionErrors, ViewErrorBag::class)) {

                    foreach ($sessionErrors->getBags() as $bag => $messages) {

                        if (is_a($messages, MessageBag::class)) {

                            $errors[$bag] = $messages->all();
<?php                 if ($hasErrors && is_a($sessionErrors, ViewErrorBag::class)) {

                    foreach ($sessionErrors->getBags() as $bag => $messages) {

                        if (is_a($messages, MessageBag::class)) {

                            $errors[$bag] = $messages->all();

                        }

                    }