Skip to content

Commit 7c13b40

Browse files
committed
[PHP8.4] fixes
1 parent 9d54319 commit 7c13b40

36 files changed

+41
-46
lines changed

src/CoreShop/Bundle/ThemeBundle/Service/ThemeNotResolvedException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
class ThemeNotResolvedException extends \RuntimeException
2222
{
2323
public function __construct(
24-
\Exception $previousException = null,
24+
?\Exception $previousException = null,
2525
) {
2626
parent::__construct('Theme could not be resolved', 0, $previousException);
2727
}

src/CoreShop/Component/Address/Context/CountryNotFoundException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
class CountryNotFoundException extends \RuntimeException
2222
{
2323
public function __construct(
24-
\Exception $previousException = null,
24+
?\Exception $previousException = null,
2525
) {
2626
parent::__construct('Country could not be found!', 0, $previousException);
2727
}

src/CoreShop/Component/Core/Payment/Resolver/StoreBasedPaymentProviderResolver.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(
3131
) {
3232
}
3333

34-
public function resolvePaymentProviders(ResourceInterface $subject = null): array
34+
public function resolvePaymentProviders(?ResourceInterface $subject = null): array
3535
{
3636
return $this->paymentProviderRepository->findActiveForStore($this->storeContext->getStore());
3737
}

src/CoreShop/Component/Currency/Context/CurrencyNotFoundException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ final class CurrencyNotFoundException extends \RuntimeException
2222
{
2323
public function __construct(
2424
$message = null,
25-
\Exception $previousException = null,
25+
?\Exception $previousException = null,
2626
) {
2727
parent::__construct($message ?: 'Currency could not be found!', 0, $previousException);
2828
}

src/CoreShop/Component/Customer/Context/CustomerNotFoundException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
class CustomerNotFoundException extends \RuntimeException
2222
{
2323
public function __construct(
24-
\Exception $previousException = null,
24+
?\Exception $previousException = null,
2525
) {
2626
parent::__construct('Customer could not be found!', 0, $previousException);
2727
}

src/CoreShop/Component/Locale/Context/LocaleNotFoundException.php

+3-9
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,17 @@ final class LocaleNotFoundException extends \RuntimeException
2222
{
2323
public function __construct(
2424
$message = null,
25-
\Exception $previousException = null,
25+
?\Exception $previousException = null,
2626
) {
2727
parent::__construct($message ?: 'Locale could not be found!', 0, $previousException);
2828
}
2929

30-
/**
31-
* @param string $localeCode
32-
*/
33-
public static function notFound($localeCode): self
30+
public static function notFound(string $localeCode): self
3431
{
3532
return new self(sprintf('Locale "%s" cannot be found!', $localeCode));
3633
}
3734

38-
/**
39-
* @param string $localeCode
40-
*/
41-
public static function notAvailable($localeCode, array $availableLocalesCodes): self
35+
public static function notAvailable(string $localeCode, array $availableLocalesCodes): self
4236
{
4337
return new self(sprintf(
4438
'Locale "%s" is not available! The available ones are: "%s".',

src/CoreShop/Component/Order/Context/CartNotFoundException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class CartNotFoundException extends StorageListNotFoundException
2424
{
2525
public function __construct(
2626
$message = null,
27-
\Exception $previousException = null,
27+
?\Exception $previousException = null,
2828
) {
2929
parent::__construct($message ?: 'CoreShop was not able to figure out the current cart.', $previousException);
3030
}

src/CoreShop/Component/Order/Exception/NoPurchasableDiscountPriceFoundException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class NoPurchasableDiscountPriceFoundException extends \Exception
2222
{
2323
public function __construct(
2424
$calculatorClass,
25-
\Exception $previousException = null,
25+
?\Exception $previousException = null,
2626
) {
2727
parent::__construct(sprintf('Price Calculator "%s" was not able to match a valid discount price.', $calculatorClass), 0, $previousException);
2828
}

src/CoreShop/Component/Order/Exception/NoPurchasablePriceFoundException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class NoPurchasablePriceFoundException extends \Exception
2222
{
2323
public function __construct(
2424
$calculatorClass,
25-
\Exception $previousException = null,
25+
?\Exception $previousException = null,
2626
) {
2727
parent::__construct(sprintf('Price Calculator "%s" was not able to match a valid price.', $calculatorClass), 0, $previousException);
2828
}

src/CoreShop/Component/Order/Exception/NoPurchasableRetailPriceFoundException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class NoPurchasableRetailPriceFoundException extends \Exception
2222
{
2323
public function __construct(
2424
$calculatorClass,
25-
\Exception $previousException = null,
25+
?\Exception $previousException = null,
2626
) {
2727
parent::__construct(sprintf('Price Calculator "%s" was not able to match a valid retail price.', $calculatorClass), 0, $previousException);
2828
}

src/CoreShop/Component/Order/Exception/NoPurchasableWholesalePriceFoundException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class NoPurchasableWholesalePriceFoundException extends \Exception
2222
{
2323
public function __construct(
2424
$calculatorClass,
25-
\Exception $previousException = null,
25+
?\Exception $previousException = null,
2626
) {
2727
parent::__construct(sprintf('Price Calculator "%s" was not able to match a valid wholesale price.', $calculatorClass), 0, $previousException);
2828
}

src/CoreShop/Component/Payment/Resolver/PaymentProviderResolver.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __construct(
2828
) {
2929
}
3030

31-
public function resolvePaymentProviders(ResourceInterface $subject = null): array
31+
public function resolvePaymentProviders(?ResourceInterface $subject = null): array
3232
{
3333
return $this->paymentProviderRepository->findActive();
3434
}

src/CoreShop/Component/Payment/Resolver/PaymentProviderResolverInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222

2323
interface PaymentProviderResolverInterface
2424
{
25-
public function resolvePaymentProviders(ResourceInterface $subject = null): array;
25+
public function resolvePaymentProviders(?ResourceInterface $subject = null): array;
2626
}

src/CoreShop/Component/Payment/Resolver/RuleBasedPaymentProviderResolver.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(
3131
) {
3232
}
3333

34-
public function resolvePaymentProviders(ResourceInterface $subject = null): array
34+
public function resolvePaymentProviders(?ResourceInterface $subject = null): array
3535
{
3636
/**
3737
* @var PaymentProviderInterface[] $paymentProviders

src/CoreShop/Component/Payment/Validator/PaymentProviderValidator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(
3131

3232
public function isPaymentProviderValid(
3333
PaymentProviderInterface $paymentProvider,
34-
ResourceInterface $subject = null,
34+
?ResourceInterface $subject = null,
3535
): bool {
3636
$validProviders = $this->paymentProviderResolver->resolvePaymentProviders($subject);
3737

src/CoreShop/Component/Payment/Validator/PaymentProviderValidatorInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ interface PaymentProviderValidatorInterface
2525
{
2626
public function isPaymentProviderValid(
2727
PaymentProviderInterface $paymentProvider,
28-
ResourceInterface $subject = null,
28+
?ResourceInterface $subject = null,
2929
): bool;
3030
}

src/CoreShop/Component/Pimcore/Mail.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
class Mail extends \Pimcore\Mail
2222
{
23-
public function addRecipients(array|string $recipients = null)
23+
public function addRecipients(array|string|null $recipients = null)
2424
{
2525
$toRecipients = [];
2626

src/CoreShop/Component/Pimcore/Slug/SluggableInterface.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ public function getKey(): ?string;
2929
/**
3030
* @return UrlSlug[]
3131
*/
32-
public function getSlug(string $language = null): array;
32+
public function getSlug(?string $language = null): array;
3333

3434
/**
3535
* @param UrlSlug[] $slug
3636
*/
3737
public function setSlug(array $slug, ?string $language = null);
3838

39-
public function getNameForSlug(string $language = null): ?string;
39+
public function getNameForSlug(?string $language = null): ?string;
4040
}

src/CoreShop/Component/Pimcore/Slug/SluggableSlugger.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __construct(
2828
) {
2929
}
3030

31-
public function slug(SluggableInterface $sluggable, string $locale, string $suffix = null): string
31+
public function slug(SluggableInterface $sluggable, string $locale, ?string $suffix = null): string
3232
{
3333
$fallback = (string) $sluggable->getId();
3434

src/CoreShop/Component/Pimcore/Slug/SluggableSluggerInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@
2020

2121
interface SluggableSluggerInterface
2222
{
23-
public function slug(SluggableInterface $sluggable, string $locale, string $suffix = null): string;
23+
public function slug(SluggableInterface $sluggable, string $locale, ?string $suffix = null): string;
2424
}

src/CoreShop/Component/Pimcore/composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"require": {
2727
"pimcore/pimcore": "^12.0",
2828
"pimcore/web-to-print-bundle": "^1.3",
29-
"pimcore/admin-ui-classic-bundle": "^2.0"
29+
"pimcore/admin-ui-classic-bundle": "^2.0",
30+
"webmozart/assert": "^1.10"
3031
},
3132
"require-dev": {
3233
"phpstan/phpstan": "^1.10",

src/CoreShop/Component/Product/Exception/NoDiscountPriceFoundException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class NoDiscountPriceFoundException extends \Exception
2222
{
2323
public function __construct(
2424
$calculatorClass,
25-
\Exception $previousException = null,
25+
?\Exception $previousException = null,
2626
) {
2727
parent::__construct(sprintf('Price Calculator "%s" was not able to match a valid discount price.', $calculatorClass), 0, $previousException);
2828
}

src/CoreShop/Component/Product/Exception/NoPriceFoundException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class NoPriceFoundException extends \Exception
2222
{
2323
public function __construct(
2424
$calculatorClass,
25-
\Exception $previousException = null,
25+
?\Exception $previousException = null,
2626
) {
2727
parent::__construct(sprintf('Price Calculator "%s" was not able to match a valid price.', $calculatorClass), 0, $previousException);
2828
}

src/CoreShop/Component/Product/Exception/NoRetailPriceFoundException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class NoRetailPriceFoundException extends \Exception
2222
{
2323
public function __construct(
2424
$calculatorClass,
25-
\Exception $previousException = null,
25+
?\Exception $previousException = null,
2626
) {
2727
parent::__construct(sprintf('Price Calculator "%s" was not able to match a valid retail price.', $calculatorClass), 0, $previousException);
2828
}

src/CoreShop/Component/Product/Model/Category.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function hasChildCategories(): bool
3333
return $this->getChildren()->getTotalCount() > 0;
3434
}
3535

36-
public function getNameForSlug(string $language = null): ?string
36+
public function getNameForSlug(?string $language = null): ?string
3737
{
3838
return $this->getName($language);
3939
}

src/CoreShop/Component/ProductQuantityPriceRules/Exception/NoPriceFoundException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class NoPriceFoundException extends \RuntimeException
2222
{
2323
public function __construct(
2424
$calculatorClass,
25-
\Exception $previousException = null,
25+
?\Exception $previousException = null,
2626
) {
2727
parent::__construct(sprintf('Quantity Price Calculator "%s" was not able to match a valid price.', $calculatorClass), 0, $previousException);
2828
}

src/CoreShop/Component/ProductQuantityPriceRules/Exception/NoRuleFoundException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class NoRuleFoundException extends \RuntimeException
2222
{
2323
public function __construct(
2424
$message = null,
25-
\Exception $previousException = null,
25+
?\Exception $previousException = null,
2626
) {
2727
parent::__construct($message ?: 'No matching Quantity Price Rule found.', 0, $previousException);
2828
}

src/CoreShop/Component/Registry/Autoconfiguration.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static function registerForAutoConfiguration(
2727
ContainerBuilder $container,
2828
string $interface,
2929
string $tag,
30-
string $attribute = null,
30+
?string $attribute = null,
3131
bool $autoconfigureWithAttributes = false,
3232
): void {
3333
if (!$autoconfigureWithAttributes) {

src/CoreShop/Component/SEO/Model/SEOOpenGraphAwareInterface.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020

2121
interface SEOOpenGraphAwareInterface
2222
{
23-
public function getOGTitle(string $language = null): ?string;
23+
public function getOGTitle(?string $language = null): ?string;
2424

25-
public function getOGDescription(string $language = null): ?string;
25+
public function getOGDescription(?string $language = null): ?string;
2626

2727
public function getOGType(): ?string;
2828
}

src/CoreShop/Component/Shipping/Exception/NoShippingPriceFoundException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class NoShippingPriceFoundException extends \Exception
2222
{
2323
public function __construct(
2424
$calculatorClass,
25-
\Exception $previousException = null,
25+
?\Exception $previousException = null,
2626
) {
2727
parent::__construct(sprintf('Price Calculator "%s" was not able to match a valid shipping price.', $calculatorClass), 0, $previousException);
2828
}

src/CoreShop/Component/StorageList/Context/StorageListNotFoundException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class StorageListNotFoundException extends \RuntimeException
2222
{
2323
public function __construct(
2424
$message = null,
25-
\Exception $previousException = null,
25+
?\Exception $previousException = null,
2626
) {
2727
parent::__construct(
2828
$message ?: 'CoreShop was not able to find out the requested Storage List.',

src/CoreShop/Component/Store/Context/StoreNotFoundException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
class StoreNotFoundException extends \RuntimeException
2222
{
2323
public function __construct(
24-
\Exception $previousException = null,
24+
?\Exception $previousException = null,
2525
) {
2626
parent::__construct('Store could not be found!', 0, $previousException);
2727
}

src/CoreShop/Component/Variant/Model/AttributeGroupInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
interface AttributeGroupInterface extends PimcoreModelInterface
2424
{
25-
public function getName(string $language = null): ?string;
25+
public function getName(?string $language = null): ?string;
2626

2727
public function setName(?string $name, ?string $language = null): static;
2828

src/CoreShop/Component/Variant/Model/AttributeInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
interface AttributeInterface extends PimcoreModelInterface
2424
{
25-
public function getName(string $language = null): ?string;
25+
public function getName(?string $language = null): ?string;
2626

2727
public function setName(?string $name, ?string $language = null);
2828

src/CoreShop/Component/Variant/Model/ProductVariantAwareInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
interface ProductVariantAwareInterface extends PimcoreModelInterface
2525
{
26-
public function getName(string $language = null): ?string;
26+
public function getName(?string $language = null): ?string;
2727

2828
public function setName(?string $name, ?string $language = null);
2929

src/CoreShop/Component/Variant/Model/Resolved/ResolvedAttribute.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ResolvedAttribute
2929
private ArrayCollection $products;
3030

3131
public function __construct(
32-
AttributeInterface $attribute = null,
32+
?AttributeInterface $attribute = null,
3333
) {
3434
$this->products = new ArrayCollection();
3535
if ($attribute) {

0 commit comments

Comments
 (0)