Skip to content
This repository has been archived by the owner on May 25, 2019. It is now read-only.

Commit

Permalink
- Fixing return type
Browse files Browse the repository at this point in the history
  • Loading branch information
akadlec committed Mar 28, 2018
1 parent 2567293 commit e3b6eee
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/IPub/Images/Application/Presenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ public function __construct(
/**
* @param Application\Request $request
*
* @return Application\IResponse
* @return Application\IResponse|NULL
*
* @throws Application\BadRequestException
* @throws Utils\ImageException
*/
public function run(Application\Request $request) : Application\IResponse
public function run(Application\Request $request) : ?Application\IResponse
{
$this->request = $request;

Expand Down Expand Up @@ -153,12 +153,12 @@ public function run(Application\Request $request) : Application\IResponse
* @param string|NULL $size
* @param string|NULL $algorithm
*
* @return Images\Application\ImageResponse
* @return Images\Application\ImageResponse|NULL
*
* @throws Application\BadRequestException
* @throws Utils\ImageException
*/
private function generateImage(string $storage, ?string $namespace = NULL, string $filename, string $extension, ?string $size = NULL, ?string $algorithm = NULL) : Images\Application\ImageResponse
private function generateImage(string $storage, ?string $namespace = NULL, string $filename, string $extension, ?string $size = NULL, ?string $algorithm = NULL) : ?Images\Application\ImageResponse
{
try {
$fileSystem = $this->mountManager->getFilesystem($storage);
Expand Down Expand Up @@ -214,12 +214,12 @@ private function generateImage(string $storage, ?string $namespace = NULL, strin
* @param int|NULL $height
* @param int $algorithm
*
* @return Images\Application\ImageResponse
* @return Images\Application\ImageResponse|NULL
*
* @throws Application\BadRequestException
* @throws Utils\ImageException
*/
private function createImage(string $imageContent, ?string $mimeType = NULL, ?int $width = NULL, ?int $height = NULL, int $algorithm) : Images\Application\ImageResponse
private function createImage(string $imageContent, ?string $mimeType = NULL, ?int $width = NULL, ?int $height = NULL, int $algorithm) : ?Images\Application\ImageResponse
{
$destination = $this->wwwDir . $this->httpRequest->getUrl()->getPath();

Expand All @@ -242,6 +242,8 @@ private function createImage(string $imageContent, ?string $mimeType = NULL, ?in

$image->send();

return NULL;

} else {
try {
Utils\FileSystem::write($destination, $imageContent);
Expand Down

0 comments on commit e3b6eee

Please sign in to comment.