Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix styling
Browse files Browse the repository at this point in the history
aabadawy authored and github-actions[bot] committed Sep 7, 2023
1 parent 090b133 commit 9ef7b34
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions src/InteractsWithMedia.php
Original file line number Diff line number Diff line change
@@ -279,9 +279,9 @@ protected function getSingleOfMedia(string $collectionName = 'default', array|ca
{
$direction = strtolower($direction);

throw_unless(in_array($direction,['asc','desc']),new \LogicException('direction should equal asc or desc'));
throw_unless(in_array($direction, ['asc','desc']), new \LogicException('direction should equal asc or desc'));

$media = $this->getMedia($collectionName,$filters);
$media = $this->getMedia($collectionName, $filters);

return $direction == 'asc' ? $media->first() : $media->last();
}
@@ -293,17 +293,17 @@ public function getMediaRepository(): MediaRepository

public function getFirstMedia(string $collectionName = 'default', $filters = []): ?Media
{
return $this->getSingleOfMedia($collectionName,$filters,'asc');
return $this->getSingleOfMedia($collectionName, $filters, 'asc');
}

public function getLastMedia(string $collectionName = 'default',$filters = []): ?Media
public function getLastMedia(string $collectionName = 'default', $filters = []): ?Media
{
return $this->getSingleOfMedia($collectionName,$filters,'desc');
return $this->getSingleOfMedia($collectionName, $filters, 'desc');
}

protected function getSingleOfMediaUrl(string $collectionName = 'default', string $conversionName = '',string $direction = 'asc' | 'desc'): string
protected function getSingleOfMediaUrl(string $collectionName = 'default', string $conversionName = '', string $direction = 'asc' | 'desc'): string
{
$media = $this->getSingleOfMedia($collectionName,[],$direction);
$media = $this->getSingleOfMedia($collectionName, [], $direction);

if (! $media) {
return $this->getFallbackMediaUrl($collectionName, $conversionName) ?: '';
@@ -323,7 +323,7 @@ protected function getSingleOfMediaUrl(string $collectionName = 'default', strin
*/
public function getFirstMediaUrl(string $collectionName = 'default', string $conversionName = ''): string
{
return $this->getSingleOfMediaUrl($collectionName,$conversionName,'asc');
return $this->getSingleOfMediaUrl($collectionName, $conversionName, 'asc');
}

/*
@@ -333,17 +333,16 @@ public function getFirstMediaUrl(string $collectionName = 'default', string $con
*/
public function getLastMediaUrl(string $collectionName = 'default', string $conversionName = ''): string
{
return $this->getSingleOfMediaUrl($collectionName,$conversionName,'desc');
return $this->getSingleOfMediaUrl($collectionName, $conversionName, 'desc');
}

protected function getSingleOfMediaTemporaryUrl(
DateTimeInterface $expiration,
string $collectionName = 'default',
string $conversionName = '',
string $direction = 'asc'
)
{
$media = $this->getSingleOfMedia($collectionName,[],$direction);
) {
$media = $this->getSingleOfMedia($collectionName, [], $direction);

if (! $media) {
return $this->getFallbackMediaUrl($collectionName, $conversionName) ?: '';
@@ -366,7 +365,7 @@ public function getFirstTemporaryUrl(
string $collectionName = 'default',
string $conversionName = ''
): string {
return $this->getSingleOfMediaTemporaryUrl($expiration,$collectionName,$conversionName,'asc');
return $this->getSingleOfMediaTemporaryUrl($expiration, $collectionName, $conversionName, 'asc');
}

/*
@@ -380,7 +379,7 @@ public function getLastMediaTemporaryUrl(
string $collectionName = 'default',
string $conversionName = ''
): string {
return $this->getSingleOfMediaTemporaryUrl($expiration,$collectionName,$conversionName,'desc');
return $this->getSingleOfMediaTemporaryUrl($expiration, $collectionName, $conversionName, 'desc');
}

public function getRegisteredMediaCollections(): Collection
@@ -420,9 +419,9 @@ public function getFallbackMediaPath(string $collectionName = 'default', string
return $fallbackPaths[$conversionName] ?? $fallbackPaths['default'] ?? '';
}

protected function getSingleOfMediaPath(string $collectionName = 'default', string $conversionName = '',string $direction = 'asc' | 'desc'): string
protected function getSingleOfMediaPath(string $collectionName = 'default', string $conversionName = '', string $direction = 'asc' | 'desc'): string
{
$media = $this->getSingleOfMedia($collectionName,[],$direction);
$media = $this->getSingleOfMedia($collectionName, [], $direction);

if (! $media) {
return $this->getFallbackMediaPath($collectionName, $conversionName) ?: '';
@@ -442,7 +441,7 @@ protected function getSingleOfMediaPath(string $collectionName = 'default', stri
*/
public function getFirstMediaPath(string $collectionName = 'default', string $conversionName = ''): string
{
return $this->getSingleOfMediaPath($collectionName,$conversionName,'asc');
return $this->getSingleOfMediaPath($collectionName, $conversionName, 'asc');
}

/*
@@ -453,7 +452,7 @@ public function getFirstMediaPath(string $collectionName = 'default', string $co
*/
public function getLastMediaPath(string $collectionName = 'default', string $conversionName = ''): string
{
return $this->getSingleOfMediaPath($collectionName,$conversionName,'desc');
return $this->getSingleOfMediaPath($collectionName, $conversionName, 'desc');
}

/*

0 comments on commit 9ef7b34

Please sign in to comment.