Skip to content

Commit

Permalink
Run CS fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
RandyCupic committed Apr 3, 2024
1 parent c7a88fe commit f1e5268
Show file tree
Hide file tree
Showing 24 changed files with 54 additions and 26 deletions.
4 changes: 2 additions & 2 deletions bundle/Command/RefreshStoredResourcesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private function refreshResources(array $resources): void
*/
private function getRemoteBatch(array $remoteIds): array
{
$query = Query::fromRemoteIds($remoteIds, $this->batchSize);
$query = Query::fromRemoteIds($remoteIds, $this->batchSize);

$resources = [];

Expand All @@ -149,7 +149,7 @@ private function getRemoteBatch(array $remoteIds): array
}

$query->setNextCursor($searchResult->getNextCursor());
} while($searchResult->getNextCursor() !== null);
} while ($searchResult->getNextCursor() !== null);

return $resources;
}
Expand Down
10 changes: 10 additions & 0 deletions bundle/Controller/Callback/Cloudinary/Notify.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ private function handleContextChanged(array $requestContent): void
}

$filenameFromUrl = basename($publicId);

try {
$apiResource = Uploader::explicit(
CloudinaryRemoteId::fromRemoteId($resource->getRemoteId())->getResourceId(),
Expand All @@ -309,14 +310,17 @@ private function handleContextChanged(array $requestContent): void
switch ($value['name']) {
case 'alt':
$resource->setAltText($value['value']);

break;

case 'caption':
$resource->setCaption($value['value']);

break;

case 'original_filename':
$resource->setOriginalFilename($value['value'] ?? $filenameFromUrl);

break;

default:
Expand All @@ -328,14 +332,17 @@ private function handleContextChanged(array $requestContent): void
switch ($value['name']) {
case 'alt':
$resource->setAltText(null);

break;

case 'caption':
$resource->setCaption(null);

break;

case 'original_filename':
$resource->setOriginalFilename($filenameFromUrl);

break;

default:
Expand All @@ -347,14 +354,17 @@ private function handleContextChanged(array $requestContent): void
switch ($value['name']) {
case 'alt':
$resource->setAltText($value['value']);

break;

case 'caption':
$resource->setCaption($value['value']);

break;

case 'original_filename':
$resource->setOriginalFilename($value['value'] ?? $filenameFromUrl);

break;

default:
Expand Down
1 change: 0 additions & 1 deletion bundle/Controller/Resource/AbstractController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

use function basename;
use function is_array;

abstract class AbstractController
Expand Down
3 changes: 2 additions & 1 deletion lib/API/Search/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public function __construct(
private int $limit = 25,
private ?string $nextCursor = null,
private array $sortBy = ['created_at' => 'desc']
) {}
) {
}

public function __toString(): string
{
Expand Down
3 changes: 2 additions & 1 deletion lib/API/Search/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public function __construct(
private int $totalCount,
private ?string $nextCursor = null,
private array $resources = []
) {}
) {
}

public function getTotalCount(): int
{
Expand Down
3 changes: 2 additions & 1 deletion lib/API/Upload/ResourceStruct.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public function __construct(
private array $tags = [],
private array $context = [],
private bool $hideFilename = false,
) {}
) {
}

public function getFileStruct(): FileStruct
{
Expand Down
3 changes: 2 additions & 1 deletion lib/API/Values/AuthToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ private function __construct(
private ?DateTimeImmutable $startsAt = null,
private ?DateTimeImmutable $expiresAt = null,
private ?string $ipAddress = null
) {}
) {
}

public static function fromDuration(int $duration): self
{
Expand Down
3 changes: 2 additions & 1 deletion lib/API/Values/CropSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ public function __construct(
private int $y = 0,
private int $width = 0,
private int $height = 0
) {}
) {
}

public static function fromArray(string $transformationName, array $coords): self
{
Expand Down
3 changes: 2 additions & 1 deletion lib/API/Values/Folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ final class Folder
public function __construct(
private string $name,
private ?self $parent = null
) {}
) {
}

public function __toString(): string
{
Expand Down
3 changes: 2 additions & 1 deletion lib/API/Values/RemoteResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ public function __construct(
private array $metadata = [],
private array $context = [],
private Collection|array $locations = [],
) {}
) {
}

public function getId(): ?int
{
Expand Down
3 changes: 2 additions & 1 deletion lib/API/Values/RemoteResourceLocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public function __construct(
private array $cropSettings = [],
private ?string $watermarkText = null,
private ?int $id = null,
) {}
) {
}

public function getId(): ?int
{
Expand Down
3 changes: 2 additions & 1 deletion lib/API/Values/RemoteResourceVariation.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ public function __construct(
private RemoteResource $resource,
private string $url,
private array $transformations = []
) {}
) {
}

public static function fromResource(RemoteResource $resource): self
{
Expand Down
3 changes: 2 additions & 1 deletion lib/API/Values/StatusData.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ final class StatusData
*/
public function __construct(
private array $properties = []
) {}
) {
}

public function has(string $key): bool
{
Expand Down
3 changes: 2 additions & 1 deletion lib/Core/Provider/Cloudinary/CloudinaryRemoteId.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public function __construct(
private string $type,
private string $resourceType,
private string $resourceId
) {}
) {
}

public static function fromCloudinaryData(array $data): self
{
Expand Down
3 changes: 2 additions & 1 deletion lib/Core/Provider/Cloudinary/Factory/CloudinaryInstance.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public function __construct(
private string $apiSecret,
private string $uploadPrefix,
private bool $useSubdomains = false
) {}
) {
}

public function create(): Cloudinary
{
Expand Down
5 changes: 2 additions & 3 deletions lib/Core/Provider/Cloudinary/Factory/RemoteResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
use Netgen\RemoteMedia\Core\Provider\Cloudinary\Converter\VisibilityType as VisibilityTypeConverter;
use Netgen\RemoteMedia\Exception\Factory\InvalidDataException;

use function array_key_exists;
use function array_merge;
use function basename;
use function cloudinary_url_internal;
use function in_array;
Expand All @@ -28,7 +26,8 @@ public function __construct(
private ResourceTypeConverter $resourceTypeConverter,
private VisibilityTypeConverter $visibilityTypeConverter,
private FileHashFactoryInterface $fileHashFactory
) {}
) {
}

public function create($data): RemoteResourceValue
{
Expand Down
3 changes: 2 additions & 1 deletion lib/Core/Provider/Cloudinary/Factory/SearchResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ final class SearchResult implements SearchResultFactoryInterface
{
public function __construct(
private RemoteResourceFactory $remoteResourceFactory,
) {}
) {
}

public function create(mixed $data): Result
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public function __construct(
private GatewayInterface $gateway,
private CacheItemPoolInterface $cache,
private int $ttl = 7200
) {}
) {
}

public function usage(): StatusData
{
Expand Down
3 changes: 2 additions & 1 deletion lib/Core/Provider/Cloudinary/Resolver/AuthToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ final class AuthToken
{
public function __construct(
private ?string $encryptionKey = null
) {}
) {
}

public function resolve(AuthTokenEntity $token): array
{
Expand Down
3 changes: 2 additions & 1 deletion lib/Core/Provider/Cloudinary/Resolver/SearchExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ final class SearchExpression
public function __construct(
private ResourceTypeConverter $resourceTypeConverter,
private VisibilityTypeConverter $visibilityTypeConverter,
) {}
) {
}

public function resolve(Query $query): string
{
Expand Down
3 changes: 2 additions & 1 deletion lib/Event/Cloudinary/NotificationReceivedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ final class NotificationReceivedEvent extends Event

public function __construct(
private Request $request,
) {}
) {
}

public function getRequest(): Request
{
Expand Down
3 changes: 2 additions & 1 deletion lib/Form/DataTransformer/RemoteMediaTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ final class RemoteMediaTransformer implements DataTransformerInterface
{
public function __construct(
private ProviderInterface $provider
) {}
) {
}

public function transform($value)
{
Expand Down
3 changes: 2 additions & 1 deletion lib/Form/Type/RemoteMediaFolderType.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ final class RemoteMediaFolderType extends AbstractType
{
public function __construct(
private DataTransformerInterface $transformer,
) {}
) {
}

public function configureOptions(OptionsResolver $resolver): void
{
Expand Down
3 changes: 2 additions & 1 deletion lib/Form/Type/RemoteMediaType.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ final class RemoteMediaType extends AbstractType
public function __construct(
private DataTransformerInterface $transformer,
private ProviderInterface $provider,
) {}
) {
}

public function configureOptions(OptionsResolver $resolver): void
{
Expand Down

0 comments on commit f1e5268

Please sign in to comment.