You are here

class UnexpectedValueException in Zircon Profile 8.0

Same name in this branch
  1. 8.0 vendor/symfony/serializer/Exception/UnexpectedValueException.php \Symfony\Component\Serializer\Exception\UnexpectedValueException
  2. 8.0 vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php \Doctrine\Instantiator\Exception\UnexpectedValueException
  3. 8.0 vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/UnexpectedValueException.php \Doctrine\Common\Proxy\Exception\UnexpectedValueException
Same name and namespace in other branches
  1. 8 vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php \Doctrine\Instantiator\Exception\UnexpectedValueException

Exception for given parameters causing invalid/unexpected state on instantiation

@author Marco Pivetta <ocramius@gmail.com>

Hierarchy

Expanded class hierarchy of UnexpectedValueException

4 files declare their use of UnexpectedValueException
Generator.php in vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/Generator.php
Instantiator.php in vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php
InstantiatorTest.php in vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/InstantiatorTest.php
UnexpectedValueExceptionTest.php in vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/UnexpectedValueExceptionTest.php
2 string references to 'UnexpectedValueException'
ProxyLogicTest::testFailedLoadingWillThrowException in vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyLogicTest.php
RequestTest::testHostValidity in vendor/symfony/http-foundation/Tests/RequestTest.php
@dataProvider getHostValidities

File

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

Namespace

Doctrine\Instantiator\Exception
View source
class UnexpectedValueException extends BaseUnexpectedValueException implements ExceptionInterface {

  /**
   * @param ReflectionClass $reflectionClass
   * @param Exception       $exception
   *
   * @return self
   */
  public static function fromSerializationTriggeredException(ReflectionClass $reflectionClass, Exception $exception) {
    return new self(sprintf('An exception was raised while trying to instantiate an instance of "%s" via un-serialization', $reflectionClass
      ->getName()), 0, $exception);
  }

  /**
   * @param ReflectionClass $reflectionClass
   * @param string          $errorString
   * @param int             $errorCode
   * @param string          $errorFile
   * @param int             $errorLine
   *
   * @return UnexpectedValueException
   */
  public static function fromUncleanUnSerialization(ReflectionClass $reflectionClass, $errorString, $errorCode, $errorFile, $errorLine) {
    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