Skip to content

Commit

Permalink
TASK: Improve code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellienert committed Mar 6, 2020
1 parent e4a8726 commit cba174c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
4 changes: 3 additions & 1 deletion Classes/AssetSource/UnsplashAssetProxyQuery.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
namespace DL\AssetSource\Unsplash\AssetSource;

/*
Expand Down Expand Up @@ -114,9 +115,10 @@ public function execute(): AssetProxyQueryResultInterface

/**
* @return int
* @throws \Exception
*/
public function count(): int
{
throw new \Exception(__METHOD__ . ' is not yet implemented');
return $this->execute()->count();
}
}
7 changes: 4 additions & 3 deletions Classes/AssetSource/UnsplashAssetProxyQueryResult.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
namespace DL\AssetSource\Unsplash\AssetSource;

/*
Expand Down Expand Up @@ -91,11 +92,11 @@ public function current()
/** @var Photo $photo */
$photo = $this->unsplashQueryResultIterator->current();

if($photo instanceof Photo) {
if ($photo instanceof Photo) {
return new UnsplashAssetProxy($photo, $this->assetSource);
} else {
return null;
}

return null;
}

/**
Expand Down
4 changes: 4 additions & 0 deletions Classes/AssetSource/UnsplashAssetProxyRepository.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
namespace DL\AssetSource\Unsplash\AssetSource;

/*
Expand Down Expand Up @@ -55,6 +56,7 @@ public function filterByType(AssetTypeFilter $assetType = null): void
/**
* @return AssetProxyQueryResultInterface
* @throws AssetSourceConnectionExceptionInterface
* @throws \Exception
*/
public function findAll(): AssetProxyQueryResultInterface
{
Expand All @@ -78,6 +80,7 @@ public function findBySearchTerm(string $searchTerm): AssetProxyQueryResultInter
/**
* @param Tag $tag
* @return AssetProxyQueryResultInterface
* @throws \Exception
*/
public function findByTag(Tag $tag): AssetProxyQueryResultInterface
{
Expand All @@ -86,6 +89,7 @@ public function findByTag(Tag $tag): AssetProxyQueryResultInterface

/**
* @return AssetProxyQueryResultInterface
* @throws \Exception
*/
public function findUntagged(): AssetProxyQueryResultInterface
{
Expand Down
1 change: 1 addition & 0 deletions Classes/AssetSource/UnsplashAssetSource.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
namespace DL\AssetSource\Unsplash\AssetSource;

/*
Expand Down
10 changes: 5 additions & 5 deletions Classes/AssetSource/UnsplashImageSizeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

interface UnsplashImageSizeInterface
{
const RAW = 'raw';
const FULL = 'full';
const REGULAR = 'regular';
const SMALL = 'small';
const THUMB = 'thumb';
public const RAW = 'raw';
public const FULL = 'full';
public const REGULAR = 'regular';
public const SMALL = 'small';
public const THUMB = 'thumb';
}

0 comments on commit cba174c

Please sign in to comment.