Skip to content

Commit

Permalink
Ran php-cs-fixer-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bart-van-amelsvoort committed May 24, 2024
1 parent 5c47d54 commit bdfd5a9
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Form/Type/SiteType.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'choices' => $this->siteRepository->findAll(),
'choice_label' => static function (SiteInterface $site = null) {
'choice_label' => static function (?SiteInterface $site = null) {
return (string) $site;
},
'choice_value' => 'id',
Expand Down
4 changes: 2 additions & 2 deletions Router/HostnameIdentifiedLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(IdentifierMappingInterface $identifierMapping)
$this->identifierMapping = $identifierMapping;
}

public function load($resource, string $type = null): RouteCollection
public function load($resource, ?string $type = null): RouteCollection
{
$this->resourceStack[] = $resource;

Expand All @@ -52,7 +52,7 @@ public function load($resource, string $type = null): RouteCollection
return $collection;
}

public function supports($resource, string $type = null): bool
public function supports($resource, ?string $type = null): bool
{
return null === $type && !\in_array($resource, $this->resourceStack, true);
}
Expand Down
2 changes: 1 addition & 1 deletion Router/PathIdentifiedUrlGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class PathIdentifiedUrlGenerator implements UrlGeneratorInterface
private $defaultIdentifier;
private $urlGenerator;

public function __construct(UrlGeneratorInterface $urlGenerator, string $routeParameter = 'site', string $defaultIdentifier = null)
public function __construct(UrlGeneratorInterface $urlGenerator, string $routeParameter = 'site', ?string $defaultIdentifier = null)
{
$this->routeParameter = $routeParameter;
$this->defaultIdentifier = $defaultIdentifier;
Expand Down
2 changes: 1 addition & 1 deletion Site/IdentifierMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function findIdentifierByHostname(string $hostname): ?string
return null;
}

public function findHostnamesByIdentifier(string $identifier, string $locale = null): array
public function findHostnamesByIdentifier(string $identifier, ?string $locale = null): array
{
if (!isset($this->mapping[$identifier])) {
return [];
Expand Down
2 changes: 1 addition & 1 deletion Site/IdentifierMappingInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ public function findIdentifierByHostname(string $hostname): ?string;
/**
* @return string[]
*/
public function findHostnamesByIdentifier(string $identifier, string $locale = null): array;
public function findHostnamesByIdentifier(string $identifier, ?string $locale = null): array;
}
3 changes: 1 addition & 2 deletions Site/PrefixedPathIdentifiedSiteResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ final class PrefixedPathIdentifiedSiteResolver implements SiteResolverInterface

/**
* @param string[] $identifiers
* @param string $defaultIdentifier
*/
public function __construct(SiteRepositoryInterface $siteRepository, array $identifiers, string $defaultIdentifier = null)
public function __construct(SiteRepositoryInterface $siteRepository, array $identifiers, ?string $defaultIdentifier = null)
{
$this->siteRepository = $siteRepository;
$this->defaultIdentifier = $defaultIdentifier;
Expand Down
2 changes: 1 addition & 1 deletion Tests/Site/IdentifierMappingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected function setUp(): void
/**
* @dataProvider identifierMappingData
*/
public function testFindIdentifierByHostnameReturnsCorrectIdentifier(string $hostname, string $expectedIdentifier = null): void
public function testFindIdentifierByHostnameReturnsCorrectIdentifier(string $hostname, ?string $expectedIdentifier = null): void
{
$identifier = $this->identifierMapping->findIdentifierByHostname($hostname);

Expand Down

0 comments on commit bdfd5a9

Please sign in to comment.