Rename FileNotWritableException::exception to FileNotWritableException::fromPrevious
Changed parameter name, use default code 0 instead of code of the
previous exception.
MODIFY
src/ProxyManager/Exception/FileNotWritableException.php
src/ProxyManager/Exception/FileNotWritableException.php
@@ -38,8 +38,8 @@ class FileNotWritableException extends UnexpectedValueException implements Excep
));
}
- public static function exception(FileWriterException $e) : self
+ public static function fromPrevious(FileWriterException $previous) : self
{
- return new self($e->getMessage(), (int) $e->getCode(), $e);
+ return new self($previous->getMessage(), 0, $previous);
}
}

MODIFY
src/ProxyManager/GeneratorStrategy/FileWriterGeneratorStrategy.php
src/ProxyManager/GeneratorStrategy/FileWriterGeneratorStrategy.php
@@ -51,7 +51,7 @@ class FileWriterGeneratorStrategy implements GeneratorStrategyInterface
return $generatedCode;
} catch (FileWriterException $e) {
- throw FileNotWritableException::exception($e);
+ throw FileNotWritableException::fromPrevious($e);
} finally {
restore_error_handler();
}

Rename FileNotWritableException::exception to FileNotWritableException::fromPrevious

Changed parameter name, use default code 0 instead of code of the
previous exception.