vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/UnexpectedValueException.php line 22

Open in your IDE?
  1. <?php
  2. namespace Doctrine\Common\Proxy\Exception;
  3. use UnexpectedValueException as BaseUnexpectedValueException;
  4. /**
  5.  * Proxy Unexpected Value Exception.
  6.  *
  7.  * @link   www.doctrine-project.org
  8.  * @since  2.4
  9.  * @author Marco Pivetta <ocramius@gmail.com>
  10.  */
  11. class UnexpectedValueException extends BaseUnexpectedValueException implements ProxyException
  12. {
  13.     /**
  14.      * @param string $proxyDirectory
  15.      *
  16.      * @return self
  17.      */
  18.     public static function proxyDirectoryNotWritable($proxyDirectory)
  19.     {
  20.         return new self(sprintf('Your proxy directory "%s" must be writable'$proxyDirectory));
  21.     }
  22.     /**
  23.      * @param string          $className
  24.      * @param string          $methodName
  25.      * @param string          $parameterName
  26.      * @param \Exception|null $previous
  27.      *
  28.      * @return self
  29.      */
  30.     public static function invalidParameterTypeHint(
  31.         $className,
  32.         $methodName,
  33.         $parameterName,
  34.         \Exception $previous null
  35.     ) {
  36.         return new self(
  37.             sprintf(
  38.                 'The type hint of parameter "%s" in method "%s" in class "%s" is invalid.',
  39.                 $parameterName,
  40.                 $methodName,
  41.                 $className
  42.             ),
  43.             0,
  44.             $previous
  45.         );
  46.     }
  47.     /**
  48.      * @param string $className
  49.      * @param string $methodName
  50.      * @param \Exception|null $previous
  51.      *
  52.      * @return self
  53.      */
  54.     public static function invalidReturnTypeHint($className$methodName, \Exception $previous null)
  55.     {
  56.         return new self(
  57.             sprintf(
  58.                 'The return type of method "%s" in class "%s" is invalid.',
  59.                 $methodName,
  60.                 $className
  61.             ),
  62.             0,
  63.             $previous
  64.         );
  65.     }
  66. }