mirror of
https://github.com/jbcr/Sylius.git
synced 2026-03-24 00:42:08 +01:00
Merge branch '1.13' into 2.0
* 1.13: [ECS] Fix nullable type declarations in the codebase [ECS] Fix nullable type declarations in Behat namespace [ECS] Add the NullableTypeDeclarationForDefaultNullValueFixer rule Add default label template in ShopBundle extending the UiBundle one Use extends instead of include in ShopBundle flashes template Manage confirmation modal for ShopBundle extending UiBundle Use Shop pagination macro in templates Use Shop messages macro in templates Use Shop flags macro in templates Use Shop headers macro in templates Use Shop buttons macro in templates Add upmerging from 2.0 to api-platform-3
This commit is contained in:
3
.github/workflows/upmerge_pr.yaml
vendored
3
.github/workflows/upmerge_pr.yaml
vendored
@@ -29,6 +29,9 @@ jobs:
|
||||
-
|
||||
base_branch: "2.0"
|
||||
target_branch: "bootstrap-admin-panel"
|
||||
-
|
||||
base_branch: "2.0"
|
||||
target_branch: "api-platform-3"
|
||||
|
||||
steps:
|
||||
-
|
||||
|
||||
2
ecs.php
2
ecs.php
@@ -14,6 +14,7 @@ declare(strict_types=1);
|
||||
use PhpCsFixer\Fixer\ClassNotation\OrderedTypesFixer;
|
||||
use PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer;
|
||||
use PhpCsFixer\Fixer\Comment\HeaderCommentFixer;
|
||||
use PhpCsFixer\Fixer\FunctionNotation\NullableTypeDeclarationForDefaultNullValueFixer;
|
||||
use PhpCsFixer\Fixer\LanguageConstruct\ErrorSuppressionFixer;
|
||||
use PhpCsFixer\Fixer\Phpdoc\PhpdocSeparationFixer;
|
||||
use SlevomatCodingStandard\Sniffs\Commenting\InlineDocCommentDeclarationSniff;
|
||||
@@ -32,6 +33,7 @@ return static function (ECSConfig $config): void {
|
||||
]);
|
||||
$config->ruleWithConfiguration(PhpdocSeparationFixer::class, ['groups' => [['Given', 'When', 'Then']]]);
|
||||
$config->ruleWithConfiguration(OrderedTypesFixer::class, ['null_adjustment' => 'always_last']);
|
||||
$config->ruleWithConfiguration(NullableTypeDeclarationForDefaultNullValueFixer::class, ['use_nullable_type_declaration' => true]);
|
||||
$config->ruleWithConfiguration(
|
||||
HeaderCommentFixer::class,
|
||||
[
|
||||
|
||||
@@ -72,7 +72,7 @@ final class ManagingAdministratorsContext implements Context
|
||||
* @When I do not specify its email
|
||||
* @When I change its email to :email
|
||||
*/
|
||||
public function iSpecifyItsEmailAs(string $email = null): void
|
||||
public function iSpecifyItsEmailAs(?string $email = null): void
|
||||
{
|
||||
if ($email !== null) {
|
||||
$this->client->addRequestData('email', $email);
|
||||
@@ -84,7 +84,7 @@ final class ManagingAdministratorsContext implements Context
|
||||
* @When I do not specify its name
|
||||
* @When I change its name to :username
|
||||
*/
|
||||
public function iSpecifyItsNameAs(string $username = null): void
|
||||
public function iSpecifyItsNameAs(?string $username = null): void
|
||||
{
|
||||
if ($username !== null) {
|
||||
$this->client->addRequestData('username', $username);
|
||||
@@ -104,7 +104,7 @@ final class ManagingAdministratorsContext implements Context
|
||||
* @When I do not specify its password
|
||||
* @When I change its password to :password
|
||||
*/
|
||||
public function iSpecifyItsPasswordAs(string $password = null): void
|
||||
public function iSpecifyItsPasswordAs(?string $password = null): void
|
||||
{
|
||||
if ($password !== null) {
|
||||
$this->client->addRequestData('plainPassword', $password);
|
||||
|
||||
@@ -146,7 +146,7 @@ final class ManagingPaymentMethodsContext implements Context
|
||||
* @When I specify its code as :code
|
||||
* @When I do not specify its code
|
||||
*/
|
||||
public function iSpecifyItsCodeAs(string $code = null): void
|
||||
public function iSpecifyItsCodeAs(?string $code = null): void
|
||||
{
|
||||
$this->client->addRequestData('code', $code);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ final class ManagingProductAssociationTypesContext implements Context
|
||||
* @When I name it :productAssociationTypeName in :localeCode
|
||||
* @When I do not name it
|
||||
*/
|
||||
public function iNameItIn(string $productAssociationTypeName = null, string $localeCode = 'en_US'): void
|
||||
public function iNameItIn(?string $productAssociationTypeName = null, string $localeCode = 'en_US'): void
|
||||
{
|
||||
$this->client->updateRequestData([
|
||||
'translations' => [
|
||||
|
||||
@@ -106,7 +106,7 @@ final class ManagingProductsContext implements Context
|
||||
* @When I specify its code as :code
|
||||
* @When I do not specify its code
|
||||
*/
|
||||
public function iSpecifyItsCodeAs(string $code = null): void
|
||||
public function iSpecifyItsCodeAs(?string $code = null): void
|
||||
{
|
||||
$this->client->addRequestData('code', $code);
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ final class ManagingShipmentsContext implements Context
|
||||
string $orderNumber,
|
||||
string $shippingState,
|
||||
CustomerInterface $customer,
|
||||
ChannelInterface $channel = null,
|
||||
?ChannelInterface $channel = null,
|
||||
): void {
|
||||
$this->client->index(Resources::SHIPMENTS);
|
||||
|
||||
|
||||
@@ -286,7 +286,7 @@ final class ManagingShippingMethodsContext implements Context
|
||||
* @When /^I define it for the (zone named "[^"]+")$/
|
||||
* @When I do not specify its zone
|
||||
*/
|
||||
public function iDefineItForTheZone(ZoneInterface $zone = null): void
|
||||
public function iDefineItForTheZone(?ZoneInterface $zone = null): void
|
||||
{
|
||||
if (null !== $zone) {
|
||||
$this->client->addRequestData('zone', $this->iriConverter->getIriFromResource($zone));
|
||||
|
||||
@@ -33,7 +33,7 @@ final class PromotionContext implements Context
|
||||
* @When I use coupon with code :couponCode
|
||||
* @When I remove coupon from my cart
|
||||
*/
|
||||
public function iUseCouponWithCode(string $couponCode = null): void
|
||||
public function iUseCouponWithCode(?string $couponCode = null): void
|
||||
{
|
||||
$this->useCouponCode($couponCode);
|
||||
}
|
||||
|
||||
@@ -855,7 +855,7 @@ final class CatalogPromotionContext implements Context
|
||||
array $channels = [],
|
||||
array $scopes = [],
|
||||
array $actions = [],
|
||||
int $priority = null,
|
||||
?int $priority = null,
|
||||
bool $exclusive = false,
|
||||
?string $startDate = null,
|
||||
?string $endDate = null,
|
||||
|
||||
@@ -122,10 +122,10 @@ final class ChannelContext implements Context
|
||||
* @Given the store operates on a channel identified by :channelCode code
|
||||
*/
|
||||
public function theStoreOperatesOnAChannelNamed(
|
||||
string $channelName = null,
|
||||
string $currencyCode = null,
|
||||
string $hostname = null,
|
||||
string $channelCode = null,
|
||||
?string $channelName = null,
|
||||
?string $currencyCode = null,
|
||||
?string $hostname = null,
|
||||
?string $channelCode = null,
|
||||
): void {
|
||||
$channelCode = $channelCode ?? StringInflector::nameToLowercaseCode($channelName);
|
||||
$channelName = $channelName ?? $channelCode;
|
||||
|
||||
@@ -125,8 +125,8 @@ final class CheckoutContext implements Context
|
||||
|
||||
private function completeCheckout(
|
||||
OrderInterface $order,
|
||||
ShippingMethodInterface $shippingMethod = null,
|
||||
PaymentMethodInterface $paymentMethod = null,
|
||||
?ShippingMethodInterface $shippingMethod = null,
|
||||
?PaymentMethodInterface $paymentMethod = null,
|
||||
): void {
|
||||
$shippingMethod = $shippingMethod ?: $this->shippingMethodRepository->findOneBy([]);
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ final class CustomerContext implements Context
|
||||
$email,
|
||||
$firstName = null,
|
||||
$lastName = null,
|
||||
\DateTimeInterface $createdAt = null,
|
||||
?\DateTimeInterface $createdAt = null,
|
||||
$phoneNumber = null,
|
||||
) {
|
||||
/** @var CustomerInterface $customer */
|
||||
|
||||
@@ -79,7 +79,7 @@ final class ProductContext implements Context
|
||||
* @Given /^the store(?:| also) has a product "([^"]+)" priced at ("[^"]+")$/
|
||||
* @Given /^the store(?:| also) has a product "([^"]+)" priced at ("[^"]+") in ("[^"]+" channel)$/
|
||||
*/
|
||||
public function storeHasAProductPricedAt($productName, int $price = 100, ChannelInterface $channel = null): void
|
||||
public function storeHasAProductPricedAt($productName, int $price = 100, ?ChannelInterface $channel = null): void
|
||||
{
|
||||
$product = $this->createProduct($productName, $price, $channel);
|
||||
|
||||
@@ -330,7 +330,7 @@ final class ProductContext implements Context
|
||||
ProductInterface $product,
|
||||
$productVariantName,
|
||||
$price,
|
||||
ChannelInterface $channel = null,
|
||||
?ChannelInterface $channel = null,
|
||||
) {
|
||||
$this->createProductVariant(
|
||||
$product,
|
||||
@@ -1368,7 +1368,7 @@ final class ProductContext implements Context
|
||||
return (int) round((float) str_replace(['€', '£', '$'], '', $price) * 100, 2);
|
||||
}
|
||||
|
||||
private function createProduct(string $productName, int $price = 100, ChannelInterface $channel = null): ProductInterface
|
||||
private function createProduct(string $productName, int $price = 100, ?ChannelInterface $channel = null): ProductInterface
|
||||
{
|
||||
if (null === $channel && $this->sharedStorage->has('channel')) {
|
||||
$channel = $this->sharedStorage->get('channel');
|
||||
@@ -1458,7 +1458,7 @@ final class ProductContext implements Context
|
||||
$productVariantName,
|
||||
$price,
|
||||
$code,
|
||||
ChannelInterface $channel = null,
|
||||
?ChannelInterface $channel = null,
|
||||
$position = null,
|
||||
$shippingRequired = true,
|
||||
int $currentStock = 0,
|
||||
@@ -1549,7 +1549,7 @@ final class ProductContext implements Context
|
||||
$productVariant->addTranslation($translation);
|
||||
}
|
||||
|
||||
private function createChannelPricingForChannel(int $price, ChannelInterface $channel = null): ChannelPricingInterface
|
||||
private function createChannelPricingForChannel(int $price, ?ChannelInterface $channel = null): ChannelPricingInterface
|
||||
{
|
||||
/** @var ChannelPricingInterface $channelPricing */
|
||||
$channelPricing = $this->channelPricingFactory->createNew();
|
||||
|
||||
@@ -136,7 +136,7 @@ final class ProductReviewContext implements Context
|
||||
$title,
|
||||
$rating,
|
||||
$comment,
|
||||
CustomerInterface $customer = null,
|
||||
?CustomerInterface $customer = null,
|
||||
$transition = ProductReviewTransitions::TRANSITION_ACCEPT,
|
||||
) {
|
||||
/** @var ReviewInterface $review */
|
||||
|
||||
@@ -1039,8 +1039,8 @@ final class PromotionContext implements Context
|
||||
?array $rules = null,
|
||||
?array $actions = null,
|
||||
array $coupons = [],
|
||||
int $priority = null,
|
||||
int $usageLimit = null,
|
||||
?int $priority = null,
|
||||
?int $usageLimit = null,
|
||||
bool $couponBased = false,
|
||||
bool $exclusive = false,
|
||||
bool $appliesToDiscounted = true,
|
||||
@@ -1081,7 +1081,7 @@ final class PromotionContext implements Context
|
||||
PromotionInterface $promotion,
|
||||
int $discount,
|
||||
array $configuration = [],
|
||||
PromotionRuleInterface $rule = null,
|
||||
?PromotionRuleInterface $rule = null,
|
||||
): void {
|
||||
$channelCode = $this->getChannelCode();
|
||||
|
||||
@@ -1097,7 +1097,7 @@ final class PromotionContext implements Context
|
||||
PromotionInterface $promotion,
|
||||
float $discount,
|
||||
array $configuration = [],
|
||||
PromotionRuleInterface $rule = null,
|
||||
?PromotionRuleInterface $rule = null,
|
||||
): void {
|
||||
$channelCode = $this->getChannelCode();
|
||||
|
||||
@@ -1113,8 +1113,8 @@ final class PromotionContext implements Context
|
||||
PromotionInterface $promotion,
|
||||
int $discount,
|
||||
array $configuration = [],
|
||||
PromotionRuleInterface $rule = null,
|
||||
ChannelInterface $channel = null,
|
||||
?PromotionRuleInterface $rule = null,
|
||||
?ChannelInterface $channel = null,
|
||||
): void {
|
||||
$channelCode = (null !== $channel) ? $channel->getCode() : $this->sharedStorage->get('channel')->getCode();
|
||||
|
||||
@@ -1125,7 +1125,7 @@ final class PromotionContext implements Context
|
||||
PromotionInterface $promotion,
|
||||
float $discount,
|
||||
array $configuration = [],
|
||||
PromotionRuleInterface $rule = null,
|
||||
?PromotionRuleInterface $rule = null,
|
||||
): void {
|
||||
$this->persistPromotion($promotion, $this->actionFactory->createPercentageDiscount($discount), $configuration, $rule);
|
||||
}
|
||||
@@ -1134,7 +1134,7 @@ final class PromotionContext implements Context
|
||||
PromotionInterface $promotion,
|
||||
PromotionActionInterface $action,
|
||||
array $configuration,
|
||||
PromotionRuleInterface $rule = null,
|
||||
?PromotionRuleInterface $rule = null,
|
||||
): void {
|
||||
$configuration = array_merge_recursive($action->getConfiguration(), $configuration);
|
||||
$action->setConfiguration($configuration);
|
||||
|
||||
@@ -294,8 +294,8 @@ final class ShippingContext implements Context
|
||||
string $shippingMethodName,
|
||||
int $firstFee,
|
||||
ChannelInterface $firstChannel,
|
||||
int $secondFee = null,
|
||||
ChannelInterface $secondChannel = null,
|
||||
?int $secondFee = null,
|
||||
?ChannelInterface $secondChannel = null,
|
||||
): void {
|
||||
$configuration = [];
|
||||
$channels = [];
|
||||
|
||||
@@ -85,7 +85,7 @@ final class ZoneContext implements Context
|
||||
* @Given the store has a zone :zoneName with code :code
|
||||
* @Given the store also has a zone :zoneName with code :code
|
||||
*/
|
||||
public function theStoreHasAZoneWithCode(string $zoneName, string $code = null): void
|
||||
public function theStoreHasAZoneWithCode(string $zoneName, ?string $code = null): void
|
||||
{
|
||||
$this->saveZone($this->createZone($zoneName, $code, Scope::ALL), 'zone');
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ final class LocaleContext implements Context
|
||||
Assert::true($this->dashboardPage->isSectionWithLabelVisible($this->translate('sylius.menu.admin.main.catalog.header', $localeCode)));
|
||||
}
|
||||
|
||||
private function translate(string $text, string $localeCode, string $domain = null): string
|
||||
private function translate(string $text, string $localeCode, ?string $domain = null): string
|
||||
{
|
||||
return $this->translator->trans($text, [], $domain, $localeCode);
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ final class ManagingChannelsContext implements Context
|
||||
* @When I do not name it
|
||||
* @When I remove its name
|
||||
*/
|
||||
public function iNameIt(string $name = null): void
|
||||
public function iNameIt(?string $name = null): void
|
||||
{
|
||||
$this->createPage->nameIt($name ?? '');
|
||||
}
|
||||
@@ -98,7 +98,7 @@ final class ManagingChannelsContext implements Context
|
||||
* @When I choose :defaultLocaleName as a default locale
|
||||
* @When I do not choose default locale
|
||||
*/
|
||||
public function iChooseAsADefaultLocale(string $defaultLocaleName = null): void
|
||||
public function iChooseAsADefaultLocale(?string $defaultLocaleName = null): void
|
||||
{
|
||||
$this->createPage->chooseDefaultLocale($defaultLocaleName);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ final class ManagingShipmentsContext implements Context
|
||||
string $orderNumber,
|
||||
string $shippingState,
|
||||
CustomerInterface $customer,
|
||||
Channel $channel = null,
|
||||
?Channel $channel = null,
|
||||
): void {
|
||||
$parameters = [
|
||||
'number' => $orderNumber,
|
||||
|
||||
@@ -58,7 +58,7 @@ final class ManagingShippingMethodsContext implements Context
|
||||
/**
|
||||
* @When I specify its position as :position
|
||||
*/
|
||||
public function iSpecifyItsPositionAs(int $position = null)
|
||||
public function iSpecifyItsPositionAs(?int $position = null)
|
||||
{
|
||||
$this->createPage->specifyPosition($position);
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ final class ManagingTaxonsContext implements Context
|
||||
* @When I attach the :path image
|
||||
* @When I attach the :path image to this taxon
|
||||
*/
|
||||
public function iAttachImageWithType(string $path, string $type = null): void
|
||||
public function iAttachImageWithType(string $path, ?string $type = null): void
|
||||
{
|
||||
$currentPage = $this->resolveCurrentPage();
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ final class CheckoutAddressingContext implements Context
|
||||
* @When /^I specified the billing (address as "[^"]+", "[^"]+", "[^"]+", "[^"]+" for "[^"]+")$/
|
||||
* @When /^I define the billing (address as "[^"]+", "[^"]+", "[^"]+", "[^"]+" for "[^"]+")$/
|
||||
*/
|
||||
public function iSpecifiedTheBillingAddress(AddressInterface $address = null)
|
||||
public function iSpecifiedTheBillingAddress(?AddressInterface $address = null)
|
||||
{
|
||||
if (null === $address) {
|
||||
$address = $this->createDefaultAddress();
|
||||
@@ -257,7 +257,7 @@ final class CheckoutAddressingContext implements Context
|
||||
* @When /^I proceed selecting ("[^"]+" as billing country)$/
|
||||
*/
|
||||
public function iProceedSelectingBillingCountry(
|
||||
CountryInterface $shippingCountry = null,
|
||||
?CountryInterface $shippingCountry = null,
|
||||
string $localeCode = 'en_US',
|
||||
?string $email = null,
|
||||
) {
|
||||
@@ -278,7 +278,7 @@ final class CheckoutAddressingContext implements Context
|
||||
*/
|
||||
public function iProceedLoggingAsGuestWithAsBillingCountry(
|
||||
string $email,
|
||||
CountryInterface $shippingCountry = null,
|
||||
?CountryInterface $shippingCountry = null,
|
||||
): void {
|
||||
$this->addressPage->open();
|
||||
$this->addressPage->specifyEmail($email);
|
||||
|
||||
@@ -118,7 +118,7 @@ final class CheckoutContext implements Context
|
||||
* @When /^I proceed selecting ("[^"]+" as billing country) with "([^"]+)" method$/
|
||||
*/
|
||||
public function iProceedSelectingBillingCountryAndShippingMethod(
|
||||
CountryInterface $shippingCountry = null,
|
||||
?CountryInterface $shippingCountry = null,
|
||||
?string $shippingMethodName = null,
|
||||
): void {
|
||||
$this->addressingContext->iProceedSelectingBillingCountry($shippingCountry);
|
||||
|
||||
@@ -21,7 +21,7 @@ final class NotificationExpectationMismatchException extends \RuntimeException
|
||||
NotificationType $expectedType,
|
||||
$expectedMessage,
|
||||
$code = 0,
|
||||
\Exception $previous = null,
|
||||
?\Exception $previous = null,
|
||||
) {
|
||||
$message = sprintf(
|
||||
'Expected *%s* notification with a "%s" message was not found',
|
||||
|
||||
@@ -22,7 +22,7 @@ class CreatePage extends BaseCreatePage implements CreatePageInterface
|
||||
{
|
||||
use ChoosesName;
|
||||
|
||||
public function addProvince(string $name, string $code, string $abbreviation = null): void
|
||||
public function addProvince(string $name, string $code, ?string $abbreviation = null): void
|
||||
{
|
||||
$this->getDocument()->clickLink('Add province');
|
||||
|
||||
|
||||
@@ -19,5 +19,5 @@ interface CreatePageInterface extends BaseCreatePageInterface
|
||||
{
|
||||
public function chooseName(string $name): void;
|
||||
|
||||
public function addProvince(string $name, string $code, string $abbreviation = null): void;
|
||||
public function addProvince(string $name, string $code, ?string $abbreviation = null): void;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ class UpdatePage extends BaseUpdatePage implements UpdatePageInterface
|
||||
}
|
||||
}
|
||||
|
||||
public function addProvince(string $name, string $code, string $abbreviation = null): void
|
||||
public function addProvince(string $name, string $code, ?string $abbreviation = null): void
|
||||
{
|
||||
$this->clickAddProvinceButton();
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ interface UpdatePageInterface extends BaseUpdatePageInterface
|
||||
|
||||
public function isThereProvinceWithCode(string $provinceCode): bool;
|
||||
|
||||
public function addProvince(string $name, string $code, string $abbreviation = null): void;
|
||||
public function addProvince(string $name, string $code, ?string $abbreviation = null): void;
|
||||
|
||||
public function removeProvince(string $provinceName): void;
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ class CreateSimpleProductPage extends BaseCreatePage implements CreateSimpleProd
|
||||
$productTaxonsElement->setValue(implode(',', $productTaxonsCodes));
|
||||
}
|
||||
|
||||
public function attachImage(string $path, string $type = null): void
|
||||
public function attachImage(string $path, ?string $type = null): void
|
||||
{
|
||||
$this->clickTabIfItsNotActive('media');
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ class UpdateConfigurableProductPage extends BaseUpdatePage implements UpdateConf
|
||||
return $productVariant->getCode() === $imageForm->find('css', 'input[type="hidden"]')->getValue();
|
||||
}
|
||||
|
||||
public function attachImage(string $path, string $type = null, ?ProductVariantInterface $productVariant = null): void
|
||||
public function attachImage(string $path, ?string $type = null, ?ProductVariantInterface $productVariant = null): void
|
||||
{
|
||||
$this->clickTabIfItsNotActive('media');
|
||||
$this->getDocument()->clickLink('Add');
|
||||
|
||||
@@ -41,7 +41,7 @@ interface UpdateConfigurableProductPageInterface extends UpdatePageInterface
|
||||
|
||||
public function hasLastImageAVariant(ProductVariantInterface $productVariant): bool;
|
||||
|
||||
public function attachImage(string $path, string $type = null, ?ProductVariantInterface $productVariant = null): void;
|
||||
public function attachImage(string $path, ?string $type = null, ?ProductVariantInterface $productVariant = null): void;
|
||||
|
||||
public function changeImageWithType(string $type, string $path): void;
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ class UpdateSimpleProductPage extends BaseUpdatePage implements UpdateSimpleProd
|
||||
return in_array($statusCode, [200, 304], true);
|
||||
}
|
||||
|
||||
public function attachImage(string $path, string $type = null): void
|
||||
public function attachImage(string $path, ?string $type = null): void
|
||||
{
|
||||
$this->clickTabIfItsNotActive('media');
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ interface UpdateSimpleProductPageInterface extends BaseUpdatePageInterface
|
||||
|
||||
public function isImageWithTypeDisplayed(string $type): bool;
|
||||
|
||||
public function attachImage(string $path, string $type = null): void;
|
||||
public function attachImage(string $path, ?string $type = null): void;
|
||||
|
||||
public function changeImageWithType(string $type, string $path): void;
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ class CreatePage extends BaseCreatePage implements CreatePageInterface
|
||||
$this->getDocument()->fillField(sprintf('sylius_taxon_translations_%s_slug', $languageCode), $slug);
|
||||
}
|
||||
|
||||
public function attachImage(string $path, string $type = null): void
|
||||
public function attachImage(string $path, ?string $type = null): void
|
||||
{
|
||||
$filesPath = $this->getParameter('files_path');
|
||||
|
||||
@@ -102,7 +102,7 @@ class CreatePage extends BaseCreatePage implements CreatePageInterface
|
||||
$imageForm->find('css', 'input[type="file"]')->attachFile($filesPath . $path);
|
||||
}
|
||||
|
||||
public function getLeaves(TaxonInterface $parentTaxon = null): array
|
||||
public function getLeaves(?TaxonInterface $parentTaxon = null): array
|
||||
{
|
||||
return $this->getDocument()->findAll('css', '.sylius-tree__item');
|
||||
}
|
||||
|
||||
@@ -36,14 +36,14 @@ interface CreatePageInterface extends BaseCreatePageInterface
|
||||
|
||||
public function specifySlug(string $slug, string $languageCode): void;
|
||||
|
||||
public function attachImage(string $path, string $type = null): void;
|
||||
public function attachImage(string $path, ?string $type = null): void;
|
||||
|
||||
/**
|
||||
* @return NodeElement[]
|
||||
*
|
||||
* @throws ElementNotFoundException
|
||||
*/
|
||||
public function getLeaves(TaxonInterface $parentTaxon = null): array;
|
||||
public function getLeaves(?TaxonInterface $parentTaxon = null): array;
|
||||
|
||||
public function activateLanguageTab(string $locale): void;
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ class UpdatePage extends BaseUpdatePage implements UpdatePageInterface
|
||||
$this->getDocument()->fillField(sprintf('sylius_taxon_translations_%s_slug', $languageCode), $slug);
|
||||
}
|
||||
|
||||
public function attachImage(string $path, string $type = null): void
|
||||
public function attachImage(string $path, ?string $type = null): void
|
||||
{
|
||||
$filesPath = $this->getParameter('files_path');
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ interface UpdatePageInterface extends BaseUpdatePageInterface
|
||||
|
||||
public function specifySlug(string $slug, string $languageCode): void;
|
||||
|
||||
public function attachImage(string $path, string $type = null): void;
|
||||
public function attachImage(string $path, ?string $type = null): void;
|
||||
|
||||
public function isImageWithTypeDisplayed(string $type): bool;
|
||||
|
||||
|
||||
@@ -43,17 +43,17 @@ final class SectionAwareIriConverter implements SectionAwareIriConverterInterfac
|
||||
private RouterInterface $router,
|
||||
PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory,
|
||||
PropertyMetadataFactoryInterface $propertyMetadataFactory,
|
||||
PropertyAccessorInterface $propertyAccessor = null,
|
||||
IdentifiersExtractorInterface $identifiersExtractor = null,
|
||||
ResourceClassResolverInterface $resourceClassResolver = null,
|
||||
ResourceMetadataFactoryInterface $resourceMetadataFactory = null,
|
||||
?PropertyAccessorInterface $propertyAccessor = null,
|
||||
?IdentifiersExtractorInterface $identifiersExtractor = null,
|
||||
?ResourceClassResolverInterface $resourceClassResolver = null,
|
||||
?ResourceMetadataFactoryInterface $resourceMetadataFactory = null,
|
||||
) {
|
||||
$this->identifiersExtractor = $identifiersExtractor ?: new IdentifiersExtractor($propertyNameCollectionFactory, $propertyMetadataFactory, $propertyAccessor ?? PropertyAccess::createPropertyAccessor());
|
||||
$this->resourceClassResolver = $resourceClassResolver;
|
||||
$this->resourceMetadataFactory = $resourceMetadataFactory;
|
||||
}
|
||||
|
||||
public function getIriFromResourceInSection(object $item, string $section, int $referenceType = null): string
|
||||
public function getIriFromResourceInSection(object $item, string $section, ?int $referenceType = null): string
|
||||
{
|
||||
$resourceClass = $this->getResourceClass($item, true);
|
||||
|
||||
|
||||
@@ -15,5 +15,5 @@ namespace Sylius\Behat\Service\Converter;
|
||||
|
||||
interface SectionAwareIriConverterInterface
|
||||
{
|
||||
public function getIriFromResourceInSection(object $item, string $section, int $referenceType = null): string;
|
||||
public function getIriFromResourceInSection(object $item, string $section, ?int $referenceType = null): string;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ final class JavaScriptTestHelper implements JavaScriptTestHelperInterface
|
||||
callable $callable,
|
||||
string $exceptionClass,
|
||||
?int $timeout = null,
|
||||
NotificationType $type = null,
|
||||
?NotificationType $type = null,
|
||||
): void {
|
||||
$start = microtime(true);
|
||||
$timeout ??= $this->defaultTimeout;
|
||||
|
||||
@@ -35,7 +35,7 @@ final class MergingXmlExtractor extends AbstractResourceExtractor implements Pro
|
||||
*/
|
||||
public function __construct(
|
||||
array $paths,
|
||||
ContainerInterface $container = null,
|
||||
?ContainerInterface $container = null,
|
||||
private ?MetadataMergerInterface $merger = null,
|
||||
) {
|
||||
parent::__construct($paths, $container);
|
||||
|
||||
@@ -21,7 +21,7 @@ class OrderTotalHasChangedException extends Exception
|
||||
public function __construct(
|
||||
string $message = 'Order total has changed during checkout process.',
|
||||
int $code = 0,
|
||||
Throwable $previous = null,
|
||||
?Throwable $previous = null,
|
||||
) {
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
@@ -19,12 +19,12 @@ use Sylius\Bundle\ApiBundle\Command\Account\ResetPassword;
|
||||
|
||||
final class AccountResetPasswordItemDataProvider implements RestrictedDataProviderInterface, ItemDataProviderInterface
|
||||
{
|
||||
public function getItem(string $resourceClass, $id, string $operationName = null, array $context = [])
|
||||
public function getItem(string $resourceClass, $id, ?string $operationName = null, array $context = [])
|
||||
{
|
||||
return new ResetPassword($id);
|
||||
}
|
||||
|
||||
public function supports(string $resourceClass, string $operationName = null, array $context = []): bool
|
||||
public function supports(string $resourceClass, ?string $operationName = null, array $context = []): bool
|
||||
{
|
||||
return is_a($resourceClass, ResetPassword::class, true);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ final class AdminOrderItemAdjustmentsSubresourceDataProvider implements Restrict
|
||||
}
|
||||
|
||||
/** @param array<array-key, mixed> $context */
|
||||
public function supports(string $resourceClass, string $operationName = null, array $context = []): bool
|
||||
public function supports(string $resourceClass, ?string $operationName = null, array $context = []): bool
|
||||
{
|
||||
return
|
||||
is_a($resourceClass, AdjustmentInterface::class, true) &&
|
||||
@@ -46,7 +46,7 @@ final class AdminOrderItemAdjustmentsSubresourceDataProvider implements Restrict
|
||||
*
|
||||
* @return iterable<AdjustmentInterface>
|
||||
*/
|
||||
public function getSubresource(string $resourceClass, array $identifiers, array $context, string $operationName = null): iterable
|
||||
public function getSubresource(string $resourceClass, array $identifiers, array $context, ?string $operationName = null): iterable
|
||||
{
|
||||
$orderItem = $this->orderItemRepository->find(reset($context['subresource_identifiers']));
|
||||
if (null === $orderItem) {
|
||||
|
||||
@@ -19,12 +19,12 @@ use Sylius\Bundle\CoreBundle\Message\Admin\Account\ResetPassword;
|
||||
|
||||
final class AdminResetPasswordItemDataProvider implements RestrictedDataProviderInterface, ItemDataProviderInterface
|
||||
{
|
||||
public function getItem(string $resourceClass, $id, string $operationName = null, array $context = [])
|
||||
public function getItem(string $resourceClass, $id, ?string $operationName = null, array $context = [])
|
||||
{
|
||||
return new ResetPassword($id);
|
||||
}
|
||||
|
||||
public function supports(string $resourceClass, string $operationName = null, array $context = []): bool
|
||||
public function supports(string $resourceClass, ?string $operationName = null, array $context = []): bool
|
||||
{
|
||||
return is_a($resourceClass, ResetPassword::class, true);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ final class ChannelAwareItemDataProvider implements ItemDataProviderInterface
|
||||
) {
|
||||
}
|
||||
|
||||
public function getItem(string $resourceClass, $id, string $operationName = null, array $context = []): ?object
|
||||
public function getItem(string $resourceClass, $id, ?string $operationName = null, array $context = []): ?object
|
||||
{
|
||||
return $this->itemDataProvider->getItem($resourceClass, $id, $operationName, $this->processContext($context));
|
||||
}
|
||||
|
||||
@@ -24,12 +24,12 @@ final class ChannelsCollectionDataProvider implements ContextAwareCollectionData
|
||||
{
|
||||
}
|
||||
|
||||
public function getCollection(string $resourceClass, string $operationName = null, array $context = []): array
|
||||
public function getCollection(string $resourceClass, ?string $operationName = null, array $context = []): array
|
||||
{
|
||||
return [$this->channelContext->getChannel()];
|
||||
}
|
||||
|
||||
public function supports(string $resourceClass, string $operationName = null, array $context = []): bool
|
||||
public function supports(string $resourceClass, ?string $operationName = null, array $context = []): bool
|
||||
{
|
||||
return is_a($resourceClass, ChannelInterface::class, true) && $this->isShopGetCollectionOperation($context);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ final class CustomerItemDataProvider implements RestrictedDataProviderInterface,
|
||||
) {
|
||||
}
|
||||
|
||||
public function getItem(string $resourceClass, $id, string $operationName = null, array $context = [])
|
||||
public function getItem(string $resourceClass, $id, ?string $operationName = null, array $context = [])
|
||||
{
|
||||
/** @var ShopUserInterface|null $user */
|
||||
$user = $this->userContext->getUser();
|
||||
@@ -53,7 +53,7 @@ final class CustomerItemDataProvider implements RestrictedDataProviderInterface,
|
||||
return null;
|
||||
}
|
||||
|
||||
public function supports(string $resourceClass, string $operationName = null, array $context = []): bool
|
||||
public function supports(string $resourceClass, ?string $operationName = null, array $context = []): bool
|
||||
{
|
||||
return is_a($resourceClass, CustomerInterface::class, true);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ final class OrderAdjustmentsSubresourceDataProvider implements RestrictedDataPro
|
||||
{
|
||||
}
|
||||
|
||||
public function supports(string $resourceClass, string $operationName = null, array $context = []): bool
|
||||
public function supports(string $resourceClass, ?string $operationName = null, array $context = []): bool
|
||||
{
|
||||
$subresourceIdentifiers = $context['subresource_identifiers'] ?? null;
|
||||
|
||||
@@ -37,7 +37,7 @@ final class OrderAdjustmentsSubresourceDataProvider implements RestrictedDataPro
|
||||
;
|
||||
}
|
||||
|
||||
public function getSubresource(string $resourceClass, array $identifiers, array $context, string $operationName = null)
|
||||
public function getSubresource(string $resourceClass, array $identifiers, array $context, ?string $operationName = null)
|
||||
{
|
||||
$subresourceIdentifiers = $context['subresource_identifiers'];
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ final class OrderItemAdjustmentsSubresourceDataProvider implements RestrictedDat
|
||||
}
|
||||
|
||||
/** @param array<array-key, mixed> $context */
|
||||
public function supports(string $resourceClass, string $operationName = null, array $context = []): bool
|
||||
public function supports(string $resourceClass, ?string $operationName = null, array $context = []): bool
|
||||
{
|
||||
$subresourceIdentifiers = $context['subresource_identifiers'] ?? null;
|
||||
|
||||
@@ -43,7 +43,7 @@ final class OrderItemAdjustmentsSubresourceDataProvider implements RestrictedDat
|
||||
*
|
||||
* @return iterable<AdjustmentInterface>
|
||||
*/
|
||||
public function getSubresource(string $resourceClass, array $identifiers, array $context, string $operationName = null): iterable
|
||||
public function getSubresource(string $resourceClass, array $identifiers, array $context, ?string $operationName = null): iterable
|
||||
{
|
||||
$subresourceIdentifiers = $context['subresource_identifiers'];
|
||||
|
||||
|
||||
@@ -30,12 +30,12 @@ final class OrderItemItemDataProvider implements ItemDataProviderInterface, Rest
|
||||
) {
|
||||
}
|
||||
|
||||
public function supports(string $resourceClass, string $operationName = null, array $context = []): bool
|
||||
public function supports(string $resourceClass, ?string $operationName = null, array $context = []): bool
|
||||
{
|
||||
return is_a($resourceClass, OrderItemInterface::class, true);
|
||||
}
|
||||
|
||||
public function getItem(string $resourceClass, $id, string $operationName = null, array $context = [])
|
||||
public function getItem(string $resourceClass, $id, ?string $operationName = null, array $context = [])
|
||||
{
|
||||
$user = $this->userContext->getUser();
|
||||
|
||||
|
||||
@@ -30,12 +30,12 @@ final class OrderItemUnitItemDataProvider implements ItemDataProviderInterface,
|
||||
) {
|
||||
}
|
||||
|
||||
public function supports(string $resourceClass, string $operationName = null, array $context = []): bool
|
||||
public function supports(string $resourceClass, ?string $operationName = null, array $context = []): bool
|
||||
{
|
||||
return is_a($resourceClass, OrderItemUnitInterface::class, true);
|
||||
}
|
||||
|
||||
public function getItem(string $resourceClass, $id, string $operationName = null, array $context = [])
|
||||
public function getItem(string $resourceClass, $id, ?string $operationName = null, array $context = [])
|
||||
{
|
||||
$user = $this->userContext->getUser();
|
||||
|
||||
|
||||
@@ -30,12 +30,12 @@ final class PaymentItemDataProvider implements ItemDataProviderInterface, Restri
|
||||
) {
|
||||
}
|
||||
|
||||
public function supports(string $resourceClass, string $operationName = null, array $context = []): bool
|
||||
public function supports(string $resourceClass, ?string $operationName = null, array $context = []): bool
|
||||
{
|
||||
return is_a($resourceClass, PaymentInterface::class, true);
|
||||
}
|
||||
|
||||
public function getItem(string $resourceClass, $id, string $operationName = null, array $context = [])
|
||||
public function getItem(string $resourceClass, $id, ?string $operationName = null, array $context = [])
|
||||
{
|
||||
$user = $this->userContext->getUser();
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ final class PaymentMethodsCollectionDataProvider implements ContextAwareCollecti
|
||||
) {
|
||||
}
|
||||
|
||||
public function getCollection(string $resourceClass, string $operationName = null, array $context = [])
|
||||
public function getCollection(string $resourceClass, ?string $operationName = null, array $context = [])
|
||||
{
|
||||
/** @var ChannelInterface $channel */
|
||||
$channel = $this->channelContext->getChannel();
|
||||
@@ -66,7 +66,7 @@ final class PaymentMethodsCollectionDataProvider implements ContextAwareCollecti
|
||||
return $this->paymentMethodsResolver->getSupportedMethods($payment);
|
||||
}
|
||||
|
||||
public function supports(string $resourceClass, string $operationName = null, array $context = []): bool
|
||||
public function supports(string $resourceClass, ?string $operationName = null, array $context = []): bool
|
||||
{
|
||||
return is_a($resourceClass, PaymentMethodInterface::class, true) && $this->isShopGetCollectionOperation($context);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ final class ProductAttributesSubresourceDataProvider implements RestrictedDataPr
|
||||
) {
|
||||
}
|
||||
|
||||
public function supports(string $resourceClass, string $operationName = null, array $context = []): bool
|
||||
public function supports(string $resourceClass, ?string $operationName = null, array $context = []): bool
|
||||
{
|
||||
$subresourceIdentifiers = $context['subresource_identifiers'] ?? null;
|
||||
|
||||
@@ -43,7 +43,7 @@ final class ProductAttributesSubresourceDataProvider implements RestrictedDataPr
|
||||
;
|
||||
}
|
||||
|
||||
public function getSubresource(string $resourceClass, array $identifiers, array $context, string $operationName = null)
|
||||
public function getSubresource(string $resourceClass, array $identifiers, array $context, ?string $operationName = null)
|
||||
{
|
||||
$subresourceIdentifiers = $context['subresource_identifiers'];
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ final class ProductItemDataProvider implements RestrictedDataProviderInterface,
|
||||
) {
|
||||
}
|
||||
|
||||
public function getItem(string $resourceClass, $id, string $operationName = null, array $context = [])
|
||||
public function getItem(string $resourceClass, $id, ?string $operationName = null, array $context = [])
|
||||
{
|
||||
$user = $this->userContext->getUser();
|
||||
|
||||
@@ -47,7 +47,7 @@ final class ProductItemDataProvider implements RestrictedDataProviderInterface,
|
||||
return $this->productRepository->findOneByChannelAndCodeWithAvailableAssociations($channel, $id);
|
||||
}
|
||||
|
||||
public function supports(string $resourceClass, string $operationName = null, array $context = []): bool
|
||||
public function supports(string $resourceClass, ?string $operationName = null, array $context = []): bool
|
||||
{
|
||||
return is_a($resourceClass, ProductInterface::class, true);
|
||||
}
|
||||
|
||||
@@ -30,12 +30,12 @@ final class ShipmentItemDataProvider implements ItemDataProviderInterface, Restr
|
||||
) {
|
||||
}
|
||||
|
||||
public function supports(string $resourceClass, string $operationName = null, array $context = []): bool
|
||||
public function supports(string $resourceClass, ?string $operationName = null, array $context = []): bool
|
||||
{
|
||||
return is_a($resourceClass, ShipmentInterface::class, true);
|
||||
}
|
||||
|
||||
public function getItem(string $resourceClass, $id, string $operationName = null, array $context = [])
|
||||
public function getItem(string $resourceClass, $id, ?string $operationName = null, array $context = [])
|
||||
{
|
||||
$user = $this->userContext->getUser();
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ final class ShippingMethodsCollectionDataProvider implements ContextAwareCollect
|
||||
) {
|
||||
}
|
||||
|
||||
public function getCollection(string $resourceClass, string $operationName = null, array $context = []): array
|
||||
public function getCollection(string $resourceClass, ?string $operationName = null, array $context = []): array
|
||||
{
|
||||
/** @var ChannelInterface $channel */
|
||||
$channel = $this->channelContext->getChannel();
|
||||
@@ -57,7 +57,7 @@ final class ShippingMethodsCollectionDataProvider implements ContextAwareCollect
|
||||
return $this->shippingMethodsResolver->getSupportedMethods($shipment);
|
||||
}
|
||||
|
||||
public function supports(string $resourceClass, string $operationName = null, array $context = []): bool
|
||||
public function supports(string $resourceClass, ?string $operationName = null, array $context = []): bool
|
||||
{
|
||||
return is_a($resourceClass, ShippingMethodInterface::class, true) && $this->isShopGetCollectionOperation($context);
|
||||
}
|
||||
|
||||
@@ -19,12 +19,12 @@ use Sylius\Bundle\ApiBundle\Command\Account\VerifyCustomerAccount;
|
||||
|
||||
final class VerifyCustomerAccountItemDataProvider implements RestrictedDataProviderInterface, ItemDataProviderInterface
|
||||
{
|
||||
public function getItem(string $resourceClass, $id, string $operationName = null, array $context = [])
|
||||
public function getItem(string $resourceClass, $id, ?string $operationName = null, array $context = [])
|
||||
{
|
||||
return new VerifyCustomerAccount($id);
|
||||
}
|
||||
|
||||
public function supports(string $resourceClass, string $operationName = null, array $context = []): bool
|
||||
public function supports(string $resourceClass, ?string $operationName = null, array $context = []): bool
|
||||
{
|
||||
return is_a($resourceClass, VerifyCustomerAccount::class, true);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ final class AcceptedProductReviewsExtension implements ContextAwareQueryCollecti
|
||||
QueryBuilder $queryBuilder,
|
||||
QueryNameGeneratorInterface $queryNameGenerator,
|
||||
string $resourceClass,
|
||||
string $operationName = null,
|
||||
?string $operationName = null,
|
||||
array $context = [],
|
||||
): void {
|
||||
if ($this->productReviewClass !== $resourceClass) {
|
||||
|
||||
@@ -33,7 +33,7 @@ final class AddressesExtension implements ContextAwareQueryCollectionExtensionIn
|
||||
QueryBuilder $queryBuilder,
|
||||
QueryNameGeneratorInterface $queryNameGenerator,
|
||||
string $resourceClass,
|
||||
string $operationName = null,
|
||||
?string $operationName = null,
|
||||
array $context = [],
|
||||
): void {
|
||||
if (!is_a($resourceClass, AddressInterface::class, true)) {
|
||||
|
||||
@@ -29,7 +29,7 @@ final class AvailableProductAssociationsInProductCollectionExtension implements
|
||||
QueryBuilder $queryBuilder,
|
||||
QueryNameGeneratorInterface $queryNameGenerator,
|
||||
string $resourceClass,
|
||||
string $operationName = null,
|
||||
?string $operationName = null,
|
||||
array $context = [],
|
||||
): void {
|
||||
if (!is_a($resourceClass, ProductInterface::class, true)) {
|
||||
|
||||
@@ -32,7 +32,7 @@ final class CountryCollectionExtension implements ContextAwareQueryCollectionExt
|
||||
QueryBuilder $queryBuilder,
|
||||
QueryNameGeneratorInterface $queryNameGenerator,
|
||||
string $resourceClass,
|
||||
string $operationName = null,
|
||||
?string $operationName = null,
|
||||
array $context = [],
|
||||
): void {
|
||||
if (!is_a($resourceClass, CountryInterface::class, true)) {
|
||||
|
||||
@@ -32,7 +32,7 @@ final class CurrencyCollectionExtension implements ContextAwareQueryCollectionEx
|
||||
QueryBuilder $queryBuilder,
|
||||
QueryNameGeneratorInterface $queryNameGenerator,
|
||||
string $resourceClass,
|
||||
string $operationName = null,
|
||||
?string $operationName = null,
|
||||
array $context = [],
|
||||
): void {
|
||||
if (!is_a($resourceClass, CurrencyInterface::class, true)) {
|
||||
|
||||
@@ -28,7 +28,7 @@ final class HideArchivedPromotionExtension implements ContextAwareQueryCollectio
|
||||
QueryBuilder $queryBuilder,
|
||||
QueryNameGeneratorInterface $queryNameGenerator,
|
||||
string $resourceClass,
|
||||
string $operationName = null,
|
||||
?string $operationName = null,
|
||||
array $context = [],
|
||||
): void {
|
||||
if ($this->promotionClass !== $resourceClass) {
|
||||
|
||||
@@ -27,7 +27,7 @@ final class HideArchivedShippingMethodExtension implements ContextAwareQueryColl
|
||||
QueryBuilder $queryBuilder,
|
||||
QueryNameGeneratorInterface $queryNameGenerator,
|
||||
string $resourceClass,
|
||||
string $operationName = null,
|
||||
?string $operationName = null,
|
||||
array $context = [],
|
||||
): void {
|
||||
if ($this->shippingMethodClass !== $resourceClass) {
|
||||
|
||||
@@ -32,7 +32,7 @@ final class LocaleCollectionExtension implements ContextAwareQueryCollectionExte
|
||||
QueryBuilder $queryBuilder,
|
||||
QueryNameGeneratorInterface $queryNameGenerator,
|
||||
string $resourceClass,
|
||||
string $operationName = null,
|
||||
?string $operationName = null,
|
||||
array $context = [],
|
||||
): void {
|
||||
if (!is_a($resourceClass, LocaleInterface::class, true)) {
|
||||
|
||||
@@ -34,7 +34,7 @@ final class OrdersByChannelExtension implements ContextAwareQueryCollectionExten
|
||||
QueryBuilder $queryBuilder,
|
||||
QueryNameGeneratorInterface $queryNameGenerator,
|
||||
string $resourceClass,
|
||||
string $operationName = null,
|
||||
?string $operationName = null,
|
||||
array $context = [],
|
||||
): void {
|
||||
if (!is_a($resourceClass, OrderInterface::class, true)) {
|
||||
|
||||
@@ -33,7 +33,7 @@ final class OrdersByLoggedInUserExtension implements ContextAwareQueryCollection
|
||||
QueryBuilder $queryBuilder,
|
||||
QueryNameGeneratorInterface $queryNameGenerator,
|
||||
string $resourceClass,
|
||||
string $operationName = null,
|
||||
?string $operationName = null,
|
||||
array $context = [],
|
||||
): void {
|
||||
if (!is_a($resourceClass, OrderInterface::class, true)) {
|
||||
|
||||
@@ -31,7 +31,7 @@ final class ProductsByChannelAndLocaleCodeExtension implements ContextAwareQuery
|
||||
QueryBuilder $queryBuilder,
|
||||
QueryNameGeneratorInterface $queryNameGenerator,
|
||||
string $resourceClass,
|
||||
string $operationName = null,
|
||||
?string $operationName = null,
|
||||
array $context = [],
|
||||
): void {
|
||||
if (!is_a($resourceClass, ProductInterface::class, true)) {
|
||||
|
||||
@@ -30,7 +30,7 @@ final class ProductsByTaxonExtension implements ContextAwareQueryCollectionExten
|
||||
QueryBuilder $queryBuilder,
|
||||
QueryNameGeneratorInterface $queryNameGenerator,
|
||||
string $resourceClass,
|
||||
string $operationName = null,
|
||||
?string $operationName = null,
|
||||
array $context = [],
|
||||
): void {
|
||||
if (!is_a($resourceClass, ProductInterface::class, true)) {
|
||||
|
||||
@@ -27,7 +27,7 @@ final class RestrictingFilterEagerLoadingExtension implements ContextAwareQueryC
|
||||
{
|
||||
}
|
||||
|
||||
public function applyToCollection(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, string $operationName = null, array $context = []): void
|
||||
public function applyToCollection(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, ?string $operationName = null, array $context = []): void
|
||||
{
|
||||
if ($this->isOperationRestricted($resourceClass, $operationName)) {
|
||||
return;
|
||||
|
||||
@@ -32,7 +32,7 @@ final class TaxonCollectionExtension implements ContextAwareQueryCollectionExten
|
||||
QueryBuilder $queryBuilder,
|
||||
QueryNameGeneratorInterface $queryNameGenerator,
|
||||
string $resourceClass,
|
||||
string $operationName = null,
|
||||
?string $operationName = null,
|
||||
array $context = [],
|
||||
): void {
|
||||
if (!is_a($resourceClass, TaxonInterface::class, true)) {
|
||||
|
||||
@@ -33,7 +33,7 @@ final class ExchangeRateExtension implements ContextAwareQueryCollectionExtensio
|
||||
QueryBuilder $queryBuilder,
|
||||
QueryNameGeneratorInterface $queryNameGenerator,
|
||||
string $resourceClass,
|
||||
string $operationName = null,
|
||||
?string $operationName = null,
|
||||
array $context = [],
|
||||
): void {
|
||||
if (!is_a($resourceClass, ExchangeRate::class, true)) {
|
||||
@@ -62,7 +62,7 @@ final class ExchangeRateExtension implements ContextAwareQueryCollectionExtensio
|
||||
;
|
||||
}
|
||||
|
||||
public function applyToItem(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, array $identifiers, string $operationName = null, array $context = [])
|
||||
public function applyToItem(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, array $identifiers, ?string $operationName = null, array $context = [])
|
||||
{
|
||||
$this->applyToCollection($queryBuilder, $queryNameGenerator, $resourceClass, $operationName, $context);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ final class OrderExtension implements ContextAwareQueryCollectionExtensionInterf
|
||||
QueryBuilder $queryBuilder,
|
||||
QueryNameGeneratorInterface $queryNameGenerator,
|
||||
string $resourceClass,
|
||||
string $operationName = null,
|
||||
?string $operationName = null,
|
||||
array $context = [],
|
||||
): void {
|
||||
$this->filterOutOrders($queryBuilder, $queryNameGenerator, $resourceClass);
|
||||
@@ -55,7 +55,7 @@ final class OrderExtension implements ContextAwareQueryCollectionExtensionInterf
|
||||
QueryNameGeneratorInterface $queryNameGenerator,
|
||||
string $resourceClass,
|
||||
array $identifiers,
|
||||
string $operationName = null,
|
||||
?string $operationName = null,
|
||||
array $context = [],
|
||||
): void {
|
||||
$this->filterOutOrders($queryBuilder, $queryNameGenerator, $resourceClass);
|
||||
|
||||
@@ -36,7 +36,7 @@ final class AddressItemExtension implements QueryItemExtensionInterface
|
||||
QueryNameGeneratorInterface $queryNameGenerator,
|
||||
string $resourceClass,
|
||||
array $identifiers,
|
||||
string $operationName = null,
|
||||
?string $operationName = null,
|
||||
array $context = [],
|
||||
) {
|
||||
if (!is_a($resourceClass, AddressInterface::class, true)) {
|
||||
|
||||
@@ -33,7 +33,7 @@ final class EnabledProductInProductAssociationItemExtension implements QueryItem
|
||||
QueryNameGeneratorInterface $queryNameGenerator,
|
||||
string $resourceClass,
|
||||
array $identifiers,
|
||||
string $operationName = null,
|
||||
?string $operationName = null,
|
||||
array $context = [],
|
||||
) {
|
||||
if (!is_a($resourceClass, ProductAssociationInterface::class, true)) {
|
||||
|
||||
@@ -30,7 +30,7 @@ final class EnabledProductVariantItemExtension implements QueryItemExtensionInte
|
||||
QueryNameGeneratorInterface $queryNameGenerator,
|
||||
string $resourceClass,
|
||||
array $identifiers,
|
||||
string $operationName = null,
|
||||
?string $operationName = null,
|
||||
array $context = [],
|
||||
) {
|
||||
if (!is_a($resourceClass, ProductVariantInterface::class, true)) {
|
||||
|
||||
@@ -35,7 +35,7 @@ final class OrderShopUserItemExtension implements QueryItemExtensionInterface
|
||||
QueryNameGeneratorInterface $queryNameGenerator,
|
||||
string $resourceClass,
|
||||
array $identifiers,
|
||||
string $operationName = null,
|
||||
?string $operationName = null,
|
||||
array $context = [],
|
||||
) {
|
||||
if (!is_a($resourceClass, OrderInterface::class, true)) {
|
||||
|
||||
@@ -34,7 +34,7 @@ final class OrderVisitorItemExtension implements QueryItemExtensionInterface
|
||||
QueryNameGeneratorInterface $queryNameGenerator,
|
||||
string $resourceClass,
|
||||
array $identifiers,
|
||||
string $operationName = null,
|
||||
?string $operationName = null,
|
||||
array $context = [],
|
||||
) {
|
||||
if (!is_a($resourceClass, OrderInterface::class, true)) {
|
||||
|
||||
@@ -30,7 +30,7 @@ final class TaxonItemExtension implements QueryItemExtensionInterface
|
||||
QueryNameGeneratorInterface $queryNameGenerator,
|
||||
string $resourceClass,
|
||||
array $identifiers,
|
||||
string $operationName = null,
|
||||
?string $operationName = null,
|
||||
array $context = [],
|
||||
) {
|
||||
if (!is_a($resourceClass, TaxonInterface::class, true)) {
|
||||
|
||||
@@ -18,7 +18,7 @@ final class ChannelCannotBeRemoved extends \RuntimeException
|
||||
public function __construct(
|
||||
string $message = 'Cannot remove, the channel is in use.',
|
||||
int $code = 0,
|
||||
\Throwable $previous = null,
|
||||
?\Throwable $previous = null,
|
||||
) {
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ final class ChannelNotFoundException extends NotFoundHttpException
|
||||
{
|
||||
public function __construct(
|
||||
string $message = 'Channel not found.',
|
||||
\Throwable $previous = null,
|
||||
?\Throwable $previous = null,
|
||||
int $code = 0,
|
||||
) {
|
||||
parent::__construct($message, $previous, $code);
|
||||
|
||||
@@ -18,7 +18,7 @@ final class ChannelPricingChannelCodeMismatchException extends \RuntimeException
|
||||
public function __construct(
|
||||
string $message = 'The channelCode of channelPricing does not match the key.',
|
||||
int $code = 0,
|
||||
\Throwable $previous = null,
|
||||
?\Throwable $previous = null,
|
||||
) {
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ final class InvalidProductAttributeValueTypeException extends \RuntimeException
|
||||
public function __construct(
|
||||
string $message = 'The value of attribute has an invalid type.',
|
||||
int $code = 0,
|
||||
\Throwable $previous = null,
|
||||
?\Throwable $previous = null,
|
||||
) {
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ final class InvalidRequestArgumentException extends \RuntimeException
|
||||
public function __construct(
|
||||
string $message = 'Request argument is invalid.',
|
||||
int $code = 0,
|
||||
\Throwable $previous = null,
|
||||
?\Throwable $previous = null,
|
||||
) {
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ class LocaleIsUsedException extends Exception
|
||||
public function __construct(
|
||||
string $localeCode,
|
||||
int $code = 0,
|
||||
\Throwable $previous = null,
|
||||
?\Throwable $previous = null,
|
||||
) {
|
||||
$message = sprintf('Locale "%s" is used.', $localeCode);
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ final class NoFileUploadedException extends BadRequestHttpException
|
||||
/** @param array<array-key, mixed> $headers */
|
||||
public function __construct(
|
||||
string $message = 'No file was uploaded.',
|
||||
\Throwable $previous = null,
|
||||
?\Throwable $previous = null,
|
||||
int $code = 0,
|
||||
array $headers = [],
|
||||
) {
|
||||
|
||||
@@ -18,7 +18,7 @@ final class PaymentMethodCannotBeRemoved extends \RuntimeException
|
||||
public function __construct(
|
||||
string $message = 'Cannot remove, the payment method is in use.',
|
||||
int $code = 0,
|
||||
\Throwable $previous = null,
|
||||
?\Throwable $previous = null,
|
||||
) {
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ final class ProductAttributeCannotBeRemoved extends \RuntimeException
|
||||
public function __construct(
|
||||
string $message = 'Cannot delete, the product attribute is in use.',
|
||||
int $code = 0,
|
||||
\Throwable $previous = null,
|
||||
?\Throwable $previous = null,
|
||||
) {
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ final class ProductCannotBeRemoved extends \RuntimeException
|
||||
public function __construct(
|
||||
string $message = 'Cannot delete, the product is in use.',
|
||||
int $code = 0,
|
||||
\Throwable $previous = null,
|
||||
?\Throwable $previous = null,
|
||||
) {
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ final class ProductVariantCannotBeRemoved extends \RuntimeException
|
||||
public function __construct(
|
||||
string $message = 'Cannot delete, the product variant is in use.',
|
||||
int $code = 0,
|
||||
\Throwable $previous = null,
|
||||
?\Throwable $previous = null,
|
||||
) {
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ final class PromotionCannotBeRemoved extends \RuntimeException
|
||||
public function __construct(
|
||||
string $message = 'Cannot delete, the promotion is in use.',
|
||||
int $code = 0,
|
||||
\Throwable $previous = null,
|
||||
?\Throwable $previous = null,
|
||||
) {
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ final class PromotionCouponCannotBeRemoved extends \RuntimeException
|
||||
public function __construct(
|
||||
string $message = 'Cannot delete, the promotion coupon is in use.',
|
||||
int $code = 0,
|
||||
\Throwable $previous = null,
|
||||
?\Throwable $previous = null,
|
||||
) {
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ final class PromotionNotFoundException extends NotFoundHttpException
|
||||
public function __construct(
|
||||
string $promotionCode,
|
||||
string $message = 'Promotion with the "%s" code not found.',
|
||||
\Throwable $previous = null,
|
||||
?\Throwable $previous = null,
|
||||
int $code = 0,
|
||||
array $headers = [],
|
||||
) {
|
||||
|
||||
@@ -18,7 +18,7 @@ final class ProvinceCannotBeRemoved extends \RuntimeException
|
||||
public function __construct(
|
||||
string $message = 'Cannot delete, the province is in use.',
|
||||
int $code = 0,
|
||||
\Throwable $previous = null,
|
||||
?\Throwable $previous = null,
|
||||
) {
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ final class ShippingMethodCannotBeRemoved extends \RuntimeException
|
||||
public function __construct(
|
||||
string $message = 'Cannot delete, the shipping method is in use.',
|
||||
int $code = 0,
|
||||
\Throwable $previous = null,
|
||||
?\Throwable $previous = null,
|
||||
) {
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ final class StateMachineTransitionFailedException extends \RuntimeException
|
||||
public function __construct(
|
||||
string $message = 'Transition failed.',
|
||||
int $code = 0,
|
||||
\Throwable $previous = null,
|
||||
?\Throwable $previous = null,
|
||||
) {
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user