Skip to content

Commit

Permalink
style: make fix for the umptillionth time
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckadams committed Dec 27, 2024
1 parent 179620b commit 62f7c95
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/Services/Metadata/AbstractMetadataService.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected function saveOpen(array $metadata, bool $clobber): bool
{
$id = Uuid::uuid7()->toString();
$slug = mb_substr($metadata['slug'], 0, 255);
$version = mb_substr((string)$metadata['version'], 0, 32);
$version = mb_substr((string) $metadata['version'], 0, 32);

if (!$clobber && $this->slugAndVersionExists($slug, $version)) {
$this->log->debug("Not updating unmodified {$this->resource->value}", compact('slug', 'version'));
Expand All @@ -70,7 +70,7 @@ protected function saveOpen(array $metadata, bool $clobber): bool
$this->connection()->insert('sync_assets', [
'id' => Uuid::uuid7()->toString(),
'sync_id' => $id,
'version' => mb_substr((string)$version, 0, 32),
'version' => mb_substr((string) $version, 0, 32),
'url' => mb_substr($url, 0, 4096),
'created' => time(),
]);
Expand Down Expand Up @@ -267,27 +267,27 @@ private function connection(): Connection
private function slugAndVersionExists(string $slug, string $version): bool
{
return $this
->querySync()
->select('1')
->andWhere('slug = :slug')
->andWhere('version = :version')
->setParameter('slug', $slug)
->setParameter('version', $version)
->executeQuery()
->fetchOne() !== false;
->querySync()
->select('1')
->andWhere('slug = :slug')
->andWhere('version = :version')
->setParameter('slug', $slug)
->setParameter('version', $version)
->executeQuery()
->fetchOne() !== false;
}

private function slugAndStatusExists(string $slug, string $status): bool
{
return $this
->querySync()
->select('1')
->andWhere('slug = :slug')
->andWhere('status = :status')
->setParameter('slug', $slug)
->setParameter('status', $status)
->executeQuery()
->fetchOne() !== false;
->querySync()
->select('1')
->andWhere('slug = :slug')
->andWhere('status = :status')
->setParameter('slug', $slug)
->setParameter('status', $status)
->executeQuery()
->fetchOne() !== false;
}

//endregion
Expand Down

0 comments on commit 62f7c95

Please sign in to comment.