Skip to content

Commit

Permalink
Cleanup to "old" code
Browse files Browse the repository at this point in the history
  • Loading branch information
kdambekalns committed Oct 26, 2021
1 parent 9ecd8e7 commit 0b42f7b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
6 changes: 0 additions & 6 deletions Classes/AssetSource/CantoAssetProxyQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,6 @@ public function getArrayResult(): array
* @param int $limit
* @param array $orderings
* @return Response
* @throws AuthenticationFailedException
* @throws IdentityProviderException
* @throws OAuthClientException
* @throws GuzzleException
*/
Expand Down Expand Up @@ -296,8 +294,6 @@ private function sendSearchRequest(int $limit, array $orderings): Response

/**
* @return void
* @throws AuthenticationFailedException
* @throws IdentityProviderException
* @throws OAuthClientException
* @throws GuzzleException
*/
Expand Down Expand Up @@ -331,8 +327,6 @@ public function prepareTagQuery(): void

/**
* @return void
* @throws AuthenticationFailedException
* @throws IdentityProviderException
* @throws OAuthClientException
* @throws GuzzleException
*/
Expand Down
1 change: 0 additions & 1 deletion Classes/AssetSource/CantoAssetProxyRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public function __construct(CantoAssetSource $assetSource)
* @return AssetProxyInterface
* @throws AssetNotFoundExceptionInterface
* @throws AssetSourceConnectionExceptionInterface
* @throws AuthenticationFailedException
* @throws AssetNotFoundException
* @throws Exception
*/
Expand Down
5 changes: 2 additions & 3 deletions Classes/AssetSource/CantoAssetSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ public function getAssetProxyRepository(): AssetProxyRepositoryInterface

/**
* @return bool
* @todo Change back to true, because we do not write to Canto!
*/
public function isReadOnly(): bool
{
Expand Down Expand Up @@ -238,7 +239,7 @@ public function getDescription(): string
return $this->description;
}

public function getApiBaseUri()
public function getApiBaseUri(): string
{
return $this->apiBaseUri;
}
Expand All @@ -255,8 +256,6 @@ public function getAppSecret(): string

/**
* @return CantoClient
* @throws AuthenticationFailedException
* @throws IdentityProviderException
*/
public function getCantoClient(): CantoClient
{
Expand Down
7 changes: 4 additions & 3 deletions Classes/Command/CantoCommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,20 @@ public function tagUsedAssetsCommand(string $assetSource = CantoAssetSource::ASS
!$quiet && $this->outputLine('<b>Tagging used assets of asset source "%s" via Canto API:</b>', [$assetSourceIdentifier]);

try {
/** @var CantoAssetSource $cantoAssetSource */
$cantoAssetSource = $this->assetSourceService->getAssetSources()[$assetSourceIdentifier];
$cantoClient = $cantoAssetSource->getCantoClient();
} catch (MissingClientSecretException $e) {
$this->outputLine('<error>Authentication error: Missing client secret</error>');
exit(1);
$this->quit(1);
} catch (AuthenticationFailedException $e) {
$this->outputLine('<error>Authentication error: %s</error>', [$e->getMessage()]);
exit(1);
$this->quit(1);
}

if (!$cantoAssetSource->isAutoTaggingEnabled()) {
$this->outputLine('<error>Auto-tagging is disabled</error>');
exit(1);
$this->quit(1);
}

$assetProxyRepository = $cantoAssetSource->getAssetProxyRepository();
Expand Down

0 comments on commit 0b42f7b

Please sign in to comment.