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

Breadcrumb

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

class UnexpectedValueException

Same name in this branch
  1. 11.1.x vendor/php-http/guzzle7-adapter/src/Exception/UnexpectedValueException.php \Http\Adapter\Guzzle7\Exception\UnexpectedValueException
  2. 11.1.x vendor/symfony/serializer/Exception/UnexpectedValueException.php \Symfony\Component\Serializer\Exception\UnexpectedValueException
  3. 11.1.x vendor/symfony/validator/Exception/UnexpectedValueException.php \Symfony\Component\Validator\Exception\UnexpectedValueException
  4. 11.1.x vendor/symfony/browser-kit/Exception/UnexpectedValueException.php \Symfony\Component\BrowserKit\Exception\UnexpectedValueException
  5. 11.1.x vendor/symfony/http-foundation/Exception/UnexpectedValueException.php \Symfony\Component\HttpFoundation\Exception\UnexpectedValueException

Exception for given parameters causing invalid/unexpected state on instantiation

Hierarchy

  • class \Doctrine\Instantiator\Exception\UnexpectedValueException extends \UnexpectedValueException implements \Doctrine\Instantiator\Exception\ExceptionInterface

Expanded class hierarchy of UnexpectedValueException

1 file declares its use of UnexpectedValueException
Instantiator.php in vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php

File

vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php, line 16

Namespace

Doctrine\Instantiator\Exception
View source
class UnexpectedValueException extends BaseUnexpectedValueException implements ExceptionInterface {
    
    /**
     * @phpstan-param ReflectionClass<T> $reflectionClass
     *
     * @template T of object
     */
    public static function fromSerializationTriggeredException(ReflectionClass $reflectionClass, Exception $exception) : self {
        return new self(sprintf('An exception was raised while trying to instantiate an instance of "%s" via un-serialization', $reflectionClass->getName()), 0, $exception);
    }
    
    /**
     * @phpstan-param ReflectionClass<T> $reflectionClass
     *
     * @template T of object
     */
    public static function fromUncleanUnSerialization(ReflectionClass $reflectionClass, string $errorString, int $errorCode, string $errorFile, int $errorLine) : self {
        return new self(sprintf('Could not produce an instance of "%s" via un-serialization, since an error was triggered ' . 'in file "%s" at line "%d"', $reflectionClass->getName(), $errorFile, $errorLine), 0, new Exception($errorString, $errorCode));
    }

}

Members

Title Sort descending Modifiers Object type Summary
UnexpectedValueException::fromSerializationTriggeredException public static function @phpstan-param ReflectionClass&lt;T&gt; $reflectionClass
UnexpectedValueException::fromUncleanUnSerialization public static function @phpstan-param ReflectionClass&lt;T&gt; $reflectionClass
RSS feed
Powered by Drupal