Skip to content

Commit

Permalink
fix: sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
lukmzig committed Nov 28, 2024
1 parent 634f93d commit 27234fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/Document/Schema/Site.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ final class Site implements AdditionalAttributesInterface
public function __construct(
#[Property(description: 'ID', type: 'integer', example: 0)]
private readonly int $id,
#[Property(description: 'ID of the root', type: 'integer', example: 1)]
private readonly ?int $rootId = null,
#[Property(description: 'Root path', type: 'string', example: '/')]
private readonly ?string $rootPath = null,
#[Property(description: 'Domains', type: 'array', items: new Items(type: 'string'), example: ['other_domain'])]
private readonly array $domains,
#[Property(description: 'Domain', type: 'string', example: 'main_site')]
private readonly string $domain,
#[Property(description: 'ID of the root', type: 'integer', example: 1)]
private readonly ?int $rootId = null,
#[Property(description: 'Root path', type: 'string', example: '/')]
private readonly ?string $rootPath = null,
) {
}

Expand Down
6 changes: 3 additions & 3 deletions src/Document/Service/SiteService.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ public function getAvailableSites(ExcludeMainSiteParameter $parameter): array
foreach ($siteList as $siteEntry) {
$site = new Site(
$siteEntry->getId(),
$siteEntry->getDomains(),
$siteEntry->getMainDomain(),
$siteEntry->getRootId(),
$siteEntry->getRootPath(),
$siteEntry->getDomains(),
$siteEntry->getMainDomain()
);

$this->eventDispatcher->dispatch(new SiteEvent($site), SiteEvent::EVENT_NAME);
Expand All @@ -65,6 +65,6 @@ public function getAvailableSites(ExcludeMainSiteParameter $parameter): array

private function getMainSite(): Site
{
return new Site(0, 1, '/', [], 'main_site');
return new Site(0, [], 'main_site', 1, '/');
}
}

0 comments on commit 27234fe

Please sign in to comment.