1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?php
- namespace Doctrine\Common\Proxy\Exception;
- use Throwable;
- use UnexpectedValueException as BaseUnexpectedValueException;
- use function sprintf;
- /**
- * Proxy Unexpected Value Exception.
- *
- * @link www.doctrine-project.org
- */
- class UnexpectedValueException extends BaseUnexpectedValueException implements ProxyException
- {
- /**
- * @param string $proxyDirectory
- *
- * @return self
- */
- public static function proxyDirectoryNotWritable($proxyDirectory)
- {
- return new self(sprintf('Your proxy directory "%s" must be writable', $proxyDirectory));
- }
- /**
- * @param string $className
- * @param string $methodName
- * @param string $parameterName
- *
- * @return self
- *
- * @psalm-param class-string $className
- */
- public static function invalidParameterTypeHint(
- $className,
- $methodName,
- $parameterName,
- ?Throwable $previous = null
- ) {
- return new self(
- sprintf(
- 'The type hint of parameter "%s" in method "%s" in class "%s" is invalid.',
- $parameterName,
- $methodName,
- $className
- ),
- 0,
- $previous
- );
- }
- /**
- * @param string $className
- * @param string $methodName
- *
- * @return self
- *
- * @psalm-param class-string $className
- */
- public static function invalidReturnTypeHint($className, $methodName, ?Throwable $previous = null)
- {
- return new self(
- sprintf(
- 'The return type of method "%s" in class "%s" is invalid.',
- $methodName,
- $className
- ),
- 0,
- $previous
- );
- }
- }
|