From 6e2b58e1ae2ec59f2e889fb2dec920007787a660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Tue, 28 Jul 2026 15:01:35 +0200 Subject: [PATCH] Run Rector on code samples --- .../api/commerce/src/Command/OrderCommand.php | 4 ---- .../api/commerce/src/Command/PaymentCommand.php | 4 ---- .../product_catalog/src/Command/AttributeCommand.php | 4 ---- .../public_php_api/src/Command/CalendarCommand.php | 4 ---- .../order_management/order_management_api.md | 10 +++++----- docs/commerce/payment/extend_payment.md | 4 ++-- docs/commerce/payment/payment_api.md | 12 ++++++------ .../content_api/managing_content.md | 8 ++++---- docs/product_catalog/product_api.md | 10 +++++----- 9 files changed, 22 insertions(+), 38 deletions(-) diff --git a/code_samples/api/commerce/src/Command/OrderCommand.php b/code_samples/api/commerce/src/Command/OrderCommand.php index 44b24caef58..15eb8206f56 100644 --- a/code_samples/api/commerce/src/Command/OrderCommand.php +++ b/code_samples/api/commerce/src/Command/OrderCommand.php @@ -39,10 +39,6 @@ public function __construct( parent::__construct(); } - public function configure(): void - { - } - protected function execute(InputInterface $input, OutputInterface $output): int { $currentUser = $this->userService->loadUserByLogin('admin'); diff --git a/code_samples/api/commerce/src/Command/PaymentCommand.php b/code_samples/api/commerce/src/Command/PaymentCommand.php index c2ffc984887..0e6ff5ba646 100644 --- a/code_samples/api/commerce/src/Command/PaymentCommand.php +++ b/code_samples/api/commerce/src/Command/PaymentCommand.php @@ -36,10 +36,6 @@ public function __construct( parent::__construct(); } - public function configure(): void - { - } - protected function execute(InputInterface $input, OutputInterface $output): int { $currentUser = $this->userService->loadUserByLogin('admin'); diff --git a/code_samples/api/product_catalog/src/Command/AttributeCommand.php b/code_samples/api/product_catalog/src/Command/AttributeCommand.php index ee4d97b6595..397feb4ee1b 100644 --- a/code_samples/api/product_catalog/src/Command/AttributeCommand.php +++ b/code_samples/api/product_catalog/src/Command/AttributeCommand.php @@ -31,10 +31,6 @@ public function __construct( parent::__construct(); } - public function configure(): void - { - } - protected function execute(InputInterface $input, OutputInterface $output): int { $user = $this->userService->loadUserByLogin('admin'); diff --git a/code_samples/api/public_php_api/src/Command/CalendarCommand.php b/code_samples/api/public_php_api/src/Command/CalendarCommand.php index 174a2fa3e6a..4a48eedfaf9 100644 --- a/code_samples/api/public_php_api/src/Command/CalendarCommand.php +++ b/code_samples/api/public_php_api/src/Command/CalendarCommand.php @@ -26,10 +26,6 @@ public function __construct( parent::__construct(); } - public function configure(): void - { - } - protected function execute(InputInterface $input, OutputInterface $output): int { $user = $this->userService->loadUserByLogin('admin'); diff --git a/docs/commerce/order_management/order_management_api.md b/docs/commerce/order_management/order_management_api.md index 007436f0ef6..2dd2863c612 100644 --- a/docs/commerce/order_management/order_management_api.md +++ b/docs/commerce/order_management/order_management_api.md @@ -19,7 +19,7 @@ To get orders and manage them, use the [`Ibexa\Contracts\OrderManagement\OrderSe To access a single order by using its string identifier, use the [`OrderServiceInterface::getOrderByIdentifier`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-OrderManagement-OrderServiceInterface.html#method_getOrderByIdentifier) method: ``` php -[[= include_code('code_samples/api/commerce/src/Command/OrderCommand.php', 52, 55, remove_indent=True) =]] +[[= include_code('code_samples/api/commerce/src/Command/OrderCommand.php', 48, 51, remove_indent=True) =]] ``` Use the returned [`OrderInterface`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-OrderManagement-Value-Order-OrderInterface.html) value object to access details about the order. @@ -31,7 +31,7 @@ See the [Discounts API](discounts_api.md#retrieve-applied-discounts) to learn ho To access a single order by using its numerical ID, use the [`OrderServiceInterface::getOrder`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-OrderManagement-OrderServiceInterface.html#method_getOrder) method: ``` php -[[= include_code('code_samples/api/commerce/src/Command/OrderCommand.php', 58, 61, remove_indent=True) =]] +[[= include_code('code_samples/api/commerce/src/Command/OrderCommand.php', 54, 57, remove_indent=True) =]] ``` ## Get multiple orders @@ -43,7 +43,7 @@ It follows the same search query pattern as other APIs: [[= include_file('code_samples/api/commerce/src/Command/OrderCommand.php', 8, 9) =]][[= include_file('code_samples/api/commerce/src/Command/OrderCommand.php', 10, 14) =]] // ... -[[= include_file('code_samples/api/commerce/src/Command/OrderCommand.php', 110, 119) =]] +[[= include_file('code_samples/api/commerce/src/Command/OrderCommand.php', 106, 115) =]] ``` ## Create order @@ -51,7 +51,7 @@ It follows the same search query pattern as other APIs: To create an order, use the [`OrderServiceInterface::createOrder`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-OrderManagement-OrderServiceInterface.html#method_createOrder) method and provide it with the [`Ibexa\Contracts\OrderManagement\Value\Struct\OrderCreateStruct`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-OrderManagement-Value-Struct-OrderCreateStruct.html) object that contains a list of products, purchased quantities, product, total prices, and tax amounts. ``` php -[[= include_code('code_samples/api/commerce/src/Command/OrderCommand.php', 92, 102, remove_indent=True) =]] +[[= include_code('code_samples/api/commerce/src/Command/OrderCommand.php', 88, 98, remove_indent=True) =]] ``` ## Update order @@ -61,5 +61,5 @@ You could do it to support a scenario when, for example, the order is processed To update order information, use the [`OrderServiceInterface::updateOrder`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-OrderManagement-OrderServiceInterface.html#method_updateOrder) method: ``` php -[[= include_code('code_samples/api/commerce/src/Command/OrderCommand.php', 105, 108, remove_indent=True) =]] +[[= include_code('code_samples/api/commerce/src/Command/OrderCommand.php', 101, 104, remove_indent=True) =]] ``` diff --git a/docs/commerce/payment/extend_payment.md b/docs/commerce/payment/extend_payment.md index a29498fde5b..0b3eacf71a3 100644 --- a/docs/commerce/payment/extend_payment.md +++ b/docs/commerce/payment/extend_payment.md @@ -94,11 +94,11 @@ When you create a payment, you can attach custom data to it, for example, you ca You add custom data by using the `setContext` method: ``` php -[[= include_code('code_samples/api/commerce/src/Command/PaymentCommand.php', 82, 93, remove_indent=True) =]] +[[= include_code('code_samples/api/commerce/src/Command/PaymentCommand.php', 78, 89, remove_indent=True) =]] ``` Then, you retrieve it with the `getContext` method: ``` php -[[= include_code('code_samples/api/commerce/src/Command/PaymentCommand.php', 55, 58, remove_indent=True) =]] +[[= include_code('code_samples/api/commerce/src/Command/PaymentCommand.php', 51, 54, remove_indent=True) =]] ``` diff --git a/docs/commerce/payment/payment_api.md b/docs/commerce/payment/payment_api.md index 3f34481ab10..a0e4a8d6e41 100644 --- a/docs/commerce/payment/payment_api.md +++ b/docs/commerce/payment/payment_api.md @@ -17,7 +17,7 @@ You can change that by providing a custom payment identifier in `Ibexa\Contracts To access a single payment by using its numerical ID, use the `PaymentServiceInterface::getPayment` method: ``` php -[[= include_code('code_samples/api/commerce/src/Command/PaymentCommand.php', 49, 52, remove_indent=True) =]] +[[= include_code('code_samples/api/commerce/src/Command/PaymentCommand.php', 45, 48, remove_indent=True) =]] ``` ### Get single payment by identifier @@ -25,7 +25,7 @@ To access a single payment by using its numerical ID, use the `PaymentServiceInt To access a single payment by using its string identifier, use the `PaymentServiceInterface::getPaymentByIdentifier` method: ``` php -[[= include_code('code_samples/api/commerce/src/Command/PaymentCommand.php', 55, 56, remove_indent=True) =]] +[[= include_code('code_samples/api/commerce/src/Command/PaymentCommand.php', 51, 52, remove_indent=True) =]] ``` ## Get multiple payments @@ -34,7 +34,7 @@ To fetch multiple payments, use the `PaymentServiceInterface::findPayments` meth It follows the same search query pattern as other APIs: ``` php -[[= include_code('code_samples/api/commerce/src/Command/PaymentCommand.php', 64, 79, remove_indent=True) =]] +[[= include_code('code_samples/api/commerce/src/Command/PaymentCommand.php', 60, 75, remove_indent=True) =]] ``` ## Create payment @@ -42,7 +42,7 @@ It follows the same search query pattern as other APIs: To create a payment, use the `PaymentServiceInterface::createPayment` method and provide it with the `Ibexa\Contracts\Payment\Payment\PaymentCreateStruct` object that takes the following arguments: `method`, `order` and `amount`. ``` php -[[= include_code('code_samples/api/commerce/src/Command/PaymentCommand.php', 82, 95, remove_indent=True) =]] +[[= include_code('code_samples/api/commerce/src/Command/PaymentCommand.php', 78, 91, remove_indent=True) =]] ``` ## Update payment @@ -53,7 +53,7 @@ The `Ibexa\Contracts\Payment\Payment\PaymentUpdateStruct` object takes the follo To update payment information, use the `PaymentServiceInterface::updatePayment` method: ``` php -[[= include_code('code_samples/api/commerce/src/Command/PaymentCommand.php', 98, 103, remove_indent=True) =]] +[[= include_code('code_samples/api/commerce/src/Command/PaymentCommand.php', 94, 99, remove_indent=True) =]] ``` ## Delete payment @@ -61,5 +61,5 @@ To update payment information, use the `PaymentServiceInterface::updatePayment` To delete a payment from the system, use the `PaymentServiceInterface::deletePayment` method: ``` php -[[= include_code('code_samples/api/commerce/src/Command/PaymentCommand.php', 106, 106, remove_indent=True) =]] +[[= include_code('code_samples/api/commerce/src/Command/PaymentCommand.php', 102, 102, remove_indent=True) =]] ``` diff --git a/docs/content_management/content_api/managing_content.md b/docs/content_management/content_api/managing_content.md index d2b59dd470e..2a05e068d33 100644 --- a/docs/content_management/content_api/managing_content.md +++ b/docs/content_management/content_api/managing_content.md @@ -215,19 +215,19 @@ To get a list of events for a specified time period, use the `CalendarServiceInt You need to provide the method with an EventQuery, which takes a date range and a count as the minimum of parameters: ``` php -[[= include_code('code_samples/api/public_php_api/src/Command/CalendarCommand.php', 38, 48, remove_indent=True) =]] +[[= include_code('code_samples/api/public_php_api/src/Command/CalendarCommand.php', 34, 44, remove_indent=True) =]] ``` You can also get the first and last event in the list by using the `first()` and `last()` methods of an `EventCollection` (`Ibexa\Contracts\Calendar\EventCollection`): ``` php -[[= include_code('code_samples/api/public_php_api/src/Command/CalendarCommand.php', 50, 51, remove_indent=True) =]] +[[= include_code('code_samples/api/public_php_api/src/Command/CalendarCommand.php', 46, 47, remove_indent=True) =]] ``` You can process the events in a collection using the `find(Closure $predicate)`, `filter(Closure $predicate)`, `map(Closure $callback)` or `slice(int $offset, ?int $length = null)` methods of `EventCollection`, for example: ``` php -[[= include_code('code_samples/api/public_php_api/src/Command/CalendarCommand.php', 53, 56, remove_indent=True) =]] +[[= include_code('code_samples/api/public_php_api/src/Command/CalendarCommand.php', 49, 52, remove_indent=True) =]] ``` ### Performing calendar actions @@ -237,5 +237,5 @@ You must pass an `Ibexa\Contracts\Calendar\EventAction\EventActionContext` insta `EventActionContext` defines events on which the action is performed, and action-specific parameters, for example, a new date: ``` php -[[= include_code('code_samples/api/public_php_api/src/Command/CalendarCommand.php', 58, 61, remove_indent=True) =]] +[[= include_code('code_samples/api/public_php_api/src/Command/CalendarCommand.php', 54, 57, remove_indent=True) =]] ``` diff --git a/docs/product_catalog/product_api.md b/docs/product_catalog/product_api.md index 9a9ef826a65..d5ffb771dbc 100644 --- a/docs/product_catalog/product_api.md +++ b/docs/product_catalog/product_api.md @@ -255,25 +255,25 @@ To get information about product attribute groups, use the [`AttributeGroupServi `AttributeGroupServiceInterface::findAttributeGroups()` gets attribute groups, all of them or filtered with an optional [`AttributeGroupQuery`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ProductCatalog-Values-AttributeGroup-AttributeGroupQuery.html) object: ``` php -[[= include_code('code_samples/api/product_catalog/src/Command/AttributeCommand.php', 54, 54, remove_indent=True) =]] +[[= include_code('code_samples/api/product_catalog/src/Command/AttributeCommand.php', 50, 50, remove_indent=True) =]] -[[= include_code('code_samples/api/product_catalog/src/Command/AttributeCommand.php', 75, 79, remove_indent=True) =]] +[[= include_code('code_samples/api/product_catalog/src/Command/AttributeCommand.php', 71, 75, remove_indent=True) =]] ``` To create an attribute group, use `LocalAttributeGroupServiceinterface::createAttributeGroup()` and provide it with an [`AttributeGroupCreateStruct`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ProductCatalog-Local-Values-AttributeGroup-AttributeGroupCreateStruct.html): ``` php -[[= include_code('code_samples/api/product_catalog/src/Command/AttributeCommand.php', 49, 52, remove_indent=True) =]] +[[= include_code('code_samples/api/product_catalog/src/Command/AttributeCommand.php', 45, 48, remove_indent=True) =]] ``` To get information about product attributes, use the [`AttributeDefinitionServiceInterface`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ProductCatalog-AttributeDefinitionServiceInterface.html), or [`LocalAttributeDefinitionServiceInterface`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ProductCatalog-Local-LocalAttributeDefinitionServiceInterface.html) to modify attributes. ``` php -[[= include_code('code_samples/api/product_catalog/src/Command/AttributeCommand.php', 61, 62, remove_indent=True) =]] +[[= include_code('code_samples/api/product_catalog/src/Command/AttributeCommand.php', 57, 58, remove_indent=True) =]] ``` To create an attribute, use `LocalAttributeGroupServiceinterface::createAttributeDefinition()` and provide it with an [`AttributeDefinitionCreateStruct`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ProductCatalog-Local-Values-AttributeDefinition-AttributeDefinitionCreateStruct.html): ``` php -[[= include_code('code_samples/api/product_catalog/src/Command/AttributeCommand.php', 66, 71, remove_indent=True) =]] +[[= include_code('code_samples/api/product_catalog/src/Command/AttributeCommand.php', 62, 67, remove_indent=True) =]] ```