Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. InvalidArgumentException.php

function InvalidArgumentException::fromNonExistingClass

1 call to InvalidArgumentException::fromNonExistingClass()
Instantiator::getReflectionClass in vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php
@phpstan-param class-string<T> $className

File

vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/InvalidArgumentException.php, line 19

Class

InvalidArgumentException
Exception for invalid arguments provided to the instantiator

Namespace

Doctrine\Instantiator\Exception

Code

public static function fromNonExistingClass(string $className) : self {
    if (interface_exists($className)) {
        return new self(sprintf('The provided type "%s" is an interface, and cannot be instantiated', $className));
    }
    if (trait_exists($className)) {
        return new self(sprintf('The provided type "%s" is a trait, and cannot be instantiated', $className));
    }
    return new self(sprintf('The provided class "%s" does not exist', $className));
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal