Skip to content

Commit

Permalink
[CS] Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
CoreShop authored Nov 28, 2022
1 parent 8ac2c37 commit c9fb0f9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

final class ReceiverNotListableException extends RuntimeException
{
public function __construct()
{
public function __construct(
) {
parent::__construct('The receiver does not support listing or showing specific messages.');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public function getReceiversMapping(): array
return $receivers;
}


/**
* @return ReceiverInterface[]
*/
Expand Down
7 changes: 3 additions & 4 deletions src/CoreShop/Component/Pimcore/Event/SlugGenerationEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ public function __construct(
protected SluggableInterface $sluggable,
protected string $slug,
protected ?string $suffix = null,
protected ?Site $site = null
)
{
protected ?Site $site = null,
) {
}

public function getSluggable(): SluggableInterface
Expand All @@ -57,4 +56,4 @@ public function getSite(): ?Site
{
return $this->site;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DataObjectSiteSlugGenerator implements DataObjectSiteSlugGeneratorInterfac
{
public function __construct(
private SluggableSluggerInterface $slugger,
private EventDispatcherInterface $eventDispatcher
private EventDispatcherInterface $eventDispatcher,
) {
}

Expand All @@ -46,8 +46,8 @@ public function generateSlugsForSite(SluggableInterface $sluggable, string $loca
break;
}

$slug = $this->slugger->slug($sluggable, $locale, (string)$i);
$slug = $this->dispatchSlugEvent($sluggable, $slug, (string)$i, $site);
$slug = $this->slugger->slug($sluggable, $locale, (string) $i);
$slug = $this->dispatchSlugEvent($sluggable, $slug, (string) $i, $site);

++$i;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
class DataObjectSlugGenerator implements DataObjectSlugGeneratorInterface
{
public function __construct(
private DataObjectSiteSlugGeneratorInterface $generator
private DataObjectSiteSlugGeneratorInterface $generator,
) {
}

Expand All @@ -38,7 +38,7 @@ public function generateSlugs(SluggableInterface $sluggable): void
$fallbackSlug = $this->generator->generateSlugsForSite($sluggable, $language);

$newSlugs = [
new UrlSlug($fallbackSlug, 0)
new UrlSlug($fallbackSlug, 0),
];
$actualSlugs = [];
$existingSlugs = $sluggable->getSlug($language);
Expand Down

0 comments on commit c9fb0f9

Please sign in to comment.