From 25728d74e99e5c5ffc03716dcf7d920fe7b8eee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Sat, 16 May 2026 15:06:08 +0200 Subject: [PATCH 01/18] Make all checks pass --- .../GraphQL/Schema/MyFieldDefinitionMapper.php | 1 + .../ProductNameCriterionTransformer.php | 6 ++++++ deptrac.baseline.yaml | 2 +- docs/api/graphql/graphql_custom_ft.md | 7 ++++--- phpstan-baseline.neon | 18 ++++++++++++------ 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/code_samples/api/graphql/src/GraphQL/Schema/MyFieldDefinitionMapper.php b/code_samples/api/graphql/src/GraphQL/Schema/MyFieldDefinitionMapper.php index e450986329..b2a4432f86 100644 --- a/code_samples/api/graphql/src/GraphQL/Schema/MyFieldDefinitionMapper.php +++ b/code_samples/api/graphql/src/GraphQL/Schema/MyFieldDefinitionMapper.php @@ -15,6 +15,7 @@ protected function getFieldTypeIdentifier(): string return 'my_field_type'; } + #[\Override] public function mapToFieldValueInputType(ContentType $contentType, FieldDefinition $fieldDefinition): ?string { if (!$this->canMap($fieldDefinition)) { diff --git a/code_samples/catalog/custom_catalog_filter/src/CatalogFilter/DataTransformer/ProductNameCriterionTransformer.php b/code_samples/catalog/custom_catalog_filter/src/CatalogFilter/DataTransformer/ProductNameCriterionTransformer.php index fe1cad48ae..8a7837a023 100644 --- a/code_samples/catalog/custom_catalog_filter/src/CatalogFilter/DataTransformer/ProductNameCriterionTransformer.php +++ b/code_samples/catalog/custom_catalog_filter/src/CatalogFilter/DataTransformer/ProductNameCriterionTransformer.php @@ -8,6 +8,12 @@ use Symfony\Component\Form\DataTransformerInterface; use Symfony\Component\Form\Exception\TransformationFailedException; +/** + * @implements \Symfony\Component\Form\DataTransformerInterface< + * \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductName, + * \Ibexa\Bundle\ProductCatalog\Form\Data\Catalog\CatalogFilterPriceData + * > + */ final class ProductNameCriterionTransformer implements DataTransformerInterface { public function transform($value): ?string diff --git a/deptrac.baseline.yaml b/deptrac.baseline.yaml index 735af566a5..c45d47606a 100644 --- a/deptrac.baseline.yaml +++ b/deptrac.baseline.yaml @@ -174,7 +174,7 @@ deptrac: - Ibexa\Bundle\Checkout\Form\Type\AddressType - Ibexa\Bundle\Payment\Form\Type\PaymentMethodChoiceType - Ibexa\Bundle\Shipping\Form\Type\ShippingMethodChoiceType - App\GraphQL\Schema\MyCustomFieldDefinitionMapper: + App\GraphQL\Schema\MyFieldDefinitionMapper: - Ibexa\GraphQL\Schema\Domain\Content\Mapper\FieldDefinition\DecoratingFieldDefinitionMapper App\Migrations\Action\AssignSection: - Ibexa\Migration\ValueObject\Step\Action diff --git a/docs/api/graphql/graphql_custom_ft.md b/docs/api/graphql/graphql_custom_ft.md index 9010719f4c..1a4f416d5c 100644 --- a/docs/api/graphql/graphql_custom_ft.md +++ b/docs/api/graphql/graphql_custom_ft.md @@ -40,7 +40,7 @@ If not specified, it uses `FieldDefinition`. Compiler pass example that should be placed in `src/DependencyInjection/Compiler`: -``` php +``` php skip-validation [[= include_file('code_samples/api/graphql/src/DependencyInjection/Compiler/MyCustomTypeGraphQLCompilerPass.php') =]] ``` @@ -60,7 +60,8 @@ It requires that you implement the `getFieldTypeIdentifier` method to tell which Add `MyFieldDefinitionMapper.php` mapper to `src/GraphQL/Schema`: ``` php -[[= include_file('code_samples/api/graphql/src/GraphQL/Schema/MyFieldDefinitionMapper.php', 0, 16) =]][[= include_file('code_samples/api/graphql/src/GraphQL/Schema/MyFieldDefinitionMapper.php', 36, 37) =]] +[[= include_code('code_samples/api/graphql/src/GraphQL/Schema/MyFieldDefinitionMapper.php', 1, 17) =]] +[[= include_code('code_samples/api/graphql/src/GraphQL/Schema/MyFieldDefinitionMapper.php', 38, 39) =]] ``` The `FieldDefinitionMapper` interface defines following methods: @@ -75,7 +76,7 @@ When a mapper method is decorated, you need to call the decorated service method To do that, you need to replace `mapXXX` by the method it's in: ```php -[[= include_file('code_samples/api/graphql/src/GraphQL/Schema/MyFieldDefinitionMapper.php', 19, 22, remove_indent=True) =]] +[[= include_code('code_samples/api/graphql/src/GraphQL/Schema/MyFieldDefinitionMapper.php', 21, 24, remove_indent=True) =]] ``` It's required for every implemented method, so that other mappers are called for the other field types. diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 1b50172c7f..0dad648276 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -30,6 +30,18 @@ parameters: count: 1 path: code_samples/api/migration/src/Command/MigrationCommand.php + - + message: '#^Instantiated class App\\Notifications\\MyNotification not found\.$#' + identifier: class.notFound + count: 1 + path: code_samples/api/notifications/notification_send.php + + - + message: '#^Parameter \#1 \$notification of class Ibexa\\Contracts\\Notifications\\Value\\Notification\\SymfonyNotificationAdapter constructor expects Symfony\\Component\\Notifier\\Notification\\Notification, App\\Notifications\\MyNotification given\.$#' + identifier: argument.type + count: 1 + path: code_samples/api/notifications/notification_send.php + - message: '#^Call to an undefined method Ibexa\\Contracts\\ProductCatalog\\Values\\ProductInterface\:\:getPrice\(\)\.$#' identifier: method.notFound @@ -312,12 +324,6 @@ parameters: count: 1 path: code_samples/catalog/custom_attribute_type/src/Attribute/Percent/Storage/PercentStorageConverter.php - - - message: '#^Class App\\CatalogFilter\\DataTransformer\\ProductNameCriterionTransformer implements generic interface Symfony\\Component\\Form\\DataTransformerInterface but does not specify its types\: T, R$#' - identifier: missingType.generics - count: 1 - path: code_samples/catalog/custom_catalog_filter/src/CatalogFilter/DataTransformer/ProductNameCriterionTransformer.php - - message: '#^Method App\\CatalogFilter\\ProductNameFilter\:\:getTranslationMessages\(\) return type has no value type specified in iterable type array\.$#' identifier: missingType.iterableValue From 8250554302764d461a3540213b94b9efa3f9976e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Sat, 16 May 2026 15:15:46 +0200 Subject: [PATCH 02/18] Revert "Disabled validation for existing inline PHP snippets" This reverts commit 6ed6be02e0346134563947b7e8fd6e48d0738f81. --- .../extending_thumbnails.md | 2 +- .../formatting_date_and_time.md | 2 +- .../back_office_menus/back_office_menus.md | 4 ++-- .../back_office/browser/browser.md | 2 +- .../back_office/customize_calendar.md | 2 +- .../back_office/notifications.md | 2 +- .../configuration/configuration.md | 2 +- .../configuration/dynamic_configuration.md | 4 ++-- .../configuration/repository_configuration.md | 6 ++--- docs/ai_actions/configure_ai_actions.md | 2 +- docs/api/php_api/php_api.md | 4 ++-- .../creating_new_rest_resource.md | 2 +- docs/commerce/cart/cart_api.md | 6 ++--- .../shopping_list/install_shopping_list.md | 2 +- .../shopping_list/shopping_list_api.md | 4 ++-- .../storefront/configure_storefront.md | 2 +- docs/commerce/storefront/extend_storefront.md | 2 +- .../extend_transactional_emails.md | 8 +++---- .../configure_collaborative_editing.md | 2 +- .../content_api/browsing_content.md | 10 ++++---- .../content_api/creating_content.md | 2 +- .../content_api/managing_content.md | 2 +- .../field_type_reference/addressfield.md | 4 ++-- .../field_type_reference/authorfield.md | 6 ++--- .../field_type_reference/binaryfilefield.md | 2 +- .../field_type_reference/checkboxfield.md | 4 ++-- .../field_type_reference/countryfield.md | 10 ++++---- .../field_type_reference/dateandtimefield.md | 6 ++--- .../field_type_reference/datefield.md | 4 ++-- .../field_type_reference/emailaddressfield.md | 4 ++-- .../field_type_reference/floatfield.md | 6 ++--- .../field_type_reference/imageassetfield.md | 4 ++-- .../field_type_reference/imagefield.md | 8 +++---- .../field_type_reference/integerfield.md | 6 ++--- .../field_type_reference/isbnfield.md | 2 +- .../field_type_reference/keywordfield.md | 4 ++-- .../field_type_reference/maplocationfield.md | 2 +- .../field_type_reference/matrixfield.md | 4 ++-- .../field_type_reference/measurementfield.md | 4 ++-- .../field_type_reference/mediafield.md | 4 ++-- .../field_type_reference/relationfield.md | 6 ++--- .../field_type_reference/relationlistfield.md | 6 ++--- .../field_type_reference/richtextfield.md | 2 +- .../field_type_reference/selectionfield.md | 8 +++---- .../taxonomyentryassignmentfield.md | 4 ++-- .../taxonomyentryfield.md | 6 ++--- .../field_type_reference/textlinefield.md | 2 +- .../field_type_reference/timefield.md | 2 +- .../field_type_reference/urlfield.md | 6 ++--- .../field_types/field_type_search.md | 2 +- .../field_types/field_type_validation.md | 2 +- .../field_types/form_and_template.md | 4 ++-- .../field_types/type_and_value.md | 2 +- .../file_management/file_management.md | 2 +- .../images/configure_image_editor.md | 2 +- .../taxonomy/taxonomy_api.md | 2 +- .../url_management/url_management.md | 4 ++-- .../workflow/add_custom_workflow_action.md | 2 +- .../cache/http_cache/content_aware_cache.md | 8 +++---- .../cache/http_cache/context_aware_cache.md | 6 ++--- .../cache/http_cache/reverse_proxy.md | 2 +- .../cache/persistence_cache.md | 6 ++--- .../languages/automated_translations.md | 2 +- .../languages/back_office_translations.md | 2 +- .../siteaccess/injecting_siteaccess.md | 2 +- .../siteaccess_aware_configuration.md | 2 +- docs/permissions/custom_policies.md | 6 ++--- docs/permissions/permission_overview.md | 6 ++--- .../personalization/enable_personalization.md | 2 +- .../integrate_recommendation_service.md | 6 ++--- .../create_custom_name_schema_strategy.md | 2 +- docs/release_notes/ez_platform_v2.4.md | 2 +- .../ez_platform_v3.0_deprecations.md | 2 +- docs/release_notes/ibexa_dxp_v4.6.md | 2 +- .../contributing/package_structure.md | 24 +++++++++---------- .../action_criterion.md | 2 +- .../logged_at_criterion.md | 2 +- .../object_criterion.md | 4 ++-- .../object_name_criterion.md | 2 +- .../user_criterion.md | 2 +- .../authorterm_aggregation.md | 2 +- .../basepricestats_aggregation.md | 4 ++-- .../checkboxterm_aggregation.md | 2 +- .../contenttypegroupterm_aggregation.md | 2 +- .../contenttypeterm_aggregation.md | 2 +- .../countryterm_aggregation.md | 2 +- .../custompricestats_aggregation.md | 4 ++-- .../datemetadatarange_aggregation.md | 2 +- .../daterange_aggregation.md | 2 +- .../datetimerange_aggregation.md | 2 +- .../floatrange_aggregation.md | 2 +- .../floatstats_aggregation.md | 2 +- .../integerrange_aggregation.md | 2 +- .../integerstats_aggregation.md | 2 +- .../keywordterm_aggregation.md | 2 +- .../languageterm_aggregation.md | 2 +- .../locationchildrenterm_aggregation.md | 2 +- .../objectstateterm_aggregation.md | 2 +- .../product_attribute_aggregations.md | 4 ++-- .../productavailabilityterm_aggregation.md | 2 +- .../productpricerange_aggregation.md | 2 +- .../productstockrange_aggregation.md | 2 +- .../producttypeterm_aggregation.md | 2 +- .../rawrange_aggregation.md | 2 +- .../rawstats_aggregation.md | 2 +- .../rawterm_aggregation.md | 2 +- .../sectionterm_aggregation.md | 2 +- .../selectionterm_aggregation.md | 2 +- .../subtreeterm_aggregation.md | 2 +- .../taxonomyentryid_aggregation.md | 4 ++-- .../timerange_aggregation.md | 2 +- .../usermetadataterm_aggregation.md | 2 +- .../visibilityterm_aggregation.md | 2 +- .../criteria_reference/ancestor_criterion.md | 4 ++-- .../criteria_reference/baseprice_criterion.md | 2 +- .../checkboxattribute_criterion.md | 2 +- .../colorattribute_criterion.md | 4 ++-- .../criteria_reference/contentid_criterion.md | 2 +- .../contentname_criterion.md | 2 +- .../contenttypegroupid_criterion.md | 4 ++-- .../contenttypeid_criterion.md | 2 +- .../contenttypeidentifier_criterion.md | 2 +- .../criteria_reference/createdat_criterion.md | 4 ++-- .../createdatrange_criterion.md | 4 ++-- .../currencycode_criterion.md | 2 +- .../customergroupid_criterion.md | 2 +- .../customprice_criterion.md | 2 +- .../datemetadata_criterion.md | 4 ++-- .../criteria_reference/depth_criterion.md | 2 +- .../criteria_reference/field_criterion.md | 4 ++-- .../fieldrelation_criterion.md | 2 +- .../floatattribute_criterion.md | 4 ++-- .../criteria_reference/fulltext_criterion.md | 8 +++---- .../criteria_reference/image_criterion.md | 2 +- .../imagedimensions_criterion.md | 2 +- .../imagefilesize_criterion.md | 2 +- .../imageheight_criterion.md | 2 +- .../imagemimetype_criterion.md | 4 ++-- .../imageorientation_criterion.md | 2 +- .../imagewidth_criterion.md | 2 +- .../integerattribute_criterion.md | 4 ++-- .../iscontainer_criterion.md | 2 +- .../iscurrencyenabled_criterion.md | 2 +- .../isfieldempty_criterion.md | 4 ++-- .../ismainlocation_criterion.md | 2 +- .../isproductbased_criterion.md | 2 +- .../isuserbased_criterion.md | 2 +- .../isuserenabled_criterion.md | 2 +- .../criteria_reference/isvirtual_criterion.md | 4 ++-- .../languagecode_criterion.md | 4 ++-- .../locationid_criterion.md | 2 +- .../locationremoteid_criterion.md | 2 +- .../logicaland_criterion.md | 2 +- .../logicalnot_criterion.md | 2 +- .../criteria_reference/logicalor_criterion.md | 2 +- .../maplocationdistance_criterion.md | 2 +- .../objectstateid_criterion.md | 2 +- .../objectstateidentifier_criterion.md | 4 ++-- .../order_company_associated_criterion.md | 2 +- .../order_company_name_criterion.md | 2 +- .../order_created_criterion.md | 2 +- .../order_currency_code_criterion.md | 2 +- .../order_customer_name_criterion.md | 2 +- .../order_identifier_criterion.md | 2 +- .../order_owner_criterion.md | 6 ++--- .../order_price_criterion.md | 2 +- .../order_source_criterion.md | 2 +- .../order_status_criterion.md | 2 +- .../parentlocationid_criterion.md | 4 ++-- .../payment_createdat_criterion.md | 2 +- .../payment_currency_criterion.md | 2 +- .../payment_id_criterion.md | 2 +- .../payment_identifier_criterion.md | 2 +- .../payment_logicaland_criterion.md | 2 +- .../payment_logicalor_criterion.md | 2 +- .../payment_method_createdat_criterion.md | 2 +- .../payment_method_enabled_criterion.md | 2 +- .../payment_method_id_criterion.md | 2 +- .../payment_method_identifier_criterion.md | 2 +- .../payment_method_logicaland_criterion.md | 2 +- .../payment_method_logicalor_criterion.md | 2 +- .../payment_method_name_criterion.md | 2 +- .../payment_method_type_criterion.md | 2 +- .../payment_method_updatedat_criterion.md | 2 +- .../payment_order_criterion.md | 2 +- .../payment_payment_method_criterion.md | 2 +- .../payment_status_criterion.md | 2 +- .../payment_updatedat_criterion.md | 2 +- .../price_currency_criterion.md | 2 +- .../price_customergroup_criterion.md | 2 +- .../price_isbaseprice_criterion.md | 4 ++-- .../price_iscustomprice_criterion.md | 4 ++-- .../price_logicaland_criterion.md | 2 +- .../price_logicalor_criterion.md | 2 +- .../price_product_criterion.md | 2 +- .../criteria_reference/priority_criterion.md | 2 +- .../productavailability_criterion.md | 4 ++-- .../productcategory_criterion.md | 2 +- .../productcode_criterion.md | 4 ++-- .../productname_criterion.md | 2 +- .../productstock_criterion.md | 4 ++-- .../productstockrange_criterion.md | 2 +- .../producttype_criterion.md | 4 ++-- ...gemeasurementattributemaximum_criterion.md | 2 +- ...gemeasurementattributeminimum_criterion.md | 2 +- .../criteria_reference/remoteid_criterion.md | 2 +- .../criteria_reference/sectionid_criterion.md | 2 +- .../sectionidentifier_criterion.md | 2 +- .../selectionattribute_criterion.md | 4 ++-- .../shipment_createdat_criterion.md | 2 +- .../shipment_currency_criterion.md | 2 +- .../shipment_id_criterion.md | 2 +- .../shipment_identifier_criterion.md | 2 +- .../shipment_logicaland_criterion.md | 2 +- .../shipment_logicalor_criterion.md | 2 +- .../shipment_owner_criterion.md | 6 ++--- .../shipment_shipping_method_criterion.md | 2 +- .../shipment_status_criterion.md | 2 +- .../shipment_updatedat_criterion.md | 2 +- .../criteria_reference/sibling_criterion.md | 4 ++-- .../simplemeasurementattribute_criterion.md | 2 +- .../criteria_reference/subtree_criterion.md | 2 +- .../criteria_reference/taxonomy_entry_id.md | 4 ++-- .../criteria_reference/useremail_criterion.md | 4 ++-- .../criteria_reference/userid_criterion.md | 2 +- .../criteria_reference/userlogin_criterion.md | 4 ++-- .../usermetadata_criterion.md | 4 ++-- .../visibility_criterion.md | 2 +- .../create_custom_aggregation.md | 10 ++++---- .../create_custom_search_criterion.md | 6 ++--- .../create_custom_sort_clause.md | 6 ++--- .../index_custom_elasticsearch_data.md | 2 +- .../manipulate_elasticsearch_query.md | 2 +- docs/search/search_api.md | 12 +++++----- .../solr_search_engine/configure_solr.md | 2 +- .../shopping_list_criteria.md | 2 +- .../baseprice_sort_clause.md | 2 +- .../contentid_sort_clause.md | 2 +- .../contentname_sort_clause.md | 2 +- .../contenttranslatedname_sort_clause.md | 2 +- .../contenttypename_sort_clause.md | 2 +- .../createdat_sort_clause.md | 2 +- .../customfield_sort_clause.md | 2 +- .../customprice_sort_clause.md | 2 +- .../datemodified_sort_clause.md | 2 +- .../datepublished_sort_clause.md | 2 +- .../datetrashed_sort_clause.md | 2 +- .../depth_sort_clause.md | 2 +- .../field_sort_clause.md | 2 +- .../sort_clause_reference/id_sort_clause.md | 2 +- .../ismainlocation_sort_clause.md | 2 +- .../maplocationdistance_sort_clause.md | 2 +- .../order_created_sort_clause.md | 2 +- .../order_id_sort_clause.md | 2 +- .../order_status_sort_clause.md | 2 +- .../order_updated_sort_clause.md | 2 +- .../sort_clause_reference/path_sort_clause.md | 2 +- .../payment_createdat_sort_clause.md | 2 +- .../payment_id_sort_clause.md | 2 +- .../payment_identifier_sort_clause.md | 2 +- .../payment_method_createdat_sort_clause.md | 2 +- .../payment_method_enabled_sort_clause.md | 2 +- .../payment_method_id_sort_clause.md | 2 +- .../payment_method_identifier_sort_clause.md | 2 +- .../payment_method_updatedat_sort_clause.md | 2 +- .../payment_status_sort_clause.md | 2 +- .../payment_updatedat_sort_clause.md | 2 +- .../priority_sort_clause.md | 2 +- .../productavailability_sort_clause.md | 2 +- .../productcode_sort_clause.md | 2 +- .../productname_sort_clause.md | 2 +- .../random_sort_clause.md | 2 +- .../score_sort_clause.md | 2 +- .../sectionidentifier_sort_clause.md | 2 +- .../sectionname_sort_clause.md | 2 +- .../shipment_createdat_sort_clause.md | 2 +- .../shipment_id_sort_clause.md | 2 +- .../shipment_identifier_sort_clause.md | 2 +- .../shipment_status_sort_clause.md | 2 +- .../shipment_updatedat_sort_clause.md | 2 +- .../userlogin_sort_clause.md | 2 +- .../visibility_sort_clause.md | 2 +- .../id_url_sort_clause.md | 2 +- .../logicaland_url_criterion.md | 2 +- .../logicalnot_url_criterion.md | 2 +- .../logicalor_url_criterion.md | 2 +- .../pattern_url_criterion.md | 2 +- .../sectionid_url_criterion.md | 2 +- .../sectionidentifier_url_criterion.md | 2 +- .../url_url_sort_clause.md | 2 +- .../validity_url_criterion.md | 2 +- .../search_term_aggregation_settings.md | 2 +- docs/templating/layout/add_login_form.md | 2 +- .../urls_and_routes/custom_breadcrumbs.md | 2 +- .../5_display_a_list_of_content_items.md | 2 +- .../beginner_tutorial/7_embed_content.md | 2 +- .../from_1.x_2.x/update_db_to_2.5.md | 12 +++++----- .../update_code/2_update_configuration.md | 4 ++-- .../update_code/4_update_signal_slots.md | 4 ++-- .../from_2.5/update_code/8_update_rest.md | 8 +++---- .../from_4.3/update_from_4.3_new_commerce.md | 6 ++--- .../from_4.3/update_from_4.3_old_commerce.md | 2 +- .../from_4.6/update_from_4.6.md | 2 +- .../from_4.6/update_to_5.0.md | 4 ++-- .../migrating_from_ez_publish_platform.md | 4 ++-- docs/users/oauth_server.md | 2 +- docs/users/segment_api.md | 2 +- docs/users/user_authentication.md | 2 +- 308 files changed, 451 insertions(+), 451 deletions(-) diff --git a/docs/administration/back_office/back_office_elements/extending_thumbnails.md b/docs/administration/back_office/back_office_elements/extending_thumbnails.md index 8e0dcf1f7a..48ace7411f 100644 --- a/docs/administration/back_office/back_office_elements/extending_thumbnails.md +++ b/docs/administration/back_office/back_office_elements/extending_thumbnails.md @@ -75,7 +75,7 @@ It enables you to add a thumbnail URL in the text field. Add `FieldValueUrl.php` in `src/Thumbnails`. -```php {skip-validation} +```php addChild( 'all_content_list', [ @@ -105,7 +105,7 @@ You can then use the variable `custom_parameter` in `templates/themes/admin/list To have translatable labels, use `translation.key` from the `messages` domain: -``` php {skip-validation} +``` php $menu->addChild( 'all_content_list', [ diff --git a/docs/administration/back_office/browser/browser.md b/docs/administration/back_office/browser/browser.md index b3282d6959..1addc5b3d8 100644 --- a/docs/administration/back_office/browser/browser.md +++ b/docs/administration/back_office/browser/browser.md @@ -146,7 +146,7 @@ If an event listener catches additional parameters passed with context, it uses In the example below, the `johndoe` parameter enables the user to choose multiple items from a **Browser window** by changing `multiple: false` from `my_custom_udw` configuration to `multiple: true`. -```php {skip-validation} hl_lines="29 30 31" +```php hl_lines="29 30 31" class JohnDoeCanSelectMore implements EventSubscriberInterface { private const CONFIGURATION_NAME = 'my_custom_udw'; diff --git a/docs/administration/back_office/customize_calendar.md b/docs/administration/back_office/customize_calendar.md index bf51a52e44..5e56e0a7cd 100644 --- a/docs/administration/back_office/customize_calendar.md +++ b/docs/administration/back_office/customize_calendar.md @@ -80,7 +80,7 @@ To add an in-memory collection as an event source, create `src/Calendar/Holidays For example: - ``` php {skip-validation} + ``` php $collection = new EventCollection([ $this->createEvent("Event 1", new DateTime("2024-01-01")), $this->createEvent("Event 2", new DateTime("2024-01-02")), diff --git a/docs/administration/back_office/notifications.md b/docs/administration/back_office/notifications.md index 725d44d406..84ac4be9f8 100644 --- a/docs/administration/back_office/notifications.md +++ b/docs/administration/back_office/notifications.md @@ -25,7 +25,7 @@ There are four types of notifications: `info`, `success`, `warning` and `error`. To send a notification from PHP, inject the `TranslatableNotificationHandlerInterface` into your class. -``` php {skip-validation} +``` php $this->notificationHandler->info( /** @Desc("Notification text") */ 'example.notification.text', diff --git a/docs/administration/configuration/configuration.md b/docs/administration/configuration/configuration.md index aebd475264..eb26f7ec2a 100644 --- a/docs/administration/configuration/configuration.md +++ b/docs/administration/configuration/configuration.md @@ -72,7 +72,7 @@ parameters: an_array: [apple, banana, pear] ``` -``` php {skip-validation} +``` php // Usage inside a controller $myParameter = $this->container->getParameter( 'myapp.parameter.name' ); ``` diff --git a/docs/administration/configuration/dynamic_configuration.md b/docs/administration/configuration/dynamic_configuration.md index 5a0283118a..c847e0899d 100644 --- a/docs/administration/configuration/dynamic_configuration.md +++ b/docs/administration/configuration/dynamic_configuration.md @@ -29,7 +29,7 @@ parameters: Inside a controller, in `site_group` SiteAccess, you can use the parameters in the following way (the same applies for `hasParameter()`): -``` php {skip-validation} +``` php $configResolver = $this->getConfigResolver();   // ibexa.site_access.config is the default namespace, so no need to specify it @@ -77,7 +77,7 @@ For more information about dependency injection, see [Service container](php_api Don't store the retrieved config value unless you know what you're doing. SiteAccess can change during code execution, which means you might work on the wrong value. -``` php {skip-validation} +``` php namespace App; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/docs/administration/configuration/repository_configuration.md b/docs/administration/configuration/repository_configuration.md index 673f7e8db1..126b39e841 100644 --- a/docs/administration/configuration/repository_configuration.md +++ b/docs/administration/configuration/repository_configuration.md @@ -303,7 +303,7 @@ This enables you to use different settings for different repositories. To do this, create a parser that implements `Ibexa\Bundle\Core\DependencyInjection\Configuration\RepositoryConfigParserInterface`: -``` php {skip-validation} +``` php use Ibexa\Bundle\Core\DependencyInjection\Configuration\RepositoryConfigParserInterface; use Symfony\Component\Config\Definition\Builder\NodeBuilder; @@ -326,7 +326,7 @@ final class CustomRepositoryConfigParser implements RepositoryConfigParserInterf You need to register this configuration extension in the following way: -``` php {skip-validation} +``` php final class AcmeFeatureBundle extends Bundle { public function build(ContainerBuilder $container): void @@ -342,6 +342,6 @@ final class AcmeFeatureBundle extends Bundle To access the configuration settings, use the `Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider::getRepositoryConfig` method: -``` php {skip-validation} +``` php $acmeConfig = $repositoryConfigProvider->getRepositoryConfig()['acme']; ``` diff --git a/docs/ai_actions/configure_ai_actions.md b/docs/ai_actions/configure_ai_actions.md index 2edae21a9c..1611b11286 100644 --- a/docs/ai_actions/configure_ai_actions.md +++ b/docs/ai_actions/configure_ai_actions.md @@ -91,7 +91,7 @@ composer require ibexa/connector-gemini Then, if not using Symfony Flex, enable the bundle in `config/bundles.php`: -``` php {skip-validation} +``` php Ibexa\Bundle\ConnectorGemini\IbexaConnectorGeminiBundle::class => ['all' => true], ``` diff --git a/docs/api/php_api/php_api.md b/docs/api/php_api/php_api.md index 984c43734c..fe7d8b0c16 100644 --- a/docs/api/php_api/php_api.md +++ b/docs/api/php_api/php_api.md @@ -108,7 +108,7 @@ You can use this method to perform an action that the current user doesn't have For example, to [hide a Location](managing_content.md#hiding-and-revealing-locations), use: -``` php {skip-validation} +``` php use Ibexa\Contracts\Core\Repository\Repository; //... @@ -147,7 +147,7 @@ For example if you're using a command which takes the content ID as a parameter, Both cases should be covered with error messages: -``` php {skip-validation} +``` php try { // ... } catch (\Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException $e) { diff --git a/docs/api/rest_api/extending_rest_api/creating_new_rest_resource.md b/docs/api/rest_api/extending_rest_api/creating_new_rest_resource.md index b31ac5717d..37e53f8f0a 100644 --- a/docs/api/rest_api/extending_rest_api/creating_new_rest_resource.md +++ b/docs/api/rest_api/extending_rest_api/creating_new_rest_resource.md @@ -68,7 +68,7 @@ If the returned value was depending on a location, it could have been wrapped in `CachedValue` is used in the following way: -```php {skip-validation} +```php return new CachedValue( new MyValue($args…), ['locationId'=> $locationId] diff --git a/docs/commerce/cart/cart_api.md b/docs/commerce/cart/cart_api.md index a8e346220c..d8208d737a 100644 --- a/docs/commerce/cart/cart_api.md +++ b/docs/commerce/cart/cart_api.md @@ -64,7 +64,7 @@ To update cart metadata, use the `CartServiceInterface::updateCartMetadata` meth You can also use this method to change cart ownership: -``` php {skip-validation} +``` php use Ibexa\Contracts\Cart\Value\CartMetadataUpdateStruct; // ... @@ -150,7 +150,7 @@ It can include any relevant information that you want to associate with a partic To add context data to a cart, follow this example: -```php {skip-validation} +```php $createStruct = new CartCreateStruct(...); $createStruct->setContext(new ArrayMap([ 'coupon_code' => 'X1MF7699', @@ -166,7 +166,7 @@ You also add "X1MF7699" coupon code as context data to the cart. To attach context data to a cart entry, proceed as follows: -```php {skip-validation} +```php $entryAddStruct = new EntryAddStruct(...); $entryAddStruct->setContext(new ArrayMap([ 'tshirt_text' => 'EqEqEqEq', diff --git a/docs/commerce/shopping_list/install_shopping_list.md b/docs/commerce/shopping_list/install_shopping_list.md index 123c427108..6dbfc025a5 100644 --- a/docs/commerce/shopping_list/install_shopping_list.md +++ b/docs/commerce/shopping_list/install_shopping_list.md @@ -17,7 +17,7 @@ composer require ibexa/shopping-list The associated Symfony Flex recipe configures the bundle and its routes. Check that the following line has been added by the recipe to `config/bundles.php` file's array: -```php {skip-validation} +```php Ibexa\Bundle\ShoppingList\IbexaShoppingListBundle::class => ['all' => true], ``` diff --git a/docs/commerce/shopping_list/shopping_list_api.md b/docs/commerce/shopping_list/shopping_list_api.md index 5cb3021105..1fea806f89 100644 --- a/docs/commerce/shopping_list/shopping_list_api.md +++ b/docs/commerce/shopping_list/shopping_list_api.md @@ -40,7 +40,7 @@ and with sort clauses from the [`SortClause` namespace](/api/php_api/php_api_ref To get all shopping lists (of the current user or of the whole repository depending on the current user limitation), use the search method without criterion: -```php {skip-validation} +```php $lists = $this->shoppingListService->findShoppingLists(new ShoppingListQuery()); ``` @@ -56,7 +56,7 @@ If you forgot to retrieve this result in your variable, the local object isn't s In the following example, if some assignments (`$list =`) are removed, the dumped `$list` object doesn't contain the stored shopping list at that time. If only the middle assignment is removed, the last dumped variable contains the up-to-date shopping list. -```php {skip-validation} +```php $list = $this->shoppingListService->getOrCreateDefaultShoppingList(); dump($list); $list = $this->shoppingListService->clearShoppingList($list); diff --git a/docs/commerce/storefront/configure_storefront.md b/docs/commerce/storefront/configure_storefront.md index 43654f9830..5d69a73251 100644 --- a/docs/commerce/storefront/configure_storefront.md +++ b/docs/commerce/storefront/configure_storefront.md @@ -67,7 +67,7 @@ The basic configuration of the Storefront can look as follows: The `\Ibexa\Contracts\Storefront\Repository\CatalogResolverInterface` interface allows retrieving the product catalog available for a specific user. -```php {skip-validation} +```php namespace Ibexa\Contracts\Storefront\Repository; use Ibexa\Contracts\Core\Repository\Values\User\User; diff --git a/docs/commerce/storefront/extend_storefront.md b/docs/commerce/storefront/extend_storefront.md index b05fa7a7d6..82fc5e0dff 100644 --- a/docs/commerce/storefront/extend_storefront.md +++ b/docs/commerce/storefront/extend_storefront.md @@ -99,7 +99,7 @@ After you modify the controller, it can also pass the following parameters: Define your own logic in a custom controller. Refer to the code snippet below and create your own file, for example, `CustomProductRenderController.php`: -``` php {skip-validation} +``` php public function renderAction(ProductInterface $product): Response { return $this->render('@ibexadesign/storefront/product_card.html.twig', [ diff --git a/docs/commerce/transactional_emails/extend_transactional_emails.md b/docs/commerce/transactional_emails/extend_transactional_emails.md index 03fc1d2920..665ed1cb9a 100644 --- a/docs/commerce/transactional_emails/extend_transactional_emails.md +++ b/docs/commerce/transactional_emails/extend_transactional_emails.md @@ -30,7 +30,7 @@ framework: [[= product_name =]] comes with a predefined [set of variables](transactional_emails_parameters.md) that you can use when building a template for your transactional email campaign at Actito. If this list isn't sufficient, you can use Events to include additional variables: -```php {skip-validation} +```php setCampaign($campaign); } } -``` +``` \ No newline at end of file diff --git a/docs/content_management/collaborative_editing/configure_collaborative_editing.md b/docs/content_management/collaborative_editing/configure_collaborative_editing.md index eb6c4e6c5d..268f774ff4 100644 --- a/docs/content_management/collaborative_editing/configure_collaborative_editing.md +++ b/docs/content_management/collaborative_editing/configure_collaborative_editing.md @@ -24,7 +24,7 @@ It also modifies the permission system to account for the new functionality. Then, if not using Symfony Flex, add the following code to the `config/bundles.php` file: -``` php {skip-validation} +``` php contentService->loadVersionInfo($contentInfo, 2); ``` @@ -169,13 +169,13 @@ The repository is SiteAccess-aware, so languages defined by the SiteAccess are a To load a specific language, provide its language code when loading the content item: -``` php {skip-validation} +``` php $content = $this->contentService->loadContent($contentId, ['ger-DE']); ``` To load all languages as a prioritized list, use `Language::ALL`: -``` php {skip-validation} +``` php $contentService->loadContent($content->id, Language::ALL); ``` @@ -202,7 +202,7 @@ You can do it through the `getMainLocation` method of the ContentInfo object. Next, use the `getParentLocation` method of the location object to access the parent location: -``` php {skip-validation} +``` php $mainLocation = $contentInfo->getMainLocation(); $output->writeln("Parent Location: " . $mainLocation->getParentLocation()->pathString); ``` @@ -222,7 +222,7 @@ The versions must have the same language. For example, to get the comparison between the `name` field of two versions: -```php {skip-validation} +```php $versionFrom = $this->contentService->loadVersionInfo($contentInfo, $versionFromId); $versionTo = $this->contentService->loadVersionInfo($contentInfo, $versionToId); diff --git a/docs/content_management/content_api/creating_content.md b/docs/content_management/content_api/creating_content.md index 7aac2f68e3..bed7373eb5 100644 --- a/docs/content_management/content_api/creating_content.md +++ b/docs/content_management/content_api/creating_content.md @@ -103,6 +103,6 @@ Only one language can still be set as a version's initial language: You can delete a single translation from a content item's version using [`ContentService::deleteTranslationFromDraft`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-ContentService.html#method_deleteTranslationFromDraft). The method must be provided with a `VersionInfo` object and the code of the language to delete: -``` php {skip-validation} +``` php $this->contentService->deleteTranslationFromDraft($versionInfo, $language); ``` diff --git a/docs/content_management/content_api/managing_content.md b/docs/content_management/content_api/managing_content.md index 03953e2083..976b53354c 100644 --- a/docs/content_management/content_api/managing_content.md +++ b/docs/content_management/content_api/managing_content.md @@ -116,7 +116,7 @@ Trash location is identical to the origin location of the object. The content item is restored under its previous location. You can also provide a different location to restore in as a second argument: -``` php {skip-validation} +``` php $newParent = $this->locationService->loadLocation($location); $this->trashService->recover($trashItem, $newParent); ``` diff --git a/docs/content_management/field_types/field_type_reference/addressfield.md b/docs/content_management/field_types/field_type_reference/addressfield.md index d7ff4ec7e2..d374937caa 100644 --- a/docs/content_management/field_types/field_type_reference/addressfield.md +++ b/docs/content_management/field_types/field_type_reference/addressfield.md @@ -27,7 +27,7 @@ provided by the `ibexa/fieldtype-address` package. ### Example input -```php {skip-validation} +```php new FieldType\Value( 'My home address', 'PL', @@ -112,7 +112,7 @@ ibexa.address.field.tax_number.billing_address.DE An event listener can also provide validation by using either one of [constraints provided by Symfony]([[= symfony_doc =]]/validation.html#supported-constraints), or a custom constraint. -```php {skip-validation} +```php use Ibexa\Contracts\FieldTypeAddress\Event\MapFieldEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Form\Extension\Core\Type\IntegerType; diff --git a/docs/content_management/field_types/field_type_reference/authorfield.md b/docs/content_management/field_types/field_type_reference/authorfield.md index 684d381a65..c26c2dcb11 100644 --- a/docs/content_management/field_types/field_type_reference/authorfield.md +++ b/docs/content_management/field_types/field_type_reference/authorfield.md @@ -18,7 +18,7 @@ This field type allows the storage and retrieval of one or more authors. For eac Example: -``` php {skip-validation} +``` php $authorList = Author\Value([ new Author\Author([ 'id' => 1, @@ -39,7 +39,7 @@ The hash format mostly matches the value object. It has the following key `autho Example -``` php {skip-validation} +``` php [ [ 'id' => 1, @@ -79,7 +79,7 @@ Following `defaultAuthor` default value options are available as constants in | `DEFAULT_VALUE_EMPTY` | Default value is empty. | | `DEFAULT_CURRENT_USER` | Default value uses currently logged user. | -``` php {skip-validation} +``` php // Author field type example settings use Ibexa\Core\FieldType\Author\Type; diff --git a/docs/content_management/field_types/field_type_reference/binaryfilefield.md b/docs/content_management/field_types/field_type_reference/binaryfilefield.md index 9f93001dc2..3b7d612234 100644 --- a/docs/content_management/field_types/field_type_reference/binaryfilefield.md +++ b/docs/content_management/field_types/field_type_reference/binaryfilefield.md @@ -46,7 +46,7 @@ The hash format mostly matches the value object. It has the following keys: Example: -```php {skip-validation} +```php $fileContentCreateStruct->setField('file', new Ibexa\Core\FieldType\BinaryFile\Value([ 'fileName' => 'example.pdf', 'inputUri' => '/tmp/example_for_website.pdf', diff --git a/docs/content_management/field_types/field_type_reference/checkboxfield.md b/docs/content_management/field_types/field_type_reference/checkboxfield.md index 85c60fc469..54380b2469 100644 --- a/docs/content_management/field_types/field_type_reference/checkboxfield.md +++ b/docs/content_management/field_types/field_type_reference/checkboxfield.md @@ -18,7 +18,7 @@ The Value class of this field type contains the following properties: |----------|-----------|---------------|--------------------------------------------------------------------------------| | `$bool` | `boolean` | `false` | This property is used for the checkbox status, represented by a boolean value. | -``` php {skip-validation} +``` php //Value object content examples use Ibexa\Core\FieldType\Checkbox\Type; @@ -36,7 +36,7 @@ $value->bool = false; The `Checkbox\Value` constructor accepts a boolean value: -``` php {skip-validation} +``` php // Constructor example use Ibexa\Core\FieldType\Checkbox\Type; diff --git a/docs/content_management/field_types/field_type_reference/countryfield.md b/docs/content_management/field_types/field_type_reference/countryfield.md index b0cd8d1480..521b06bd94 100644 --- a/docs/content_management/field_types/field_type_reference/countryfield.md +++ b/docs/content_management/field_types/field_type_reference/countryfield.md @@ -12,7 +12,7 @@ This field type represents one or multiple countries. Example array: -``` php {skip-validation} +``` php [ "JP" => [ "Name" => "Japan", @@ -37,7 +37,7 @@ The field definition of this field type can be configured with one option: |--------------|-----------|---------------|--------------------------------------------------------------------------------------------| | `isMultiple` | `boolean` | `false` | This setting allows (if true) or prohibits (if false) the selection of multiple countries. | -``` php {skip-validation} +``` php // Country FieldType example settings $settings = [ "isMultiple" => true @@ -49,7 +49,7 @@ $settings = [ The format used for serialization is simpler than the full format. It's also available when setting value on the content field, by setting the value to an array instead of the value object. Example of that shown below: -``` php {skip-validation} +``` php // Value object content example $content->fields["countries"] = [ "JP", "NO" ]; ``` @@ -66,7 +66,7 @@ The Value class of this field type contains the following properties: |--------------|-----------|---------------------------------------------------------------------------------------| | `$countries` | `array[]` | This property is used for the country selection provided as input, as its attributes. | -``` php {skip-validation} +``` php // Value object content example $value->countries = [ "JP" => [ @@ -83,7 +83,7 @@ $value->countries = [ The `Country\Value` constructor initializes a new value object with the value provided. It expects an array as input. -``` php {skip-validation} +``` php // Constructor example // Instantiates a Country Value object diff --git a/docs/content_management/field_types/field_type_reference/dateandtimefield.md b/docs/content_management/field_types/field_type_reference/dateandtimefield.md index ee5b00282f..d0d5e3fd25 100644 --- a/docs/content_management/field_types/field_type_reference/dateandtimefield.md +++ b/docs/content_management/field_types/field_type_reference/dateandtimefield.md @@ -59,7 +59,7 @@ Hash value of this field type is an array with two keys: | `timestamp` | `integer` | Time information in [Unix format timestamp](https://en.wikipedia.org/wiki/Unix_time). | `1400856992` | | `rfc850` | `string` | Time information as a string in [RFC 850 date format](https://datatracker.ietf.org/doc/html/rfc850). As input, this has precedence over the timestamp value. | `"Friday, 23-May-14 14:56:14 GMT+0000"` | -``` php {skip-validation} +``` php $hash = [ "timestamp" => 1400856992, "rfc850" => "Friday, 23-May-14 14:56:14 GMT+0000" @@ -88,7 +88,7 @@ Following `defaultType` default value options are available as constants in the | `DEFAULT_CURRENT_DATE` | Default value uses current date. | | `DEFAULT_CURRENT_DATE_ADJUSTED` | Default value uses current date, adjusted by the interval defined in `dateInterval` setting. | -``` php {skip-validation} +``` php // DateAndTime FieldType example settings use Ibexa\Core\FieldType\DateAndTime\Type; @@ -110,6 +110,6 @@ The template called by the [`ibexa_render_field()` Twig function](field_twig_fun Example: -``` php {skip-validation} +``` php {{ ibexa_render_field(content, 'datetime') }} ``` diff --git a/docs/content_management/field_types/field_type_reference/datefield.md b/docs/content_management/field_types/field_type_reference/datefield.md index 04f8eb112c..415f9153c4 100644 --- a/docs/content_management/field_types/field_type_reference/datefield.md +++ b/docs/content_management/field_types/field_type_reference/datefield.md @@ -61,7 +61,7 @@ Hash value of this field type is an array with two keys: | `timestamp` | `integer` | Time information in [unix format timestamp](https://en.wikipedia.org/wiki/Unix_time). | `1400856992` | | `rfc850` | `string` | Time information as a string in [RFC 850 date format](https://datatracker.ietf.org/doc/html/rfc850). As input, this has higher precedence over the timestamp value. | `"Friday, 23-May-14 14:56:14 GMT+0000"` | -``` php {skip-validation} +``` php // Example of the hash value in PHP $hash = [ "timestamp" => 1400856992, @@ -88,7 +88,7 @@ Following `defaultType` default value options are available as constants in the | `DEFAULT_EMPTY` | Default value is empty. | | `DEFAULT_CURRENT_DATE` | Default value uses current date. | -``` php {skip-validation} +``` php // Date field type example settings use Ibexa\Core\FieldType\Date\Type; diff --git a/docs/content_management/field_types/field_type_reference/emailaddressfield.md b/docs/content_management/field_types/field_type_reference/emailaddressfield.md index 4a24d3a80b..db376e9eee 100644 --- a/docs/content_management/field_types/field_type_reference/emailaddressfield.md +++ b/docs/content_management/field_types/field_type_reference/emailaddressfield.md @@ -18,7 +18,7 @@ The `Value` class of this field type contains the following properties: |----------|----------|-----------------------------------------------------------------------| | `$email` | `string` | This property is used for the input string provided as email address. | -``` php {skip-validation} +``` php // Value object content example use Ibexa\Core\FieldType\EmailAddress\Type; @@ -35,7 +35,7 @@ $emailaddressValue->email = "someuser@example.com"; The `EmailAddress\Value` constructor initializes a new value object with the value provided. It accepts a string as input. -``` php {skip-validation} +``` php // Constructor example use Ibexa\Core\FieldType\EmailAddress\Type; diff --git a/docs/content_management/field_types/field_type_reference/floatfield.md b/docs/content_management/field_types/field_type_reference/floatfield.md index 5f00020410..ec09b0eeaf 100644 --- a/docs/content_management/field_types/field_type_reference/floatfield.md +++ b/docs/content_management/field_types/field_type_reference/floatfield.md @@ -27,7 +27,7 @@ The Value class of this field type contains the following properties: |----------|---------|---------------------------------------------------------------| | `$value` | `float` | This property is used to store the value provided as a float. | -``` php {skip-validation} +``` php // Value object content example use Ibexa\Core\FieldType\Float\Type; @@ -43,7 +43,7 @@ $float->value = 284.773 The `Float\Value` constructor initializes a new value object with the value provided. It expects a numeric value with or without decimals. -``` php {skip-validation} +``` php // Constructor example use Ibexa\Core\FieldType\Float\Type; @@ -61,7 +61,7 @@ This field type supports `FloatValueValidator`, defining maximum and minimum flo | `minFloatValue` | `float` | `null | This setting defines the minimum value this field type which is allowed as input. | | `maxFloatValue` | `float` | `null | This setting defines the maximum value this field type which is allowed as input. | -``` php {skip-validation} +``` php // Validator configuration example in PHP use Ibexa\Core\FieldType\Float\Type; diff --git a/docs/content_management/field_types/field_type_reference/imageassetfield.md b/docs/content_management/field_types/field_type_reference/imageassetfield.md index ead014a931..65da261fd9 100644 --- a/docs/content_management/field_types/field_type_reference/imageassetfield.md +++ b/docs/content_management/field_types/field_type_reference/imageassetfield.md @@ -29,7 +29,7 @@ Value object of `ibexa_image_asset` contains the following properties: | `destinationContentId` | `int` | Related content ID. | | `alternativeText` | `string` | The alternative image text (for example "Picture of an apple."). | -``` php {skip-validation} +``` php // Value object content example $imageAssetValue->destinationContentId = $contentInfo->id; @@ -41,7 +41,7 @@ $imageAssetValue->alternativeText = "Picture of an apple."; The `ImageAsset\Value` constructor initializes a new value object with the value provided. It expects an ID of a content item representing asset and the alternative text. -``` php {skip-validation} +``` php // Constructor example // Instantiates a ImageAsset Value object diff --git a/docs/content_management/field_types/field_type_reference/imagefield.md b/docs/content_management/field_types/field_type_reference/imagefield.md index 2590e1e926..3752a8bef1 100644 --- a/docs/content_management/field_types/field_type_reference/imagefield.md +++ b/docs/content_management/field_types/field_type_reference/imagefield.md @@ -149,7 +149,7 @@ Requested through REST, this resource generates the variation if it doesn't exis The variation service, `ibexa.field_type.ibexa_image.variation_service`, can be used to generate/get variations for a field. It expects a VersionInfo, the Image field, and the variation name as a string (`large`, `medium`, and more.): -``` php {skip-validation} +``` php $variation = $imageVariationHandler->getVariation( $imageField, $versionInfo, 'large' ); @@ -164,7 +164,7 @@ echo $variation->uri; As for any field type, there are several ways to input content to a field. For an Image, the quickest is to call `setField()` on the ContentStruct: -``` php {skip-validation} +``` php $createStruct = $contentService->newContentCreateStruct( $contentTypeService->loadContentType( 'image' ), 'eng-GB' @@ -176,7 +176,7 @@ $createStruct->setField( 'image', '/tmp/image.png' ); To customize the Image's alternative texts, you must first get an `Image\Value` object, and set this property. For that, you can use the `Image\Value::fromString()` method that accepts the path to a local file: -``` php {skip-validation} +``` php $createStruct = $contentService->newContentCreateStruct( $contentTypeService->loadContentType( 'image' ), 'eng-GB' @@ -189,7 +189,7 @@ $createStruct->setField( 'image', $imageField ); You can also provide a hash of `Image\Value` properties, either to `setField()`, or to the constructor: -``` php {skip-validation} +``` php $imageValue = new \Ibexa\Core\FieldType\Image\Value( [ 'id' => '/tmp/image.png', diff --git a/docs/content_management/field_types/field_type_reference/integerfield.md b/docs/content_management/field_types/field_type_reference/integerfield.md index 61bbca3500..c1eb8f3b9d 100644 --- a/docs/content_management/field_types/field_type_reference/integerfield.md +++ b/docs/content_management/field_types/field_type_reference/integerfield.md @@ -24,7 +24,7 @@ The Value class of this field type contains the following properties: |----------|-------|------------| | `$value` | `int` | This property is used to store the value provided as an integer. | -``` php {skip-validation} +``` php // Value object content example $integer->value = 8 ``` @@ -34,7 +34,7 @@ $integer->value = 8 The `Integer\Value` constructor initializes a new value object with the value provided. It expects a numeric, integer value. -``` php {skip-validation} +``` php // Constructor example use Ibexa\Core\FieldType\Integer; @@ -63,7 +63,7 @@ This field type supports `IntegerValueValidator`, defining maximum and minimum f |`minIntegerValue`|`int`|`0`|This setting defines the minimum value this field type which is allowed as input.| |`maxIntegerValue`|`int`|`null`|This setting defines the maximum value this field type which is allowed as input.| -``` php {skip-validation} +``` php // Example of validator configuration in PHP $validatorConfiguration = [ "minIntegerValue" => 1, diff --git a/docs/content_management/field_types/field_type_reference/isbnfield.md b/docs/content_management/field_types/field_type_reference/isbnfield.md index f023d711cd..8b4baf9c51 100644 --- a/docs/content_management/field_types/field_type_reference/isbnfield.md +++ b/docs/content_management/field_types/field_type_reference/isbnfield.md @@ -32,7 +32,7 @@ It accepts a string as argument and sets it to the `isbn` attribute. The input passed into this field type is subject of ISBN validation depending on the field settings in its FieldDefinition stored in the content type. An example of this field setting is shown below and controls if input is validated as ISBN-13 or ISBN-10: -``` php {skip-validation} +``` php Array ( [isISBN13] => true diff --git a/docs/content_management/field_types/field_type_reference/keywordfield.md b/docs/content_management/field_types/field_type_reference/keywordfield.md index dbc40674cb..1d1d09b35f 100644 --- a/docs/content_management/field_types/field_type_reference/keywordfield.md +++ b/docs/content_management/field_types/field_type_reference/keywordfield.md @@ -26,7 +26,7 @@ The Value class of this field type contains the following properties: |----------|------------|----------------------------------------| | `$value` | `string[]` | Holds an array of keywords as strings. | -``` php {skip-validation} +``` php // Value object content example use Ibexa\Core\FieldType\Keyword\Value; @@ -43,7 +43,7 @@ The `Keyword\Value` constructor initializes a new value object with the value pr It expects a list of keywords, either comma-separated in a string or as an array of strings. -``` php {skip-validation} +``` php // Constructor example use Ibexa\Core\FieldType\Keyword\Value; diff --git a/docs/content_management/field_types/field_type_reference/maplocationfield.md b/docs/content_management/field_types/field_type_reference/maplocationfield.md index 55999bb6f3..feaf4ef115 100644 --- a/docs/content_management/field_types/field_type_reference/maplocationfield.md +++ b/docs/content_management/field_types/field_type_reference/maplocationfield.md @@ -36,7 +36,7 @@ The Value class of this field type contains the following properties: The `MapLocation\Value` constructor initializes a new value object with values provided as hash. Accepted keys are `latitude` (`float`), `longitude` (`float`), `address` (`string`). -``` php {skip-validation} +``` php // Constructor example // Instantiates a MapLocation Value object diff --git a/docs/content_management/field_types/field_type_reference/matrixfield.md b/docs/content_management/field_types/field_type_reference/matrixfield.md index d2c430a563..1542ceeebd 100644 --- a/docs/content_management/field_types/field_type_reference/matrixfield.md +++ b/docs/content_management/field_types/field_type_reference/matrixfield.md @@ -18,7 +18,7 @@ The Matrix field type is available via the Matrix Bundle provided by the [ibexa/ Example of input: -```php {skip-validation} +```php new FieldType\Value([ new FieldType\Value\Row(['col1' => 'Row 1, Col 1', 'col2' => 'Row 1, Col 2']), new FieldType\Value\Row(['col1' => 'Row 2, Col 1', 'col2' => 'Row 2, Col 2']), @@ -46,7 +46,7 @@ If, after removing empty rows, the number of rows doesn't fulfill the configured For example, the following input doesn't validate if `Minimum number of rows` is set to 3, because the second row is empty: -```php {skip-validation} +```php new FieldType\Value([ new FieldType\Value\Row(['col1' => 'Row 1, Col 1', 'col2' => 'Row 1, Col 2']), new FieldType\Value\Row(['col1' => '', 'col2' => '']), diff --git a/docs/content_management/field_types/field_type_reference/measurementfield.md b/docs/content_management/field_types/field_type_reference/measurementfield.md index 63d2620d98..5db02da753 100644 --- a/docs/content_management/field_types/field_type_reference/measurementfield.md +++ b/docs/content_management/field_types/field_type_reference/measurementfield.md @@ -42,7 +42,7 @@ As its first argument it accepts an object of `Ibexa\Contracts\Measurement\Value Depending on the selected input type, the object resembles the following examples: -``` php {skip-validation} +``` php // Simple input (single value) example // @var MeasurementServiceInterface $measurementService @@ -57,7 +57,7 @@ $measurementValue = new Measurement\Value( ); ``` -``` php {skip-validation} +``` php // Range input value example // @var MeasurementServiceInterface $measurementService diff --git a/docs/content_management/field_types/field_type_reference/mediafield.md b/docs/content_management/field_types/field_type_reference/mediafield.md index eb75815f06..42c04d15b9 100644 --- a/docs/content_management/field_types/field_type_reference/mediafield.md +++ b/docs/content_management/field_types/field_type_reference/mediafield.md @@ -71,7 +71,7 @@ The field type supports `FileSizeValidator`, defining maximum size of media file |------|------|------|------| |`maxFileSize`|`int`|`false`|Maximum size of the file in bytes.| -``` php {skip-validation} +``` php // Example of using Media field type validator in PHP use Ibexa\Core\FieldType\Media\Type; @@ -107,7 +107,7 @@ List of all available `mediaType` constants is defined in the `Ibexa\Core\FieldT | `TYPE_HTML5_VIDEO` | HTML5 Video | | `TYPE_HTML5_AUDIO` | HTML5 Audio | -``` php {skip-validation} +``` php // Example of using Media field type settings in PHP use Ibexa\Core\FieldType\Media\Type; diff --git a/docs/content_management/field_types/field_type_reference/relationfield.md b/docs/content_management/field_types/field_type_reference/relationfield.md index 33a64b15d2..6f8b9a8543 100644 --- a/docs/content_management/field_types/field_type_reference/relationfield.md +++ b/docs/content_management/field_types/field_type_reference/relationfield.md @@ -25,7 +25,7 @@ The Value class of this field type contains the following properties: |------------------------|-------------------|-------------------------------------------------------------------------------------------| | `$destinationContentId` | `string|int|null` | This property is used to store the value provided, which represents the related content. | -``` php {skip-validation} +``` php // Value object content example $relation->destinationContentId = $contentInfo->id; @@ -35,7 +35,7 @@ $relation->destinationContentId = $contentInfo->id; The `Relation\Value` constructor initializes a new value object with the value provided. It expects a mixed value. -``` php {skip-validation} +``` php // Constructor example // Instantiates a Relation Value object @@ -56,7 +56,7 @@ The field definition of this field type can be configured with three options: | `selectionRoot` | `string` | `null` | This setting defines the selection root. | | `selectionContentTypes` | `array` | `[]` | An array of content type IDs that are allowed for related Content. | -``` php {skip-validation} +``` php // Relation FieldType example settings use Ibexa\Core\FieldType\Relation\Type; diff --git a/docs/content_management/field_types/field_type_reference/relationlistfield.md b/docs/content_management/field_types/field_type_reference/relationlistfield.md index a081518bd1..f920a2a9ae 100644 --- a/docs/content_management/field_types/field_type_reference/relationlistfield.md +++ b/docs/content_management/field_types/field_type_reference/relationlistfield.md @@ -27,7 +27,7 @@ This field type makes it possible to store and retrieve values of a relation to |------|------|------|------| |`destinationContentIds`|`array`|An array of related Content IDs|`[ 24, 42 ]`| -``` php {skip-validation} +``` php // Value object content example $relationList->destinationContentId = [ $contentInfo1->id, @@ -41,7 +41,7 @@ $relationList->destinationContentId = [ The `RelationList\Value` constructor initializes a new value object with the value provided. It expects a mixed array as value. -``` php {skip-validation} +``` php //Constructor example // Instantiates a RelationList Value object @@ -90,7 +90,7 @@ Following selection methods are available: |------|------|------|------| |`RelationListValueValidator[selectionLimit]`|`integer`|`0`|The number of content items that can be selected in the field. When set to 0, any number can be selected.| -``` php {skip-validation} +``` php // Example of using settings and validators configuration in PHP use Ibexa\Core\FieldType\RelationList\Type; diff --git a/docs/content_management/field_types/field_type_reference/richtextfield.md b/docs/content_management/field_types/field_type_reference/richtextfield.md index 0877bc9131..1729dbffd2 100644 --- a/docs/content_management/field_types/field_type_reference/richtextfield.md +++ b/docs/content_management/field_types/field_type_reference/richtextfield.md @@ -70,7 +70,7 @@ You can use the [[= product_name_base =]] flavor of the DocBook format in PHP AP The following example shows how to pass DocBook content to a [create struct](creating_content.md#creating-content-item-draft): -``` php {skip-validation} +``` php $contentCreateStruct = $contentService->newContentCreateStruct( $contentType, "eng-GB" ); $inputString = <<selection = [ 1, 4, 5 ]; The `Selection\Value` constructor accepts an array of selected element identifiers. -``` php {skip-validation} +``` php // Constructor example // Instanciates a selection value with items #1 and #2 selected @@ -55,7 +55,7 @@ Example: `"1,2,24,42"` Hash format of this field type is the same as value object's `selection` property. -``` php {skip-validation} +``` php // Example of value in hash format $hash = [ 1, 2 ]; @@ -74,7 +74,7 @@ When option validation fails, a list with the invalid options is also presented. | `isMultiple` | `boolean` | `false` | Used to allow or prohibit multiple selection from the option list. | | `options` | `hash` | `[]` | Stores the list of options defined in the field definition. | -``` php {skip-validation} +``` php // Selection field type example settings use Ibexa\Core\FieldType\Selection\Type; diff --git a/docs/content_management/field_types/field_type_reference/taxonomyentryassignmentfield.md b/docs/content_management/field_types/field_type_reference/taxonomyentryassignmentfield.md index df1b0f18b8..476c043d1f 100644 --- a/docs/content_management/field_types/field_type_reference/taxonomyentryassignmentfield.md +++ b/docs/content_management/field_types/field_type_reference/taxonomyentryassignmentfield.md @@ -23,7 +23,7 @@ To be able to assign tags to the content, first, you need to add a `TaxonomyEntr | `array` | array with `Ibexa\Contracts\Taxonomy\Value\TaxonomyEntry` objects under `taxonomy_entries` key and Taxonomy identifier under `taxonomy` key | see below | Example using an `Ibexa\Taxonomy\FieldType\TaxonomyEntryAssignment\Value` object: -``` php {skip-validation} +``` php $taxonomyEntry1 = $this->taxonomyService->loadEntryByIdentifier('example_entry', 'tags'); $taxonomyEntry2 = $this->taxonomyService->loadEntryByIdentifier('example_entry_2', 'tags'); new \Ibexa\Taxonomy\FieldType\TaxonomyEntryAssignment\Value( @@ -37,7 +37,7 @@ new \Ibexa\Taxonomy\FieldType\TaxonomyEntryAssignment\Value( ``` Example using array: -``` php {skip-validation} +``` php [ 'taxonomy_entries' => [$taxonomyEntry, $taxonomyEntry2], // load entries using TaxonomyService 'taxonomy' => 'tags', diff --git a/docs/content_management/field_types/field_type_reference/taxonomyentryfield.md b/docs/content_management/field_types/field_type_reference/taxonomyentryfield.md index a7037e6b1b..1fdbb9ec8b 100644 --- a/docs/content_management/field_types/field_type_reference/taxonomyentryfield.md +++ b/docs/content_management/field_types/field_type_reference/taxonomyentryfield.md @@ -17,7 +17,7 @@ A `TaxonomyEntry` field accepts an array with an `Ibexa\Contracts\Taxonomy\Value | `array` | array with an `Ibexa\Contracts\Taxonomy\Value\TaxonomyEntry` object under the `taxonomy_entry` key | see below | Example using an `Ibexa\Taxonomy\FieldType\TaxonomyEntry\Value` object: -``` php {skip-validation} +``` php $taxonomyEntry = $this->taxonomyService->loadEntryByIdentifier('example_entry', 'tags'); new \Ibexa\Taxonomy\FieldType\TaxonomyEntry\Value( new \Ibexa\Contracts\Taxonomy\Value\TaxonomyEntry( @@ -26,7 +26,7 @@ new \Ibexa\Taxonomy\FieldType\TaxonomyEntry\Value( ); ``` Example using array: -``` php {skip-validation} +``` php [ 'taxonomy_entry' => $taxonomyEntry, // load Entry using TaxonomyService ] @@ -44,7 +44,7 @@ Example using array: The constructor accepts an `Ibexa\Contracts\Taxonomy\Value\TaxonomyEntry` object. -``` php {skip-validation} +``` php // Constructor example use Ibexa\Taxonomy\FieldType\TaxonomyEntry; diff --git a/docs/content_management/field_types/field_type_reference/textlinefield.md b/docs/content_management/field_types/field_type_reference/textlinefield.md index 732e28bfcd..7867869265 100644 --- a/docs/content_management/field_types/field_type_reference/textlinefield.md +++ b/docs/content_management/field_types/field_type_reference/textlinefield.md @@ -35,7 +35,7 @@ The length of the string provided must be between the minimum length defined in The default value for both properties is 0, which means that the validation is disabled by default. To set the validation properties, the `validateValidatorConfiguration()` method needs to be inspected, which receives an array with `minStringLength` and `maxStringLength` like in the following representation: -```php {skip-validation} +```php [ 'StringLengthValidator' => [ 'maxStringLength' => 60 diff --git a/docs/content_management/field_types/field_type_reference/timefield.md b/docs/content_management/field_types/field_type_reference/timefield.md index 7ffbcef01d..8fc0bd7916 100644 --- a/docs/content_management/field_types/field_type_reference/timefield.md +++ b/docs/content_management/field_types/field_type_reference/timefield.md @@ -70,7 +70,7 @@ The Field definition of this field type can be configured with several options: | `useSeconds` | `boolean` | `false` | Used to control displaying of seconds in the output. | | `defaultType` | `Type::DEFAULT_EMPTY Type::DEFAULT_CURRENT_TIME` | `Type::DEFAULT_EMPTY` | The constant used here defines default input value when using back-end interface. | -``` php {skip-validation} +``` php // Time field type example settings use Ibexa\Core\FieldType\Time\Type; diff --git a/docs/content_management/field_types/field_type_reference/urlfield.md b/docs/content_management/field_types/field_type_reference/urlfield.md index 5b0d3ba51a..5a29baa0e2 100644 --- a/docs/content_management/field_types/field_type_reference/urlfield.md +++ b/docs/content_management/field_types/field_type_reference/urlfield.md @@ -27,7 +27,7 @@ The Value class of this field type contains the following properties: | `$link` | `string` | This property stores the link provided to the value of this field type. | | `$text` | `string` | This property stores the text to represent the stored link provided to the value of this field type. | -``` php {skip-validation} +``` php // Value object content example $url->link = "https://www.ibexa.co"; @@ -39,7 +39,7 @@ $url->text = "Ibexa"; The `Url\Value` constructor initializes a new value object with the provided value. It expects two comma-separated strings, corresponding to the link and text. -``` php {skip-validation} +``` php // Constructor example // Instantiates an Url Value object @@ -52,7 +52,7 @@ $UrlValue = new Url\Value( "https://www.ibexa.co/", "Ibexa" ); | `link` | `string` | Link content. | "https://www.ibexa.co/" | | `text` | `string` | Text content. | "Ibexa" | -```php {skip-validation} +```php // Example of the hash value in PHP $hash = [ "link" => "https://www.ibexa.co/", diff --git a/docs/content_management/field_types/field_type_search.md b/docs/content_management/field_types/field_type_search.md index 32f2bb8bdd..807726cb40 100644 --- a/docs/content_management/field_types/field_type_search.md +++ b/docs/content_management/field_types/field_type_search.md @@ -21,7 +21,7 @@ They're described below in further detail. To be able to query data properly an indexable field type also is required to return search specification. You must return an associative array of `Ibexa\Contracts\Core\Search\FieldType` instances from this method, which could look like: -```php {skip-validation} +```php [ 'url' => new Search\FieldType\StringField(), 'text' => new Search\FieldType\StringField(), diff --git a/docs/content_management/field_types/field_type_validation.md b/docs/content_management/field_types/field_type_validation.md index 3d7707c1ad..d2f9a5553a 100644 --- a/docs/content_management/field_types/field_type_validation.md +++ b/docs/content_management/field_types/field_type_validation.md @@ -17,7 +17,7 @@ except it has an additional level, to group settings for a certain validation me For example, for the `ibexa_string` type, the validator schema could be: -``` php {skip-validation} +``` php [ 'stringLength' => [ 'minStringLength' => [ diff --git a/docs/content_management/field_types/form_and_template.md b/docs/content_management/field_types/form_and_template.md index f37294026b..b5f0eba859 100644 --- a/docs/content_management/field_types/form_and_template.md +++ b/docs/content_management/field_types/form_and_template.md @@ -23,7 +23,7 @@ The `FieldValueFormMapperInterface::mapFieldValueForm` method accepts two argume You have to add your form type to the content editing form. The example shows how `ibexa_boolean` injects the form: -``` php {skip-validation} +``` php use Ibexa\Contracts\ContentForms\Data\Content\FieldData; use Ibexa\ContentForms\Form\Type\FieldType\CheckboxFieldType; use Symfony\Component\Form\FormInterface; @@ -63,7 +63,7 @@ You can use a [`DataTransformer`]([[= symfony_doc =]]/form/data_transformers.htm Providing definition editing support is almost identical to creating content editing support. The only difference are field names: -``` php {skip-validation} +``` php use Ibexa\AdminUi\Form\Data\FieldDefinitionData; use Ibexa\ContentForms\Form\Type\FieldType\CountryFieldType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType; diff --git a/docs/content_management/field_types/type_and_value.md b/docs/content_management/field_types/type_and_value.md index ccf9a0b53e..fb55abd5b2 100644 --- a/docs/content_management/field_types/type_and_value.md +++ b/docs/content_management/field_types/type_and_value.md @@ -168,7 +168,7 @@ It's recommended to use a simple associative array format for the settings schem An example schema could look like this: -``` php {skip-validation} +``` php [ 'backupData' => [ 'type' => 'bool', diff --git a/docs/content_management/file_management/file_management.md b/docs/content_management/file_management/file_management.md index 78a1e1517d..bedce65245 100644 --- a/docs/content_management/file_management/file_management.md +++ b/docs/content_management/file_management/file_management.md @@ -8,7 +8,7 @@ description: Configurations and management of binary files. To access binary files from the PHP API, use the `Ibexa\Core\IO\IOServiceInterface::loadBinaryFile()` method: -```php {skip-validation} +```php $file = $this->ioService->loadBinaryFile($field->value->id); $fileContent = $this->ioService->getFileContents($file); ``` diff --git a/docs/content_management/images/configure_image_editor.md b/docs/content_management/images/configure_image_editor.md index 8deae045bf..ed37e270ec 100644 --- a/docs/content_management/images/configure_image_editor.md +++ b/docs/content_management/images/configure_image_editor.md @@ -51,7 +51,7 @@ By default, additional information stores the coordinates of the [focal point]([ To modify the value of additional information programmatically, you can set a value of the `Image` field by using the PHP API, for example: -``` php {skip-validation} +``` php new FieldValue([ 'data' => [ 'width' => '100', diff --git a/docs/content_management/taxonomy/taxonomy_api.md b/docs/content_management/taxonomy/taxonomy_api.md index ac1de45bd7..613abecde4 100644 --- a/docs/content_management/taxonomy/taxonomy_api.md +++ b/docs/content_management/taxonomy/taxonomy_api.md @@ -20,7 +20,7 @@ and use `TaxonomyServiceInterface::loadEntryByIdentifier()`: !!! note A taxonomy entry identifier is unique per taxonomy. If you have [several taxonomies](taxonomy.md#customize-taxonomy-structure), you can increase code readability by always passing the taxonomy identifier even when it's the default one. The default taxonomy is `tags` if it exists, else the first configured taxonomy (see `\Ibexa\Taxonomy\Service\TaxonomyConfiguration::getDefaultTaxonomyName` for details). - ``` php {skip-validation} + ``` php $springs[] = $this->taxonomyService->loadEntryByIdentifier('spring', 'tags'); $springs[] = $this->taxonomyService->loadEntryByIdentifier('spring', 'events'); $springs[] = $this->taxonomyService->loadEntryByIdentifier('spring', 'devices'); diff --git a/docs/content_management/url_management/url_management.md b/docs/content_management/url_management/url_management.md index 4e11f592a5..ed56dadc75 100644 --- a/docs/content_management/url_management/url_management.md +++ b/docs/content_management/url_management/url_management.md @@ -102,7 +102,7 @@ For more information about [[= product_name_base =]] configuration, see [Configu You can extend the external URL address validation with a custom protocol. To do this, you must provide a service that implements the `Ibexa\Bundle\Core\URLChecker\URLHandlerInterface` interface: s -```php {skip-validation} +```php setContext($new_context); diff --git a/docs/infrastructure_and_maintenance/cache/http_cache/content_aware_cache.md b/docs/infrastructure_and_maintenance/cache/http_cache/content_aware_cache.md index c13d4be0ad..6e93ca73d3 100644 --- a/docs/infrastructure_and_maintenance/cache/http_cache/content_aware_cache.md +++ b/docs/infrastructure_and_maintenance/cache/http_cache/content_aware_cache.md @@ -171,7 +171,7 @@ Examples for tagging everything needed for content using the autowireable [`Resp Examples for adding specific content tags using the autowireable `ContentTagInterface`: -``` php {skip-validation} +``` php /** @var \Ibexa\Contracts\HttpCache\Handler\ContentTagInterface $tagHandler */ // Example for tagging everything needed for Content: @@ -191,7 +191,7 @@ In PHP, FOSHttpCache exposes the `fos_http_cache.http.symfony_response_tagger` s The following example adds minimal tags when ID 33 and 34 are rendered in ESI, but parent response needs these tags to get refreshed if they're deleted: -``` php {skip-validation} +``` php /** @var \FOS\HttpCacheBundle\Http\SymfonyResponseTagger $responseTagger */ $responseTagger->addTags([ContentTagInterface::RELATION_PREFIX . '33', ContentTagInterface::RELATION_PREFIX . '34']); ``` @@ -203,7 +203,7 @@ See [Tagging from code](https://foshttpcachebundle.readthedocs.io/en/latest/feat For custom or built-in controllers (for example, REST) that still use `X-Location-Id`, `XLocationIdResponseSubscriber` handles translating this header to tags. It supports singular and comma-separated location ID value(s): -```php {skip-validation} +```php /** @var \Symfony\Component\HttpFoundation\Response $response */ $response->headers->set('X-Location-Id', 123); @@ -323,7 +323,7 @@ In other words, HTTP Cache for `[Parent1]`, children of `[Parent1]` ( if any ), While the system purges tags whenever API is used to change data, you may need to purge directly from code. For that you can use the built-in purge client: -```php {skip-validation} +```php /** @var \Ibexa\Contracts\HttpCache\PurgeClient\PurgeClientInterface $purgeClient */ // Example for purging by Location ID: diff --git a/docs/infrastructure_and_maintenance/cache/http_cache/context_aware_cache.md b/docs/infrastructure_and_maintenance/cache/http_cache/context_aware_cache.md index 899ab902a7..9d299b4f34 100644 --- a/docs/infrastructure_and_maintenance/cache/http_cache/context_aware_cache.md +++ b/docs/infrastructure_and_maintenance/cache/http_cache/context_aware_cache.md @@ -91,7 +91,7 @@ This a low effort solution, and can be enough for one fragment that is reused ac Example: -```php {skip-validation} +```php // Inside a custom controller action, or even a Content View controller $response->setVary('Cookie'); ``` @@ -139,7 +139,7 @@ To avoid overloading any application code, take advantage of Symfony's event sys 1\. Add a [Response event (`kernel.response`)]([[= symfony_doc =]]/reference/events.html#kernel-response) [listener or subscriber]([[= symfony_doc =]]/event_dispatcher.html) to add your own hash to `/_fos_user_context_hash`: -```php {skip-validation} +```php public function addPreferenceHash(FilterResponseEvent $event) { $response = $event->getResponse(); @@ -186,7 +186,7 @@ public function addPreferenceHash(FilterResponseEvent $event) 3\. Add `Vary` in your custom controller or content view controller: -```php {skip-validation} +```php $response->setVary('X-User-Preference-Hash'); // If you _also_ need to vary on [[= product_name =]] permissions, instead use: diff --git a/docs/infrastructure_and_maintenance/cache/http_cache/reverse_proxy.md b/docs/infrastructure_and_maintenance/cache/http_cache/reverse_proxy.md index c7b7862f3c..3cb48b9002 100644 --- a/docs/infrastructure_and_maintenance/cache/http_cache/reverse_proxy.md +++ b/docs/infrastructure_and_maintenance/cache/http_cache/reverse_proxy.md @@ -90,7 +90,7 @@ framework: On Upsun, Varnish doesn't have a static IP, like with [AWS LB]([[= symfony_doc =]]/deployment/proxies.html#but-what-if-the-ip-of-my-reverse-proxy-changes-constantly). For this reason, the `TRUSTED_PROXIES` env variable supports being set to value `REMOTE_ADDR`, which is equal to: - ```php {skip-validation} + ```php Request::setTrustedProxies([$request->server->get('REMOTE_ADDR')], Request::HEADER_X_FORWARDED_ALL); ``` diff --git a/docs/infrastructure_and_maintenance/cache/persistence_cache.md b/docs/infrastructure_and_maintenance/cache/persistence_cache.md index a6e397d792..4b34d52a2d 100644 --- a/docs/infrastructure_and_maintenance/cache/persistence_cache.md +++ b/docs/infrastructure_and_maintenance/cache/persistence_cache.md @@ -248,7 +248,7 @@ This service is an instance of `Symfony\Component\Cache\Adapter\TagAwareAdapterI Like any other service, you can also get the cache service with the [service container](php_api.md#service-container) like so: -``` php {skip-validation} +``` php // Getting the cache service in PHP /** @var \Symfony\Component\Cache\Adapter\TagAwareAdapterInterface */ @@ -259,7 +259,7 @@ $pool = $container->get('ibexa.cache_pool'); Example usage of the cache service: -``` php {skip-validation} +``` php // Example $cacheItem = $pool->getItem("myApp-object-${id}"); if ($cacheItem->isHit()) { @@ -280,7 +280,7 @@ For more info on usage, see [Symfony Cache's documentation]([[= symfony_doc =]]/ Persistence cache prefixes it's cache using "ibx-". Clearing persistence cache can thus be done in the following ways: -``` php {skip-validation} +``` php // To clear all cache (not recommended without a good reason) $pool->clear(); diff --git a/docs/multisite/languages/automated_translations.md b/docs/multisite/languages/automated_translations.md index c41279d9ab..5bd9ee10d8 100644 --- a/docs/multisite/languages/automated_translations.md +++ b/docs/multisite/languages/automated_translations.md @@ -34,7 +34,7 @@ composer require ibexa/automated-translation Symfony Flex installs and activates the package. However, you must modify the `config/bundles.php` file to change the bundle loading order so that `IbexaAutomatedTranslationBundle` is loaded before `IbexaAdminUiBundle`: - ```php {skip-validation} + ```php ['all' => true], ``` diff --git a/docs/permissions/custom_policies.md b/docs/permissions/custom_policies.md index 16233ba112..27df7b67c5 100644 --- a/docs/permissions/custom_policies.md +++ b/docs/permissions/custom_policies.md @@ -20,7 +20,7 @@ First level key is the module name which is limited to characters within the set Function value is an array of available limitations, identified by the alias declared in `LimitationType` service tag. If no limitation is provided, value can be `null` or an empty array. -``` php {skip-validation} +``` php [ "content" => [ "read" => ["Class", "ParentClass", "Node", "Language"], @@ -38,7 +38,7 @@ Name provided in the hash for each limitation is the same value set in the `alia For example: -``` php {skip-validation} +``` php isGranted( new Attribute('section', 'assign', ['valueObject' => $contentInfo, 'targets' => [$section]]) ); @@ -79,6 +79,6 @@ checks the `content/edit` permission for the provided content item at the provid To block access to a specific action of the controller, add the following to the action's definition: -``` php {skip-validation} +``` php $this->denyAccessUnlessGranted(new Attribute('state', 'administrate')); ``` diff --git a/docs/personalization/enable_personalization.md b/docs/personalization/enable_personalization.md index 63e35cb6f0..7d3d2b4f17 100644 --- a/docs/personalization/enable_personalization.md +++ b/docs/personalization/enable_personalization.md @@ -491,7 +491,7 @@ You can retrieve data returned from the Personalization server and modify it bef To modify recommendation data, subscribe to `RecommendationResponseEvent`. See [`Event/Subscriber/RecommendationEventSubscriber.php`](https://github.com/ibexa/personalization-client/blob/main/src/lib/Event/Subscriber/RecommendationEventSubscriber.php) for an example: -``` php {skip-validation} +``` php public static function getSubscribedEvents(): array { return [ diff --git a/docs/personalization/integrate_recommendation_service.md b/docs/personalization/integrate_recommendation_service.md index 4b6e224bfe..a2049f526c 100644 --- a/docs/personalization/integrate_recommendation_service.md +++ b/docs/personalization/integrate_recommendation_service.md @@ -34,7 +34,7 @@ The following examples show how you can integrate a CLICK event: PHP: -``` php {skip-validation} +``` php $mandator_id = '00000'; $content_type_id = '1'; $product_id = '123'; @@ -57,7 +57,7 @@ ycimg.src=url; A similar tracking image can be placed on a confirmation page that ends the payment process. -``` php {skip-validation} +``` php $server = '//event.perso.ibexa.co'; foreach ($just_bought_products as $product_id) { $tracking = $server.'/api/'.$mandator_id.'/buy/'.urlencode(user_id()).$content_type_id.$product_id; @@ -122,7 +122,7 @@ A response with two recommendations resembles the following object: You can use the following code to make requests and parse results: -``` php {skip-validation} +``` php $mandator_id = '00000'; $license_key = '67890-1234-5678-90123-4567'; $server = "https://reco.perso.ibexa.co"; diff --git a/docs/product_catalog/create_custom_name_schema_strategy.md b/docs/product_catalog/create_custom_name_schema_strategy.md index 4c5bffa5ef..3b03f3b54c 100644 --- a/docs/product_catalog/create_custom_name_schema_strategy.md +++ b/docs/product_catalog/create_custom_name_schema_strategy.md @@ -25,4 +25,4 @@ Next, you need to register the strategy in the dependency injection container: [[= include_file('code_samples/catalog/percent_name_schema_strategy/src/bundle/Resources/config/services/name_schema.yaml') =]] ``` -This ensures that the custom name schema strategy is available for use in generating URL aliases based on attribute values. +This ensures that the custom name schema strategy is available for use in generating URL aliases based on attribute values. \ No newline at end of file diff --git a/docs/release_notes/ez_platform_v2.4.md b/docs/release_notes/ez_platform_v2.4.md index 515ee1488c..16d92cbdb2 100644 --- a/docs/release_notes/ez_platform_v2.4.md +++ b/docs/release_notes/ez_platform_v2.4.md @@ -182,7 +182,7 @@ The biggest benefit of this feature is saving load time on complex landing pages 1\. Register `LexikJWTAuthenticationBundle` bundle in `/app/AppKernel.php` - ``` php {skip-validation} + ``` php public function registerBundles() { $bundles = array( diff --git a/docs/release_notes/ez_platform_v3.0_deprecations.md b/docs/release_notes/ez_platform_v3.0_deprecations.md index bd5c636842..a53c0491b1 100644 --- a/docs/release_notes/ez_platform_v3.0_deprecations.md +++ b/docs/release_notes/ez_platform_v3.0_deprecations.md @@ -772,7 +772,7 @@ All classes and interfaces from `eZ\Publish\Core\Persistence\Database` and `eZ\P The signature of the `\eZ\Publish\Core\Persistence\Legacy\URL\Query\CriterionHandler::handle` contract now accepts `\Doctrine\DBAL\Query\QueryBuilder` instead of `\eZ\Publish\Core\Persistence\Database\SelectQuery` and has the following form: -``` php {skip-validation} +``` php use \Doctrine\DBAL\Query\QueryBuilder; use \eZ\Publish\Core\Persistence\Legacy\URL\Query\CriteriaConverter; use \eZ\Publish\API\Repository\Values\URL\Query\Criterion; diff --git a/docs/release_notes/ibexa_dxp_v4.6.md b/docs/release_notes/ibexa_dxp_v4.6.md index f810689a2b..46c05487bc 100644 --- a/docs/release_notes/ibexa_dxp_v4.6.md +++ b/docs/release_notes/ibexa_dxp_v4.6.md @@ -1640,7 +1640,7 @@ Endpoints that allow you to manage prices in your platform with REST API: A signature for the `\Ibexa\Contracts\Rest\Output\Generator::startValueElement` method has been updated to the following: -```php {skip-validation} +```php /** * @phpstan-param scalar $value * @phpstan-param array $attributes diff --git a/docs/resources/contributing/package_structure.md b/docs/resources/contributing/package_structure.md index 74129c8c77..05330652da 100644 --- a/docs/resources/contributing/package_structure.md +++ b/docs/resources/contributing/package_structure.md @@ -17,17 +17,17 @@ The following conventions apply to contributions to [[= product_name_base =]] co Define [[= product_name =]] core PHP code in a namespace with the following prefix: -```php {skip-validation} +```php namespace Ibexa; ``` A package which groups some DXP features can use an additional prefix, for example: -```php {skip-validation} +```php namespace Ibexa\Commerce; ``` -```php {skip-validation} +```php namespace Ibexa\Personalization; ``` @@ -55,11 +55,11 @@ The `src/lib` directory and its corresponding `Ibexa\` namespace ar Examples: -```php {skip-validation} +```php namespace Ibexa\Search; ``` -```php {skip-validation} +```php namespace Ibexa\Commerce\Shop; ``` @@ -67,7 +67,7 @@ namespace Ibexa\Commerce\Shop; The bundle class definition in the `src/bundle` directory must be: -```php {skip-validation} +```php namespace Ibexa\Bundle\; class Ibexa[ProductGroup]Bundle // ... @@ -76,13 +76,13 @@ class Ibexa[ProductGroup]Bundle // ... Examples: -```php {skip-validation} +```php namespace Ibexa\Bundle\Search; class IbexaSearchBundle // ... ``` -```php {skip-validation} +```php namespace Ibexa\Bundle\Commerce\Shop; class IbexaCommerceShopBundle // ... @@ -92,21 +92,21 @@ class IbexaCommerceShopBundle // ... A package may introduce a namespace for contracts, to be consumed by first and third party packages and projects, which must be prefixed as: -```php {skip-validation} +```php namespace Ibexa\Contracts; ``` Examples: -```php {skip-validation} +```php namespace Ibexa\Contracts\Kernel; ``` -```php {skip-validation} +```php namespace Ibexa\Contracts\SiteFactory; ``` -```php {skip-validation} +```php namespace Ibexa\Contracts\Commerce\Shop; ``` diff --git a/docs/search/activity_log_search_reference/action_criterion.md b/docs/search/activity_log_search_reference/action_criterion.md index a712656f0c..b89e51d6eb 100644 --- a/docs/search/activity_log_search_reference/action_criterion.md +++ b/docs/search/activity_log_search_reference/action_criterion.md @@ -10,7 +10,7 @@ A set of built-in names is available as `ActivityLogServiceInterface`'s `ACTION_ ## Example -```php {skip-validation} +```php $query = new ActivityLog\Query([ new ActivityLog\Criterion\ActionCriterion([ ActivityLog\ActivityLogServiceInterface::ACTION_DELETE, diff --git a/docs/search/activity_log_search_reference/logged_at_criterion.md b/docs/search/activity_log_search_reference/logged_at_criterion.md index 61e5842d6e..b48457b347 100644 --- a/docs/search/activity_log_search_reference/logged_at_criterion.md +++ b/docs/search/activity_log_search_reference/logged_at_criterion.md @@ -20,7 +20,7 @@ The `LoggedAtCriterion` Activity Log Criterion matches activity log group that h The following example is to match all activity log groups that aren't older than a day: -```php {skip-validation} +```php $query = new ActivityLog\Query([ new ActivityLog\Criterion\LoggedAtCriterion(new \DateTime('- 1 day'), ActivityLog\Criterion\LoggedAtCriterion::GTE), ]); diff --git a/docs/search/activity_log_search_reference/object_criterion.md b/docs/search/activity_log_search_reference/object_criterion.md index e9e51d5ee1..7be18ad3c5 100644 --- a/docs/search/activity_log_search_reference/object_criterion.md +++ b/docs/search/activity_log_search_reference/object_criterion.md @@ -9,13 +9,13 @@ The `ObjectCriterion` Activity Log Criterion matches log group with a log entry ## Examples -```php {skip-validation} +```php $query = new ActivityLog\Query([ new ActivityLog\Criterion\ObjectCriterion(Ibexa\Contracts\Core\Repository\Values\Content\Content::class), ]); ``` -```php {skip-validation} +```php $query = new ActivityLog\Query([ new ActivityLog\Criterion\ObjectCriterion(Ibexa\Contracts\ProductCatalog\Values\ProductVariantInterface::class, [123, 234, 345]), ]); diff --git a/docs/search/activity_log_search_reference/object_name_criterion.md b/docs/search/activity_log_search_reference/object_name_criterion.md index 45509f2d09..48ad0b1248 100644 --- a/docs/search/activity_log_search_reference/object_name_criterion.md +++ b/docs/search/activity_log_search_reference/object_name_criterion.md @@ -13,7 +13,7 @@ The `ObjectNameCriterion` Activity Log Criterion matches log groups that have a ## Example -```php {skip-validation} +```php $query = new ActivityLog\Query([ new ActivityLog\Criterion\ObjectNameCriterion('Ibexa', ActivityLog\Criterion\ObjectNameCriterion::OPERATOR_CONTAINS), ]); diff --git a/docs/search/activity_log_search_reference/user_criterion.md b/docs/search/activity_log_search_reference/user_criterion.md index bee5fcac2c..def4663f95 100644 --- a/docs/search/activity_log_search_reference/user_criterion.md +++ b/docs/search/activity_log_search_reference/user_criterion.md @@ -8,7 +8,7 @@ The `UserCriterion` Activity Log Criterion matches log groups that have an activ ## Example -```php {skip-validation} +```php $query = new ActivityLog\Query([ new ActivityLog\Criterion\UserCriterion([10, 14]), ]); diff --git a/docs/search/aggregation_reference/authorterm_aggregation.md b/docs/search/aggregation_reference/authorterm_aggregation.md index 1138222c8a..80d155c488 100644 --- a/docs/search/aggregation_reference/authorterm_aggregation.md +++ b/docs/search/aggregation_reference/authorterm_aggregation.md @@ -12,7 +12,7 @@ The field-based [AuthorTermAggregation](/api/php_api/php_api_reference/classes/I ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->aggregations[] = new Aggregation\Field\AuthorTermAggregation('author', 'article', 'authors'); ``` diff --git a/docs/search/aggregation_reference/basepricestats_aggregation.md b/docs/search/aggregation_reference/basepricestats_aggregation.md index dad3c7b041..74f3bd6a77 100644 --- a/docs/search/aggregation_reference/basepricestats_aggregation.md +++ b/docs/search/aggregation_reference/basepricestats_aggregation.md @@ -20,9 +20,9 @@ You can use the provided getters to access the values: ## Example -``` php {skip-validation} +``` php $query = new ProductQuery(); $query->setAggregations([ new BasePriceStatsAggregation('base_price_stats_aggregation', $currency), ]); -``` +``` \ No newline at end of file diff --git a/docs/search/aggregation_reference/checkboxterm_aggregation.md b/docs/search/aggregation_reference/checkboxterm_aggregation.md index 60cb472320..7a595366ff 100644 --- a/docs/search/aggregation_reference/checkboxterm_aggregation.md +++ b/docs/search/aggregation_reference/checkboxterm_aggregation.md @@ -12,7 +12,7 @@ The field-based [CheckboxTermAggregation](/api/php_api/php_api_reference/classes ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->aggregations[] = new Aggregation\Field\CheckboxTermAggregation('checkbox', 'article', 'enable_comments'); ``` diff --git a/docs/search/aggregation_reference/contenttypegroupterm_aggregation.md b/docs/search/aggregation_reference/contenttypegroupterm_aggregation.md index 1b1b1f7fa7..1d42dced95 100644 --- a/docs/search/aggregation_reference/contenttypegroupterm_aggregation.md +++ b/docs/search/aggregation_reference/contenttypegroupterm_aggregation.md @@ -12,7 +12,7 @@ The [ContentTypeGroupTermAggregation](/api/php_api/php_api_reference/classes/Ibe ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->aggregations[] = new Aggregation\ContentTypeGroupTermAggregation('content_type_group'); ``` diff --git a/docs/search/aggregation_reference/contenttypeterm_aggregation.md b/docs/search/aggregation_reference/contenttypeterm_aggregation.md index fb5ec8f136..1d3d242f26 100644 --- a/docs/search/aggregation_reference/contenttypeterm_aggregation.md +++ b/docs/search/aggregation_reference/contenttypeterm_aggregation.md @@ -12,7 +12,7 @@ The [ContentTypeTermAggregation](/api/php_api/php_api_reference/classes/Ibexa-Co ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->aggregations[] = new Aggregation\ContentTypeTermAggregation('content_type'); ``` diff --git a/docs/search/aggregation_reference/countryterm_aggregation.md b/docs/search/aggregation_reference/countryterm_aggregation.md index 7de2d0d4dd..6bc909190e 100644 --- a/docs/search/aggregation_reference/countryterm_aggregation.md +++ b/docs/search/aggregation_reference/countryterm_aggregation.md @@ -12,7 +12,7 @@ The field-based [CountryTermAggregation](/api/php_api/php_api_reference/classes/ ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->aggregations[] = new Aggregation\Field\CountryTermAggregation('country', 'article', 'country'); ``` diff --git a/docs/search/aggregation_reference/custompricestats_aggregation.md b/docs/search/aggregation_reference/custompricestats_aggregation.md index e7f105fdc8..08413b7888 100644 --- a/docs/search/aggregation_reference/custompricestats_aggregation.md +++ b/docs/search/aggregation_reference/custompricestats_aggregation.md @@ -20,9 +20,9 @@ The CustomPriceStatsAggregation aggregates search results by the value of the cu ## Example -``` php {skip-validation} +``` php $query = new ProductQuery(); $query->setAggregations([ new CustomPriceStatsAggregation('custom_price_stats_aggregation', $currency, $customerGroup), ]); -``` +``` \ No newline at end of file diff --git a/docs/search/aggregation_reference/datemetadatarange_aggregation.md b/docs/search/aggregation_reference/datemetadatarange_aggregation.md index bdf6cbc372..fbd1e431fb 100644 --- a/docs/search/aggregation_reference/datemetadatarange_aggregation.md +++ b/docs/search/aggregation_reference/datemetadatarange_aggregation.md @@ -14,7 +14,7 @@ The [DateMetadataRangeAggregation](/api/php_api/php_api_reference/classes/Ibexa- ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->aggregations[] = new Aggregation\DateMetadataRangeAggregation('date_metadata', Aggregation\DateMetadataRangeAggregation::PUBLISHED, [ diff --git a/docs/search/aggregation_reference/daterange_aggregation.md b/docs/search/aggregation_reference/daterange_aggregation.md index eabaa756ae..518cc39b77 100644 --- a/docs/search/aggregation_reference/daterange_aggregation.md +++ b/docs/search/aggregation_reference/daterange_aggregation.md @@ -13,7 +13,7 @@ The field-based [DateRangeAggregation](/api/php_api/php_api_reference/classes/Ib ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->aggregations[] = new Aggregation\Field\DateRangeAggregation('date', 'event', 'event_date', [ diff --git a/docs/search/aggregation_reference/datetimerange_aggregation.md b/docs/search/aggregation_reference/datetimerange_aggregation.md index 2fb47c8bda..84b6c7fe62 100644 --- a/docs/search/aggregation_reference/datetimerange_aggregation.md +++ b/docs/search/aggregation_reference/datetimerange_aggregation.md @@ -13,7 +13,7 @@ The field-based [DateTimeRangeAggregation](/api/php_api/php_api_reference/classe ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->aggregations[] = new Aggregation\Field\DateTimeRangeAggregation('date', 'event', 'event_date', [ diff --git a/docs/search/aggregation_reference/floatrange_aggregation.md b/docs/search/aggregation_reference/floatrange_aggregation.md index 5ce89d6b82..d94c1dedc9 100644 --- a/docs/search/aggregation_reference/floatrange_aggregation.md +++ b/docs/search/aggregation_reference/floatrange_aggregation.md @@ -13,7 +13,7 @@ The field-based [FloatRangeAggregation](/api/php_api/php_api_reference/classes/I ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->aggregations[] = new Aggregation\Field\FloatRangeAggregation('float', 'product', 'weight', [ diff --git a/docs/search/aggregation_reference/floatstats_aggregation.md b/docs/search/aggregation_reference/floatstats_aggregation.md index 5758e3e1e0..5d2be9bb13 100644 --- a/docs/search/aggregation_reference/floatstats_aggregation.md +++ b/docs/search/aggregation_reference/floatstats_aggregation.md @@ -19,7 +19,7 @@ You can use the provided getters to access the values: ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->aggregations[] = new Aggregation\Field\FloatStatsAggregation('float', 'product', 'weight'); ``` diff --git a/docs/search/aggregation_reference/integerrange_aggregation.md b/docs/search/aggregation_reference/integerrange_aggregation.md index fa123c0640..37c51b76a6 100644 --- a/docs/search/aggregation_reference/integerrange_aggregation.md +++ b/docs/search/aggregation_reference/integerrange_aggregation.md @@ -13,7 +13,7 @@ The field-based [IntegerRangeAggregation](/api/php_api/php_api_reference/classes ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->aggregations[] = new Aggregation\Field\IntegerRangeAggregation('integer', 'product', 'amount', [ diff --git a/docs/search/aggregation_reference/integerstats_aggregation.md b/docs/search/aggregation_reference/integerstats_aggregation.md index 26b74564c3..13d65dcd3a 100644 --- a/docs/search/aggregation_reference/integerstats_aggregation.md +++ b/docs/search/aggregation_reference/integerstats_aggregation.md @@ -18,7 +18,7 @@ The field-based [IntegerStatsAggregation](/api/php_api/php_api_reference/classes ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->aggregations[] = new Aggregation\Field\IntegerStatsAggregation('integer', 'product', 'amount'); ``` diff --git a/docs/search/aggregation_reference/keywordterm_aggregation.md b/docs/search/aggregation_reference/keywordterm_aggregation.md index c234473a5b..e0eff92f43 100644 --- a/docs/search/aggregation_reference/keywordterm_aggregation.md +++ b/docs/search/aggregation_reference/keywordterm_aggregation.md @@ -12,7 +12,7 @@ The field-based [KeywordTermAggregation](/api/php_api/php_api_reference/classes/ ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->aggregations[] = new Aggregation\Field\KeywordTermAggregation('keyword', 'article', 'tags'); ``` diff --git a/docs/search/aggregation_reference/languageterm_aggregation.md b/docs/search/aggregation_reference/languageterm_aggregation.md index 3b2d179c75..6f5e6bd09f 100644 --- a/docs/search/aggregation_reference/languageterm_aggregation.md +++ b/docs/search/aggregation_reference/languageterm_aggregation.md @@ -12,7 +12,7 @@ The [LanguageTermAggregation](/api/php_api/php_api_reference/classes/Ibexa-Contr ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->aggregations[] = new Aggregation\LanguageTermAggregation('language'); ``` diff --git a/docs/search/aggregation_reference/locationchildrenterm_aggregation.md b/docs/search/aggregation_reference/locationchildrenterm_aggregation.md index 30fd2b0d30..b530e83ab2 100644 --- a/docs/search/aggregation_reference/locationchildrenterm_aggregation.md +++ b/docs/search/aggregation_reference/locationchildrenterm_aggregation.md @@ -12,7 +12,7 @@ The [LocationChildrenTermAggregation](/api/php_api/php_api_reference/classes/Ibe ## Example -``` php {skip-validation} +``` php $query = new LocationQuery(); $query->aggregations[] = new Aggregation\Location\LocationChildrenTermAggregation('location_children'); ``` diff --git a/docs/search/aggregation_reference/objectstateterm_aggregation.md b/docs/search/aggregation_reference/objectstateterm_aggregation.md index 704a836fa2..099df6822c 100644 --- a/docs/search/aggregation_reference/objectstateterm_aggregation.md +++ b/docs/search/aggregation_reference/objectstateterm_aggregation.md @@ -13,7 +13,7 @@ The [ObjectStateTermAggregation](/api/php_api/php_api_reference/classes/Ibexa-Co ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->aggregations[] = new Aggregation\Location\ObjectStateTermAggregation('object_state', 'ibexa_lock'); ``` diff --git a/docs/search/aggregation_reference/product_attribute_aggregations.md b/docs/search/aggregation_reference/product_attribute_aggregations.md index 3f74ae0164..d6a533713e 100644 --- a/docs/search/aggregation_reference/product_attribute_aggregations.md +++ b/docs/search/aggregation_reference/product_attribute_aggregations.md @@ -27,14 +27,14 @@ Range aggregations (`ProductAttributeFloatRangeAggregation` and `ProductAttribut ## Example -``` php {skip-validation} +``` php $query = new ProductQuery(); $query->setAggregations([ new ProductAttributeSelectionAggregation('skin', 'skin_type'), ]); ``` -``` php {skip-validation} +``` php $query = new ProductQuery(); $query->setAggregations([ new ProductAttributeIntegerRangeAggregation('buttons', 'number_of_buttons', [ diff --git a/docs/search/aggregation_reference/productavailabilityterm_aggregation.md b/docs/search/aggregation_reference/productavailabilityterm_aggregation.md index ed5dd88e75..45058d73d6 100644 --- a/docs/search/aggregation_reference/productavailabilityterm_aggregation.md +++ b/docs/search/aggregation_reference/productavailabilityterm_aggregation.md @@ -12,7 +12,7 @@ The ProductAvailabilityTermAggregation aggregates search results by product avai ## Example -``` php {skip-validation} +``` php $query = new ProductQuery(); $query->setAggregations([ new ProductAvailabilityTermAggregation('product_availability'), diff --git a/docs/search/aggregation_reference/productpricerange_aggregation.md b/docs/search/aggregation_reference/productpricerange_aggregation.md index a4485df168..aa6774888c 100644 --- a/docs/search/aggregation_reference/productpricerange_aggregation.md +++ b/docs/search/aggregation_reference/productpricerange_aggregation.md @@ -14,7 +14,7 @@ The ProductPriceRangeAggregation aggregates search results by the value of the p ## Example -``` php {skip-validation} +``` php $query = new ProductQuery(); $query->setAggregations([ new ProductPriceRangeAggregation('price', 'PLN', [ diff --git a/docs/search/aggregation_reference/productstockrange_aggregation.md b/docs/search/aggregation_reference/productstockrange_aggregation.md index 3c69e053a9..0b29292bc6 100644 --- a/docs/search/aggregation_reference/productstockrange_aggregation.md +++ b/docs/search/aggregation_reference/productstockrange_aggregation.md @@ -13,7 +13,7 @@ The ProductStockRangeAggregation aggregates search results by products' numerica ## Example -``` php {skip-validation} +``` php $productQuery = new ProductQuery(); $productQuery->setAggregations([ new ProductStockRangeAggregation('stock', [ diff --git a/docs/search/aggregation_reference/producttypeterm_aggregation.md b/docs/search/aggregation_reference/producttypeterm_aggregation.md index 9b76fd95e6..aac92ab6d7 100644 --- a/docs/search/aggregation_reference/producttypeterm_aggregation.md +++ b/docs/search/aggregation_reference/producttypeterm_aggregation.md @@ -12,7 +12,7 @@ The ProductTypeTermAggregation aggregates search results by the product type. ## Example -``` php {skip-validation} +``` php $query = new ProductQuery(); $query->setAggregations([ new ProductTypeTermAggregation('product_type'), diff --git a/docs/search/aggregation_reference/rawrange_aggregation.md b/docs/search/aggregation_reference/rawrange_aggregation.md index 6098725266..98b7f9c156 100644 --- a/docs/search/aggregation_reference/rawrange_aggregation.md +++ b/docs/search/aggregation_reference/rawrange_aggregation.md @@ -21,7 +21,7 @@ The [RawRangeAggregation](/api/php_api/php_api_reference/classes/Ibexa-Contracts ## Example -``` php {skip-validation} +``` php $query = new LocationQuery(); $query->aggregations[] = new Aggregation\RawRangeAggregation('priority', 'priority_id', [ new Query\Aggregation\Range(1, 10), diff --git a/docs/search/aggregation_reference/rawstats_aggregation.md b/docs/search/aggregation_reference/rawstats_aggregation.md index 6114073421..fd8b51e0d9 100644 --- a/docs/search/aggregation_reference/rawstats_aggregation.md +++ b/docs/search/aggregation_reference/rawstats_aggregation.md @@ -27,7 +27,7 @@ You can use the provided getters to access the values: ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->aggregations[] = new Aggregation\RawStatsAggregation('location_depth', 'depth_i'); ``` diff --git a/docs/search/aggregation_reference/rawterm_aggregation.md b/docs/search/aggregation_reference/rawterm_aggregation.md index 96116e09f8..94d629b520 100644 --- a/docs/search/aggregation_reference/rawterm_aggregation.md +++ b/docs/search/aggregation_reference/rawterm_aggregation.md @@ -20,7 +20,7 @@ The [RawTermAggregation](/api/php_api/php_api_reference/classes/Ibexa-Contracts- ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->aggregations[] = new Aggregation\RawTermAggregation('content_per_content_type', 'content_type_id_id'); ``` diff --git a/docs/search/aggregation_reference/sectionterm_aggregation.md b/docs/search/aggregation_reference/sectionterm_aggregation.md index f8b7d0b42d..51980b5f76 100644 --- a/docs/search/aggregation_reference/sectionterm_aggregation.md +++ b/docs/search/aggregation_reference/sectionterm_aggregation.md @@ -12,7 +12,7 @@ The [SectionTermAggregation](/api/php_api/php_api_reference/classes/Ibexa-Contra ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->aggregations[] = new Aggregation\SectionTermAggregation('section'); ``` diff --git a/docs/search/aggregation_reference/selectionterm_aggregation.md b/docs/search/aggregation_reference/selectionterm_aggregation.md index 0cc1eb4bed..d6b468f228 100644 --- a/docs/search/aggregation_reference/selectionterm_aggregation.md +++ b/docs/search/aggregation_reference/selectionterm_aggregation.md @@ -12,7 +12,7 @@ The field-based [SelectionTermAggregation](/api/php_api/php_api_reference/classe ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->aggregations[] = new Aggregation\Field\SelectionTermAggregation('selection', 'article', 'select'); ``` diff --git a/docs/search/aggregation_reference/subtreeterm_aggregation.md b/docs/search/aggregation_reference/subtreeterm_aggregation.md index 883fe95aa5..780140492b 100644 --- a/docs/search/aggregation_reference/subtreeterm_aggregation.md +++ b/docs/search/aggregation_reference/subtreeterm_aggregation.md @@ -13,7 +13,7 @@ The [SubtreeTermAggregation](/api/php_api/php_api_reference/classes/Ibexa-Contra ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->aggregations[] = new Aggregation\Location\SubtreeTermAggregation('pathstring', '/1/2/'); ``` diff --git a/docs/search/aggregation_reference/taxonomyentryid_aggregation.md b/docs/search/aggregation_reference/taxonomyentryid_aggregation.md index 4f15846e06..cff1e2b455 100644 --- a/docs/search/aggregation_reference/taxonomyentryid_aggregation.md +++ b/docs/search/aggregation_reference/taxonomyentryid_aggregation.md @@ -13,12 +13,12 @@ The `TaxonomyEntryIdAggregation` aggregates search results by the content item's ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->aggregations[] = new Aggregation\TaxonomyEntryIdAggregation('taxonomy', 'tags'); ``` -``` php {skip-validation} +``` php $query = new ProductQuery(); $query->aggregations[] = new Aggregation\TaxonomyEntryIdAggregation('categories', 'product_categories'); ``` diff --git a/docs/search/aggregation_reference/timerange_aggregation.md b/docs/search/aggregation_reference/timerange_aggregation.md index 3a1e0c7f01..c38920833b 100644 --- a/docs/search/aggregation_reference/timerange_aggregation.md +++ b/docs/search/aggregation_reference/timerange_aggregation.md @@ -13,7 +13,7 @@ The field-based [TimeRangeAggregation](/api/php_api/php_api_reference/classes/Ib ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->aggregations[] = new Aggregation\Field\TimeRangeAggregation('date', 'event', 'event_time', [ diff --git a/docs/search/aggregation_reference/usermetadataterm_aggregation.md b/docs/search/aggregation_reference/usermetadataterm_aggregation.md index 6d53d8c5ee..275e2742e1 100644 --- a/docs/search/aggregation_reference/usermetadataterm_aggregation.md +++ b/docs/search/aggregation_reference/usermetadataterm_aggregation.md @@ -12,7 +12,7 @@ The [UserMetadataTermAggregation](/api/php_api/php_api_reference/classes/Ibexa-C ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->aggregations[] = new Aggregation\UserMetadataTermAggregation('user_metadata'); ``` diff --git a/docs/search/aggregation_reference/visibilityterm_aggregation.md b/docs/search/aggregation_reference/visibilityterm_aggregation.md index 4581031227..780fa57d48 100644 --- a/docs/search/aggregation_reference/visibilityterm_aggregation.md +++ b/docs/search/aggregation_reference/visibilityterm_aggregation.md @@ -12,7 +12,7 @@ The [VisibilityTermAggregation](/api/php_api/php_api_reference/classes/Ibexa-Con ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->aggregations[] = new Aggregation\VisibilityTermAggregation('visibility'); ``` diff --git a/docs/search/criteria_reference/ancestor_criterion.md b/docs/search/criteria_reference/ancestor_criterion.md index d8d6854443..d0853413a0 100644 --- a/docs/search/criteria_reference/ancestor_criterion.md +++ b/docs/search/criteria_reference/ancestor_criterion.md @@ -14,7 +14,7 @@ The [`Ancestor` Search Criterion](/api/php_api/php_api_reference/classes/Ibexa-C ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\Ancestor([$this->locationService->loadLocation(62)->pathString]); ``` @@ -44,7 +44,7 @@ $query->query = new Criterion\Ancestor([$this->locationService->loadLocation(62) You can use the Ancestor Search Criterion to create a list of breadcrumbs leading to the Location: -``` php {skip-validation} hl_lines="2" +``` php hl_lines="2" $query = new LocationQuery(); $query->query = new Criterion\Ancestor([$this->locationService->loadLocation($locationId)->pathString]); diff --git a/docs/search/criteria_reference/baseprice_criterion.md b/docs/search/criteria_reference/baseprice_criterion.md index 61fb0ad678..bbc95e06cc 100644 --- a/docs/search/criteria_reference/baseprice_criterion.md +++ b/docs/search/criteria_reference/baseprice_criterion.md @@ -19,7 +19,7 @@ The `BasePrice` Criterion isn't available in the Legacy Search engine. ### PHP -``` php {skip-validation} +``` php $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\BasePrice( diff --git a/docs/search/criteria_reference/checkboxattribute_criterion.md b/docs/search/criteria_reference/checkboxattribute_criterion.md index 17b2bfdb13..eb72b6a723 100644 --- a/docs/search/criteria_reference/checkboxattribute_criterion.md +++ b/docs/search/criteria_reference/checkboxattribute_criterion.md @@ -15,7 +15,7 @@ The `CheckboxAttribute` Search Criterion searches for products by the value of t ### PHP -``` php {skip-validation} +``` php $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\CheckboxAttribute('automatic', true) diff --git a/docs/search/criteria_reference/colorattribute_criterion.md b/docs/search/criteria_reference/colorattribute_criterion.md index 2975c015d1..e196933a1f 100644 --- a/docs/search/criteria_reference/colorattribute_criterion.md +++ b/docs/search/criteria_reference/colorattribute_criterion.md @@ -15,7 +15,7 @@ The `ColorAttribute` Search Criterion searches for products by the value of thei ### PHP -``` php {skip-validation} +``` php $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ColorAttribute('color', ['#FF0000']) @@ -50,4 +50,4 @@ $query = new ProductQuery( } } } - ``` + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/contentid_criterion.md b/docs/search/criteria_reference/contentid_criterion.md index 10fba74e46..c468ad0fed 100644 --- a/docs/search/criteria_reference/contentid_criterion.md +++ b/docs/search/criteria_reference/contentid_criterion.md @@ -14,7 +14,7 @@ The [`ContentId` Search Criterion](/api/php_api/php_api_reference/classes/Ibexa- ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\ContentId([62, 64]); ``` diff --git a/docs/search/criteria_reference/contentname_criterion.md b/docs/search/criteria_reference/contentname_criterion.md index 1a733444f8..0c57bf7023 100644 --- a/docs/search/criteria_reference/contentname_criterion.md +++ b/docs/search/criteria_reference/contentname_criterion.md @@ -14,7 +14,7 @@ The [`ContentName` Search Criterion](https://github.com/ibexa/core/blob/5.0/src/ ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\ContentName('*phone'); ``` diff --git a/docs/search/criteria_reference/contenttypegroupid_criterion.md b/docs/search/criteria_reference/contenttypegroupid_criterion.md index 62534ef5bc..e8395aac51 100644 --- a/docs/search/criteria_reference/contenttypegroupid_criterion.md +++ b/docs/search/criteria_reference/contenttypegroupid_criterion.md @@ -14,7 +14,7 @@ The [`ContentTypeGroupId` Search Criterion](/api/php_api/php_api_reference/class ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\ContentTypeGroupId([1, 2]); ``` @@ -45,7 +45,7 @@ $query->query = new Criterion\ContentTypeGroupId([1, 2]); You can use the `ContentTypeGroupId` Criterion to query all Media content items (the default ID for the Media content type group is 3): -``` php {skip-validation} hl_lines="1" +``` php hl_lines="1" $query->query = new Criterion\ContentTypeGroupId([3]); $results = $this->searchService->findContent($query); diff --git a/docs/search/criteria_reference/contenttypeid_criterion.md b/docs/search/criteria_reference/contenttypeid_criterion.md index 5b1ce1775e..2c8301358d 100644 --- a/docs/search/criteria_reference/contenttypeid_criterion.md +++ b/docs/search/criteria_reference/contenttypeid_criterion.md @@ -14,7 +14,7 @@ The [`ContentTypeId` Search Criterion](/api/php_api/php_api_reference/classes/Ib ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\ContentTypeId([44]); ``` diff --git a/docs/search/criteria_reference/contenttypeidentifier_criterion.md b/docs/search/criteria_reference/contenttypeidentifier_criterion.md index 1fdbb2021b..8cb8995a9e 100644 --- a/docs/search/criteria_reference/contenttypeidentifier_criterion.md +++ b/docs/search/criteria_reference/contenttypeidentifier_criterion.md @@ -14,7 +14,7 @@ The [`ContentTypeIdentifier` Search Criterion](/api/php_api/php_api_reference/cl ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\ContentTypeIdentifier(['article', 'blog_post']); ``` diff --git a/docs/search/criteria_reference/createdat_criterion.md b/docs/search/criteria_reference/createdat_criterion.md index 1de26d3916..06ae3046b0 100644 --- a/docs/search/criteria_reference/createdat_criterion.md +++ b/docs/search/criteria_reference/createdat_criterion.md @@ -15,7 +15,7 @@ The `CreatedAt` Search Criterion searches for products based on the date when th ### PHP -``` php {skip-validation} +``` php $criteria = new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\CreatedAt( new DateTime('2023-03-01'), \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\Operator::GTE, @@ -52,4 +52,4 @@ $productQuery = new ProductQuery(null, $criteria); } } } - ``` + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/createdatrange_criterion.md b/docs/search/criteria_reference/createdatrange_criterion.md index b1bc9f2e4c..fe6de80520 100644 --- a/docs/search/criteria_reference/createdatrange_criterion.md +++ b/docs/search/criteria_reference/createdatrange_criterion.md @@ -15,7 +15,7 @@ The `CreatedAtRange` Search Criterion searches for products based on the date ra ### PHP -``` php {skip-validation} +``` php $criteria = new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\CreatedAtRange( new \DateTimeImmutable('2020-07-10T00:00:00+00:00'), new \DateTimeImmutable('2023-07-12T00:00:00+00:00') @@ -52,4 +52,4 @@ $productQuery = new ProductQuery(null, $criteria); } } } - ``` + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/currencycode_criterion.md b/docs/search/criteria_reference/currencycode_criterion.md index 5603f3421e..c98073e693 100644 --- a/docs/search/criteria_reference/currencycode_criterion.md +++ b/docs/search/criteria_reference/currencycode_criterion.md @@ -18,6 +18,6 @@ The `CurrencyCodeCriterion` Criterion isn't available in Solr or Elasticsearch e ### PHP -``` php {skip-validation} +``` php $query->query = new \Ibexa\Contracts\ProductCatalog\Values\Currency\Query\Criterion\CurrencyCodeCriterion('EUR'); ``` diff --git a/docs/search/criteria_reference/customergroupid_criterion.md b/docs/search/criteria_reference/customergroupid_criterion.md index 691e11f906..4a27b612c6 100644 --- a/docs/search/criteria_reference/customergroupid_criterion.md +++ b/docs/search/criteria_reference/customergroupid_criterion.md @@ -14,6 +14,6 @@ The `CustomerGroupId` Search Criterion searches for content based on the ID of i ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\CustomerGroupId(1); ``` diff --git a/docs/search/criteria_reference/customprice_criterion.md b/docs/search/criteria_reference/customprice_criterion.md index 598edb614e..b4752cf374 100644 --- a/docs/search/criteria_reference/customprice_criterion.md +++ b/docs/search/criteria_reference/customprice_criterion.md @@ -21,7 +21,7 @@ The `CustomPrice` Criterion isn't available in the Legacy Search engine. ### PHP -``` php {skip-validation} +``` php $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\CustomPrice( diff --git a/docs/search/criteria_reference/datemetadata_criterion.md b/docs/search/criteria_reference/datemetadata_criterion.md index 587ab4342b..3c94a49b8a 100644 --- a/docs/search/criteria_reference/datemetadata_criterion.md +++ b/docs/search/criteria_reference/datemetadata_criterion.md @@ -16,7 +16,7 @@ The [`DateMetadata` Search Criterion](/api/php_api/php_api_reference/classes/Ibe ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\DateMetadata( Criterion\DateMetadata::CREATED, Criterion\Operator::BETWEEN, @@ -58,7 +58,7 @@ $query->query = new Criterion\DateMetadata( You can use the `DateMetadata` Criterion to search for blog posts that have been created within the last week: -``` php {skip-validation} hl_lines="5" +``` php hl_lines="5" $query = new LocationQuery; $date = strtotime("-1 week"); $query->query = new Criterion\LogicalAnd([ diff --git a/docs/search/criteria_reference/depth_criterion.md b/docs/search/criteria_reference/depth_criterion.md index b27eed048e..1389da5b42 100644 --- a/docs/search/criteria_reference/depth_criterion.md +++ b/docs/search/criteria_reference/depth_criterion.md @@ -23,6 +23,6 @@ The `value` argument requires: ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\Location\Depth(Criterion\Operator::LT, 3); ``` diff --git a/docs/search/criteria_reference/field_criterion.md b/docs/search/criteria_reference/field_criterion.md index 6e4d7ff79f..e07057ebe3 100644 --- a/docs/search/criteria_reference/field_criterion.md +++ b/docs/search/criteria_reference/field_criterion.md @@ -25,7 +25,7 @@ The `Field` Criterion isn't available in [Repository filtering](search_api.md#re ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\Field('name', Criterion\Operator::CONTAINS, 'Platform'); ``` @@ -65,7 +65,7 @@ $query->query = new Criterion\Field('name', Criterion\Operator::CONTAINS, 'Platf You can use the `Field` Criterion to search for articles that contain the word "featured": -``` php {skip-validation} hl_lines="4" +``` php hl_lines="4" $query = new LocationQuery(); $query->query = new Criterion\LogicalAnd([ new Criterion\ContentTypeIdentifier('article'), diff --git a/docs/search/criteria_reference/fieldrelation_criterion.md b/docs/search/criteria_reference/fieldrelation_criterion.md index 6baeeac174..cf2103597f 100644 --- a/docs/search/criteria_reference/fieldrelation_criterion.md +++ b/docs/search/criteria_reference/fieldrelation_criterion.md @@ -22,6 +22,6 @@ The `FieldRelation` Criterion isn't available in [Repository filtering](search_a ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\FieldRelation('relations', Criterion\Operator::CONTAINS, [55, 63]); ``` diff --git a/docs/search/criteria_reference/floatattribute_criterion.md b/docs/search/criteria_reference/floatattribute_criterion.md index 7183c5e32d..37883cc172 100644 --- a/docs/search/criteria_reference/floatattribute_criterion.md +++ b/docs/search/criteria_reference/floatattribute_criterion.md @@ -15,7 +15,7 @@ The `FloatAttribute` Search Criterion searches for products by the value of thei ### PHP -``` php {skip-validation} +``` php $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\FloatAttribute( @@ -53,4 +53,4 @@ $query = new ProductQuery( } } } - ``` + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/fulltext_criterion.md b/docs/search/criteria_reference/fulltext_criterion.md index 8ea75b14c5..001d62c947 100644 --- a/docs/search/criteria_reference/fulltext_criterion.md +++ b/docs/search/criteria_reference/fulltext_criterion.md @@ -39,19 +39,19 @@ The `FullText` Criterion isn't available in [Repository filtering](search_api.md ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\FullText('victory'); ``` Using double quotes to indicate a phrase: -``` php {skip-validation} +``` php $query->query = new Criterion\FullText('"world cup"'); ``` Using the AND operator and parenthesis to search for both words at the same time: -``` php {skip-validation} +``` php $query->query = new Criterion\FullText('baseball AND cup'); ``` @@ -81,7 +81,7 @@ $query->query = new Criterion\FullText('baseball AND cup'); Assume the following search query: -``` php {skip-validation} +``` php $query->query = new Criterion\FullText('(cup AND ba*ball) "breaking news"'); ``` diff --git a/docs/search/criteria_reference/image_criterion.md b/docs/search/criteria_reference/image_criterion.md index 53f6827f03..2df2a0a3f7 100644 --- a/docs/search/criteria_reference/image_criterion.md +++ b/docs/search/criteria_reference/image_criterion.md @@ -15,7 +15,7 @@ The `Image` Search Criterion searches for image by specified image attributes. ### PHP -``` php {skip-validation} +``` php $imageCriteriaData = [ 'mimeTypes' => [ 'image/png', diff --git a/docs/search/criteria_reference/imagedimensions_criterion.md b/docs/search/criteria_reference/imagedimensions_criterion.md index 62974e5ac5..4281fe6fb3 100644 --- a/docs/search/criteria_reference/imagedimensions_criterion.md +++ b/docs/search/criteria_reference/imagedimensions_criterion.md @@ -15,7 +15,7 @@ The `Dimensions` Search Criterion searches for image with specified dimensions. ### PHP -``` php {skip-validation} +``` php $imageCriteriaData = [ 'width' => [ 'min' => 100, // (default: 0, optional) diff --git a/docs/search/criteria_reference/imagefilesize_criterion.md b/docs/search/criteria_reference/imagefilesize_criterion.md index 81181e8b28..04b85a8024 100644 --- a/docs/search/criteria_reference/imagefilesize_criterion.md +++ b/docs/search/criteria_reference/imagefilesize_criterion.md @@ -16,7 +16,7 @@ The `FileSize` Search Criterion searches for image with specified size. ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\FileSize('image', 0, 1.5); ``` diff --git a/docs/search/criteria_reference/imageheight_criterion.md b/docs/search/criteria_reference/imageheight_criterion.md index 4fa68b755d..5f1ff96c79 100644 --- a/docs/search/criteria_reference/imageheight_criterion.md +++ b/docs/search/criteria_reference/imageheight_criterion.md @@ -16,6 +16,6 @@ The `Height` Search Criterion searches for image with specified height. ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\Height('image', 0, 1500); ``` diff --git a/docs/search/criteria_reference/imagemimetype_criterion.md b/docs/search/criteria_reference/imagemimetype_criterion.md index 986e423f98..f494232d6c 100644 --- a/docs/search/criteria_reference/imagemimetype_criterion.md +++ b/docs/search/criteria_reference/imagemimetype_criterion.md @@ -15,13 +15,13 @@ The `MimeType` Search Criterion searches for image with specified mime type(s). ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\MimeType('image', 'image/jpeg'); ``` or -```php {skip-validation} +```php $mimeTypes = [ 'image/jpeg', 'image/png', diff --git a/docs/search/criteria_reference/imageorientation_criterion.md b/docs/search/criteria_reference/imageorientation_criterion.md index 21b7b629e2..1829d957a0 100644 --- a/docs/search/criteria_reference/imageorientation_criterion.md +++ b/docs/search/criteria_reference/imageorientation_criterion.md @@ -16,7 +16,7 @@ Supported orientation values: landscape, portrait and square. ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\Orientation('image', 'landscape'); OR diff --git a/docs/search/criteria_reference/imagewidth_criterion.md b/docs/search/criteria_reference/imagewidth_criterion.md index 370ba04f23..34ec3293c7 100644 --- a/docs/search/criteria_reference/imagewidth_criterion.md +++ b/docs/search/criteria_reference/imagewidth_criterion.md @@ -16,6 +16,6 @@ The `Width` Search Criterion searches for image with specified width. ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\Width('image', 150, 1000); ``` diff --git a/docs/search/criteria_reference/integerattribute_criterion.md b/docs/search/criteria_reference/integerattribute_criterion.md index f09007a5e1..bb71bed820 100644 --- a/docs/search/criteria_reference/integerattribute_criterion.md +++ b/docs/search/criteria_reference/integerattribute_criterion.md @@ -15,7 +15,7 @@ The `IntegerAttribute` Search Criterion searches for products by the value of th ### PHP -``` php {skip-validation} +``` php $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\IntegerAttribute( @@ -53,4 +53,4 @@ $query = new ProductQuery( } } } - ``` + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/iscontainer_criterion.md b/docs/search/criteria_reference/iscontainer_criterion.md index 45465d3966..b30f2d6313 100644 --- a/docs/search/criteria_reference/iscontainer_criterion.md +++ b/docs/search/criteria_reference/iscontainer_criterion.md @@ -15,7 +15,7 @@ The [`IsContainer` Search Criterion](/api/php_api/php_api_reference/classes/Ibex ### PHP -```php {skip-validation} +```php $query->query = new Criterion\IsContainer(); // Finds containers $query->query = new Criterion\IsContainer(false); // Finds non-containers ``` diff --git a/docs/search/criteria_reference/iscurrencyenabled_criterion.md b/docs/search/criteria_reference/iscurrencyenabled_criterion.md index 2c719d78b2..1985d5f8e2 100644 --- a/docs/search/criteria_reference/iscurrencyenabled_criterion.md +++ b/docs/search/criteria_reference/iscurrencyenabled_criterion.md @@ -19,6 +19,6 @@ The `IsCurrencyEnabledCriterion` Criterion isn't available in Solr or Elasticsea ### PHP -``` php {skip-validation} +``` php $query->query = new \Ibexa\Contracts\ProductCatalog\Values\Currency\Query\Criterion\IsCurrencyEnabledCriterion(); ``` diff --git a/docs/search/criteria_reference/isfieldempty_criterion.md b/docs/search/criteria_reference/isfieldempty_criterion.md index 17203ebc4a..f8598b0397 100644 --- a/docs/search/criteria_reference/isfieldempty_criterion.md +++ b/docs/search/criteria_reference/isfieldempty_criterion.md @@ -25,7 +25,7 @@ For this use case, use [`TaxonomyNoEntries`](taxonomy_no_entries.md) instead. ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\IsFieldEmpty('title'); ``` @@ -33,7 +33,7 @@ $query->query = new Criterion\IsFieldEmpty('title'); You can use the `IsFieldEmpty` Criterion to search for articles that don't have an image: -``` php {skip-validation} hl_lines="4" +``` php hl_lines="4" $query = new LocationQuery; $query->query = new Criterion\LogicalAnd([ new Criterion\ContentTypeIdentifier('article'), diff --git a/docs/search/criteria_reference/ismainlocation_criterion.md b/docs/search/criteria_reference/ismainlocation_criterion.md index 44720017d9..8b0172d691 100644 --- a/docs/search/criteria_reference/ismainlocation_criterion.md +++ b/docs/search/criteria_reference/ismainlocation_criterion.md @@ -17,6 +17,6 @@ representing whether to search for a main or not main location ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\Location\IsMainLocation(IsMainLocation::MAIN); ``` diff --git a/docs/search/criteria_reference/isproductbased_criterion.md b/docs/search/criteria_reference/isproductbased_criterion.md index 4b473009f1..077682c18f 100644 --- a/docs/search/criteria_reference/isproductbased_criterion.md +++ b/docs/search/criteria_reference/isproductbased_criterion.md @@ -10,6 +10,6 @@ The `IsProductBased` Search Criterion searches for content that plays the role o ### PHP -``` php {skip-validation} +``` php $query->query = new Ibexa\Contracts\ProductCatalog\Values\Content\Query\Criterion\IsProductBased(); ``` diff --git a/docs/search/criteria_reference/isuserbased_criterion.md b/docs/search/criteria_reference/isuserbased_criterion.md index ef98a9722a..c3302d0db0 100644 --- a/docs/search/criteria_reference/isuserbased_criterion.md +++ b/docs/search/criteria_reference/isuserbased_criterion.md @@ -24,7 +24,7 @@ The `IsUserBased` Criterion isn't available in Solr or Elasticsearch engines. ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\IsUserBased(); ``` diff --git a/docs/search/criteria_reference/isuserenabled_criterion.md b/docs/search/criteria_reference/isuserenabled_criterion.md index d3e47d448e..d95e3b29ad 100644 --- a/docs/search/criteria_reference/isuserenabled_criterion.md +++ b/docs/search/criteria_reference/isuserenabled_criterion.md @@ -15,7 +15,7 @@ The [`IsUserEnabled` Search Criterion](/api/php_api/php_api_reference/classes/Ib ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\IsUserEnabled(); ``` diff --git a/docs/search/criteria_reference/isvirtual_criterion.md b/docs/search/criteria_reference/isvirtual_criterion.md index d4196c8359..26be439adb 100644 --- a/docs/search/criteria_reference/isvirtual_criterion.md +++ b/docs/search/criteria_reference/isvirtual_criterion.md @@ -14,7 +14,7 @@ The `IsVirtual` Search Criterion searches for virtual or physical products. ### PHP -``` php {skip-validation} +``` php $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\IsVirtual(true) @@ -41,4 +41,4 @@ $query = new ProductQuery( "IsVirtualCriterion": true } } - ``` + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/languagecode_criterion.md b/docs/search/criteria_reference/languagecode_criterion.md index fd44222e9d..b4a977db2f 100644 --- a/docs/search/criteria_reference/languagecode_criterion.md +++ b/docs/search/criteria_reference/languagecode_criterion.md @@ -15,7 +15,7 @@ The [`LanguageCode` Search Criterion](/api/php_api/php_api_reference/classes/Ibe ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\LanguageCode('ger-DE', false); ``` @@ -46,7 +46,7 @@ $query->query = new Criterion\LanguageCode('ger-DE', false); You can use the `LanguageCode` Criterion to search for articles that are lacking a translation into a specific language: -``` php {skip-validation} hl_lines="5" +``` php hl_lines="5" $query = new LocationQuery; $query->query = new Criterion\LogicalAnd([ new Criterion\ContentTypeIdentifier('article'), diff --git a/docs/search/criteria_reference/locationid_criterion.md b/docs/search/criteria_reference/locationid_criterion.md index 560000ca2e..63169e9c71 100644 --- a/docs/search/criteria_reference/locationid_criterion.md +++ b/docs/search/criteria_reference/locationid_criterion.md @@ -14,7 +14,7 @@ The [`LocationId` Search Criterion](/api/php_api/php_api_reference/classes/Ibexa ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\LocationId(62); ``` diff --git a/docs/search/criteria_reference/locationremoteid_criterion.md b/docs/search/criteria_reference/locationremoteid_criterion.md index ae90f2d70e..d79bfd1aec 100644 --- a/docs/search/criteria_reference/locationremoteid_criterion.md +++ b/docs/search/criteria_reference/locationremoteid_criterion.md @@ -14,7 +14,7 @@ The [`LocationRemoteId` Search Criterion](/api/php_api/php_api_reference/classes ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\LocationRemoteId(['4d1e5f216c0a7aaab7f005ffd4b6a8a8', 'b81ef3e62b514188bfddd2a80d447d34']); ``` diff --git a/docs/search/criteria_reference/logicaland_criterion.md b/docs/search/criteria_reference/logicaland_criterion.md index f7daa124cc..b4afdf3276 100644 --- a/docs/search/criteria_reference/logicaland_criterion.md +++ b/docs/search/criteria_reference/logicaland_criterion.md @@ -16,7 +16,7 @@ When querying for [products](product_api.md), use [LogicalAnd](/api/php_api/php_ ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\LogicalAnd([ new Criterion\ContentTypeIdentifier('article'), new Criterion\SectionIdentifier(['sports', 'news']); diff --git a/docs/search/criteria_reference/logicalnot_criterion.md b/docs/search/criteria_reference/logicalnot_criterion.md index c4994fc9a8..444c2702fb 100644 --- a/docs/search/criteria_reference/logicalnot_criterion.md +++ b/docs/search/criteria_reference/logicalnot_criterion.md @@ -14,7 +14,7 @@ It takes only one Criterion in the array parameter. ## Example -``` php {skip-validation} +``` php $query->filter = new Criterion\LogicalNot( new Criterion\ContentTypeIdentifier($contentTypeId) ); diff --git a/docs/search/criteria_reference/logicalor_criterion.md b/docs/search/criteria_reference/logicalor_criterion.md index bf5b6f1618..657f9c94ec 100644 --- a/docs/search/criteria_reference/logicalor_criterion.md +++ b/docs/search/criteria_reference/logicalor_criterion.md @@ -16,7 +16,7 @@ When querying for [products](product_api.md), use [LogicalOr](/api/php_api/php_a ### PHP -``` php {skip-validation} +``` php $query->filter = new Criterion\LogicalOr([ new Criterion\ContentTypeIdentifier('article'), new Criterion\SectionIdentifier(['sports', 'news']); diff --git a/docs/search/criteria_reference/maplocationdistance_criterion.md b/docs/search/criteria_reference/maplocationdistance_criterion.md index 02fa95d74b..6592008687 100644 --- a/docs/search/criteria_reference/maplocationdistance_criterion.md +++ b/docs/search/criteria_reference/maplocationdistance_criterion.md @@ -27,6 +27,6 @@ The `MapLocationDistance` Criterion isn't available in [Repository filtering](se ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\MapLocationDistance('location', Criterion\Operator::LTE, 5, 51.395973, 22.531696); ``` diff --git a/docs/search/criteria_reference/objectstateid_criterion.md b/docs/search/criteria_reference/objectstateid_criterion.md index 3c92bdfbfb..f080cbaae9 100644 --- a/docs/search/criteria_reference/objectstateid_criterion.md +++ b/docs/search/criteria_reference/objectstateid_criterion.md @@ -14,7 +14,7 @@ The [`ObjectStateId` Search Criterion](/api/php_api/php_api_reference/classes/Ib ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\ObjectStateId([4, 5]); ``` diff --git a/docs/search/criteria_reference/objectstateidentifier_criterion.md b/docs/search/criteria_reference/objectstateidentifier_criterion.md index 6ebc1ca222..75e7153828 100644 --- a/docs/search/criteria_reference/objectstateidentifier_criterion.md +++ b/docs/search/criteria_reference/objectstateidentifier_criterion.md @@ -15,11 +15,11 @@ The [`ObjectStateIdentifier` Search Criterion](/api/php_api/php_api_reference/cl ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\ObjectStateIdentifier(['ready']); ``` -``` php {skip-validation} +``` php $query->query = new Criterion\ObjectStateIdentifier(['not_locked'], 'ibexa_lock'); ``` diff --git a/docs/search/criteria_reference/order_company_associated_criterion.md b/docs/search/criteria_reference/order_company_associated_criterion.md index 627899956e..ee55c07a30 100644 --- a/docs/search/criteria_reference/order_company_associated_criterion.md +++ b/docs/search/criteria_reference/order_company_associated_criterion.md @@ -15,7 +15,7 @@ The `IsCompanyAssociatedCriterion` Search Criterion searches for orders based on ### PHP -``` php {skip-validation} +``` php $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\IsCompanyAssociatedCriterion(true) ); diff --git a/docs/search/criteria_reference/order_company_name_criterion.md b/docs/search/criteria_reference/order_company_name_criterion.md index bbfa413877..1f65ad8494 100644 --- a/docs/search/criteria_reference/order_company_name_criterion.md +++ b/docs/search/criteria_reference/order_company_name_criterion.md @@ -15,7 +15,7 @@ The `CompanyNameCriterion` Search Criterion searches for orders based on the nam ### PHP -``` php {skip-validation} +``` php $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\CompanyNameCriterion('IBM') ); diff --git a/docs/search/criteria_reference/order_created_criterion.md b/docs/search/criteria_reference/order_created_criterion.md index 16527e9af6..aa59007fff 100644 --- a/docs/search/criteria_reference/order_created_criterion.md +++ b/docs/search/criteria_reference/order_created_criterion.md @@ -16,7 +16,7 @@ The `CreatedAtCriterion` Search Criterion searches for orders based on the date ### PHP -``` php {skip-validation} +``` php $criteria = new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\CreatedAtCriterion( new DateTime('2023-03-01'), 'GTE' diff --git a/docs/search/criteria_reference/order_currency_code_criterion.md b/docs/search/criteria_reference/order_currency_code_criterion.md index 975391d2c0..9348a743a3 100644 --- a/docs/search/criteria_reference/order_currency_code_criterion.md +++ b/docs/search/criteria_reference/order_currency_code_criterion.md @@ -15,7 +15,7 @@ The `CurrencyCodeCriterion` Search Criterion searches for orders based on the cu ### PHP -``` php {skip-validation} +``` php $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\CurrencyCodeCriterion('USD') ); diff --git a/docs/search/criteria_reference/order_customer_name_criterion.md b/docs/search/criteria_reference/order_customer_name_criterion.md index a41df8b6a3..80b0fc08d5 100644 --- a/docs/search/criteria_reference/order_customer_name_criterion.md +++ b/docs/search/criteria_reference/order_customer_name_criterion.md @@ -15,7 +15,7 @@ The `CustomerNameCriterion` Search Criterion searches for orders based on the na ### PHP -``` php {skip-validation} +``` php $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\CustomerNameCriterion('john') ); diff --git a/docs/search/criteria_reference/order_identifier_criterion.md b/docs/search/criteria_reference/order_identifier_criterion.md index 6cfabd4c19..4da72e5ab1 100644 --- a/docs/search/criteria_reference/order_identifier_criterion.md +++ b/docs/search/criteria_reference/order_identifier_criterion.md @@ -15,7 +15,7 @@ The `IdentifierCriterion` Search Criterion searches for orders based on the orde ### PHP -``` php {skip-validation} +``` php $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\IdentifierCriterion('f7578972-e7f4-4cae-85dc-a7c74610204e') ); diff --git a/docs/search/criteria_reference/order_owner_criterion.md b/docs/search/criteria_reference/order_owner_criterion.md index 6564175354..320071b135 100644 --- a/docs/search/criteria_reference/order_owner_criterion.md +++ b/docs/search/criteria_reference/order_owner_criterion.md @@ -13,7 +13,7 @@ The `OwnerCriterion` Criterion searches for orders based on the user reference. ## Example -``` php {skip-validation} +``` php $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\OwnerCriterion( \Ibexa\Contracts\Core\Repository\Values\User\UserReference(14) @@ -23,7 +23,7 @@ $query = new OrderQuery( `OwnerCriterion` Criterion accepts also multiple values: -``` php {skip-validation} +``` php $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\OwnerCriterion( [ @@ -32,4 +32,4 @@ $query = new OrderQuery( ] ) ); -``` +``` \ No newline at end of file diff --git a/docs/search/criteria_reference/order_price_criterion.md b/docs/search/criteria_reference/order_price_criterion.md index 04ce900d0f..745ca2a126 100644 --- a/docs/search/criteria_reference/order_price_criterion.md +++ b/docs/search/criteria_reference/order_price_criterion.md @@ -16,7 +16,7 @@ The `PriceCriterion` searches for orders by their total net value. ### PHP -``` php {skip-validation} +``` php $criteria = new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\PriceCriterion( 12900, 'GTE' diff --git a/docs/search/criteria_reference/order_source_criterion.md b/docs/search/criteria_reference/order_source_criterion.md index c89668b86a..53abd3a519 100644 --- a/docs/search/criteria_reference/order_source_criterion.md +++ b/docs/search/criteria_reference/order_source_criterion.md @@ -15,7 +15,7 @@ The `SourceCriterion` Search Criterion searches for orders based on the source o ### PHP -``` php {skip-validation} +``` php $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\SourceCriterion('local_shop') ); diff --git a/docs/search/criteria_reference/order_status_criterion.md b/docs/search/criteria_reference/order_status_criterion.md index 599714ea2b..e6f3f5cb48 100644 --- a/docs/search/criteria_reference/order_status_criterion.md +++ b/docs/search/criteria_reference/order_status_criterion.md @@ -15,7 +15,7 @@ The `StatusCriterion` Search Criterion searches for orders based on order status ### PHP -``` php {skip-validation} +``` php $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\StatusCriterion('pending') ); diff --git a/docs/search/criteria_reference/parentlocationid_criterion.md b/docs/search/criteria_reference/parentlocationid_criterion.md index ebc087a61f..e30307eeb0 100644 --- a/docs/search/criteria_reference/parentlocationid_criterion.md +++ b/docs/search/criteria_reference/parentlocationid_criterion.md @@ -15,7 +15,7 @@ searches for content based on the Location ID of its parent. ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\ParentLocationId([54, 58]); ``` @@ -45,7 +45,7 @@ $query->query = new Criterion\ParentLocationId([54, 58]); You can use the `ParentLocationId` Search Criterion to list blog posts contained in a blog: -``` php {skip-validation} hl_lines="4" +``` php hl_lines="4" $query = new LocationQuery(); $query->query = new Criterion\LogicalAnd([ new Criterion\Visibility(Criterion\Visibility::VISIBLE), diff --git a/docs/search/criteria_reference/payment_createdat_criterion.md b/docs/search/criteria_reference/payment_createdat_criterion.md index 471fa53f19..d43536e7e1 100644 --- a/docs/search/criteria_reference/payment_createdat_criterion.md +++ b/docs/search/criteria_reference/payment_createdat_criterion.md @@ -16,7 +16,7 @@ The `CreatedAt` Search Criterion searches for payments based on the date when th ### PHP -``` php {skip-validation} +``` php $criteria = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\CreatedAt( new DateTime('2023-03-01') ); diff --git a/docs/search/criteria_reference/payment_currency_criterion.md b/docs/search/criteria_reference/payment_currency_criterion.md index 660d75a820..524561faed 100644 --- a/docs/search/criteria_reference/payment_currency_criterion.md +++ b/docs/search/criteria_reference/payment_currency_criterion.md @@ -15,6 +15,6 @@ The `Currency` Search Criterion searches for payments based on the currency code ### PHP -``` php {skip-validation} +``` php $query->query = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\Currency('EUR'); ``` diff --git a/docs/search/criteria_reference/payment_id_criterion.md b/docs/search/criteria_reference/payment_id_criterion.md index 3a20865a5f..3ccd16044d 100644 --- a/docs/search/criteria_reference/payment_id_criterion.md +++ b/docs/search/criteria_reference/payment_id_criterion.md @@ -15,6 +15,6 @@ The `Id` Search Criterion searches for payments based on the payment ID. ### PHP -``` php {skip-validation} +``` php $query->query = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\Id(2); ``` diff --git a/docs/search/criteria_reference/payment_identifier_criterion.md b/docs/search/criteria_reference/payment_identifier_criterion.md index c6ab868bbe..0f6ca32dfc 100644 --- a/docs/search/criteria_reference/payment_identifier_criterion.md +++ b/docs/search/criteria_reference/payment_identifier_criterion.md @@ -15,6 +15,6 @@ The `Identifier` Search Criterion searches for payments based on the payment ide ### PHP -``` php {skip-validation} +``` php $query->query = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\Identifier('f7578972-e7f4-4cae-85dc-a7c74610204e'); ``` diff --git a/docs/search/criteria_reference/payment_logicaland_criterion.md b/docs/search/criteria_reference/payment_logicaland_criterion.md index 4837471673..fc51f0ab28 100644 --- a/docs/search/criteria_reference/payment_logicaland_criterion.md +++ b/docs/search/criteria_reference/payment_logicaland_criterion.md @@ -15,7 +15,7 @@ The `LogicalAnd` Search Criterion matches payments if all provided Criteria matc ### PHP -``` php {skip-validation} +``` php $query->query = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\LogicalAnd( [ new \Ibexa\Contracts\Payment\Payment\Query\Criterion\CreatedAt(new DateTime('2023-03-01')); diff --git a/docs/search/criteria_reference/payment_logicalor_criterion.md b/docs/search/criteria_reference/payment_logicalor_criterion.md index d6741d59e9..0ab036ebc9 100644 --- a/docs/search/criteria_reference/payment_logicalor_criterion.md +++ b/docs/search/criteria_reference/payment_logicalor_criterion.md @@ -15,7 +15,7 @@ The `LogicalOr` Search Criterion matches payments if at least one of the provide ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\LogicalOr( [ new \Ibexa\Contracts\Payment\Payment\Query\Criterion\CreatedAt(new DateTime('2023-03-01')); diff --git a/docs/search/criteria_reference/payment_method_createdat_criterion.md b/docs/search/criteria_reference/payment_method_createdat_criterion.md index 962fd80a69..eac4ce8ab2 100644 --- a/docs/search/criteria_reference/payment_method_createdat_criterion.md +++ b/docs/search/criteria_reference/payment_method_createdat_criterion.md @@ -16,7 +16,7 @@ The `CreatedAt` Search Criterion searches for payment methods based on the date ### PHP -``` php {skip-validation} +``` php $criteria = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\CreatedAt( new DateTime('2023-03-01') ); diff --git a/docs/search/criteria_reference/payment_method_enabled_criterion.md b/docs/search/criteria_reference/payment_method_enabled_criterion.md index 13fd819be0..b9671b987d 100644 --- a/docs/search/criteria_reference/payment_method_enabled_criterion.md +++ b/docs/search/criteria_reference/payment_method_enabled_criterion.md @@ -15,6 +15,6 @@ The `Enabled` Search Criterion searches for payment methods based on whether the ### PHP -``` php {skip-validation} +``` php $query->query = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\Enabled(true); ``` diff --git a/docs/search/criteria_reference/payment_method_id_criterion.md b/docs/search/criteria_reference/payment_method_id_criterion.md index 125fff9e84..c1ca101653 100644 --- a/docs/search/criteria_reference/payment_method_id_criterion.md +++ b/docs/search/criteria_reference/payment_method_id_criterion.md @@ -15,6 +15,6 @@ The `Id` Search Criterion searches for payment methods based on the payment meth ### PHP -``` php {skip-validation} +``` php $query->query = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\Id(2); ``` diff --git a/docs/search/criteria_reference/payment_method_identifier_criterion.md b/docs/search/criteria_reference/payment_method_identifier_criterion.md index d7ca430038..04fdcc21a0 100644 --- a/docs/search/criteria_reference/payment_method_identifier_criterion.md +++ b/docs/search/criteria_reference/payment_method_identifier_criterion.md @@ -15,6 +15,6 @@ The `Identifier` Search Criterion searches for payment methods based on the paym ### PHP -``` php {skip-validation} +``` php $query->query = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\Identifier('f7578972-e7f4-4cae-85dc-a7c74610204e'); ``` diff --git a/docs/search/criteria_reference/payment_method_logicaland_criterion.md b/docs/search/criteria_reference/payment_method_logicaland_criterion.md index 21cefb09c7..b903040e18 100644 --- a/docs/search/criteria_reference/payment_method_logicaland_criterion.md +++ b/docs/search/criteria_reference/payment_method_logicaland_criterion.md @@ -15,7 +15,7 @@ The `LogicalAnd` Search Criterion matches payment methods if all provided Criter ### PHP -``` php {skip-validation} +``` php $query->query = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\LogicalAnd( [ new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\CreatedAt(new DateTime('2023-03-01')); diff --git a/docs/search/criteria_reference/payment_method_logicalor_criterion.md b/docs/search/criteria_reference/payment_method_logicalor_criterion.md index fd0b552617..92b0992efe 100644 --- a/docs/search/criteria_reference/payment_method_logicalor_criterion.md +++ b/docs/search/criteria_reference/payment_method_logicalor_criterion.md @@ -15,7 +15,7 @@ The `LogicalOr` Search Criterion matches payment methods if at least one of the ### PHP -``` php {skip-validation} +``` php $query->query = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\LogicalOr( [ new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\CreatedAt(new DateTime('2023-03-01')); diff --git a/docs/search/criteria_reference/payment_method_name_criterion.md b/docs/search/criteria_reference/payment_method_name_criterion.md index b33841160d..0131233c5c 100644 --- a/docs/search/criteria_reference/payment_method_name_criterion.md +++ b/docs/search/criteria_reference/payment_method_name_criterion.md @@ -15,6 +15,6 @@ The `Name` Search Criterion searches for payment methods based on the existing p ### PHP -``` php {skip-validation} +``` php $query->query = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\Name('Credit Card'); ``` diff --git a/docs/search/criteria_reference/payment_method_type_criterion.md b/docs/search/criteria_reference/payment_method_type_criterion.md index 5ee8b3a213..db7e4be3c9 100644 --- a/docs/search/criteria_reference/payment_method_type_criterion.md +++ b/docs/search/criteria_reference/payment_method_type_criterion.md @@ -15,6 +15,6 @@ The `Type` Search Criterion searches for payment methods based on payment method ### PHP -``` php {skip-validation} +``` php $query->query = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\Type('offline'); ``` diff --git a/docs/search/criteria_reference/payment_method_updatedat_criterion.md b/docs/search/criteria_reference/payment_method_updatedat_criterion.md index 81ef435f76..be34b4d8d6 100644 --- a/docs/search/criteria_reference/payment_method_updatedat_criterion.md +++ b/docs/search/criteria_reference/payment_method_updatedat_criterion.md @@ -16,7 +16,7 @@ The `UpdatedAt` Search Criterion searches for payment methods based on the date ### PHP -``` php {skip-validation} +``` php $criteria = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\UpdatedAt( new DateTime('2023-03-01') ); diff --git a/docs/search/criteria_reference/payment_order_criterion.md b/docs/search/criteria_reference/payment_order_criterion.md index aefa9c57d6..05b8eacc1a 100644 --- a/docs/search/criteria_reference/payment_order_criterion.md +++ b/docs/search/criteria_reference/payment_order_criterion.md @@ -15,6 +15,6 @@ The `Order` Search Criterion searches for payments based on an ID of an associat ### PHP -``` php {skip-validation} +``` php $query->query = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\Order(4); ``` diff --git a/docs/search/criteria_reference/payment_payment_method_criterion.md b/docs/search/criteria_reference/payment_payment_method_criterion.md index 1fad034912..1b9bba10b2 100644 --- a/docs/search/criteria_reference/payment_payment_method_criterion.md +++ b/docs/search/criteria_reference/payment_payment_method_criterion.md @@ -15,6 +15,6 @@ The `PaymentMethod` Search Criterion searches for payments based on a payment me ### PHP -``` php {skip-validation} +``` php $query->query = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\PaymentMethod(2); ``` diff --git a/docs/search/criteria_reference/payment_status_criterion.md b/docs/search/criteria_reference/payment_status_criterion.md index 0ab64e5ce6..c0a037e994 100644 --- a/docs/search/criteria_reference/payment_status_criterion.md +++ b/docs/search/criteria_reference/payment_status_criterion.md @@ -15,6 +15,6 @@ The `Status` Search Criterion searches for payments based on payment status. ### PHP -``` php {skip-validation} +``` php $query->query = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\Status('failed'); ``` diff --git a/docs/search/criteria_reference/payment_updatedat_criterion.md b/docs/search/criteria_reference/payment_updatedat_criterion.md index d0cd7c3d7f..ec947465a8 100644 --- a/docs/search/criteria_reference/payment_updatedat_criterion.md +++ b/docs/search/criteria_reference/payment_updatedat_criterion.md @@ -16,7 +16,7 @@ The `UpdatedAt` Search Criterion searches for payments based on the date when th ### PHP -``` php {skip-validation} +``` php $criteria = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\UpdatedAt( new DateTime('2023-03-01') ); diff --git a/docs/search/criteria_reference/price_currency_criterion.md b/docs/search/criteria_reference/price_currency_criterion.md index 2356d305a9..8d3dd0a10b 100644 --- a/docs/search/criteria_reference/price_currency_criterion.md +++ b/docs/search/criteria_reference/price_currency_criterion.md @@ -14,7 +14,7 @@ The `Currency` Search Criterion searches for prices based on the given currency. ### PHP -``` php {skip-validation} +``` php $currency = $priceService->getPriceById('EUR'); $query = new PriceQuery( diff --git a/docs/search/criteria_reference/price_customergroup_criterion.md b/docs/search/criteria_reference/price_customergroup_criterion.md index bf8a3c3789..a23aa07446 100644 --- a/docs/search/criteria_reference/price_customergroup_criterion.md +++ b/docs/search/criteria_reference/price_customergroup_criterion.md @@ -14,7 +14,7 @@ The `CustomerGroup` Search Criterion searches for prices based on the customer g ### PHP -``` php {skip-validation} +``` php $customerGroup = $customerGroupService->getCustomerGroup(123); $query = new PriceQuery( diff --git a/docs/search/criteria_reference/price_isbaseprice_criterion.md b/docs/search/criteria_reference/price_isbaseprice_criterion.md index 272f60d292..28e8cd2478 100644 --- a/docs/search/criteria_reference/price_isbaseprice_criterion.md +++ b/docs/search/criteria_reference/price_isbaseprice_criterion.md @@ -18,8 +18,8 @@ The `IsBasePrice` Criterion isn't available in Solr or Elasticsearch engines. ### PHP -``` php {skip-validation} +``` php $query = new PriceQuery( new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\IsBasePrice() ); -``` +``` \ No newline at end of file diff --git a/docs/search/criteria_reference/price_iscustomprice_criterion.md b/docs/search/criteria_reference/price_iscustomprice_criterion.md index dbb94ae171..9793e76b44 100644 --- a/docs/search/criteria_reference/price_iscustomprice_criterion.md +++ b/docs/search/criteria_reference/price_iscustomprice_criterion.md @@ -18,8 +18,8 @@ The `IsCustomPrice` Criterion isn't available in Solr or Elasticsearch engines. ### PHP -``` php {skip-validation} +``` php $query = new PriceQuery( new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\IsCustomPrice() ); -``` +``` \ No newline at end of file diff --git a/docs/search/criteria_reference/price_logicaland_criterion.md b/docs/search/criteria_reference/price_logicaland_criterion.md index 82e50969d6..ee9ab7c48b 100644 --- a/docs/search/criteria_reference/price_logicaland_criterion.md +++ b/docs/search/criteria_reference/price_logicaland_criterion.md @@ -15,7 +15,7 @@ The `LogicalAnd` Search Criterion matches prices if all provided Criteria match. ### PHP -``` php {skip-validation} +``` php $query->query = new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\LogicalAnd( [ new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\Currency('USD'), diff --git a/docs/search/criteria_reference/price_logicalor_criterion.md b/docs/search/criteria_reference/price_logicalor_criterion.md index b6d2fbe681..d3e93a6dc9 100644 --- a/docs/search/criteria_reference/price_logicalor_criterion.md +++ b/docs/search/criteria_reference/price_logicalor_criterion.md @@ -15,7 +15,7 @@ The `LogicalOr` Search Criterion matches prices if at least one of the provided ### PHP -``` php {skip-validation} +``` php $query->query = new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\LogicalOr( [ new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\Currency('USD'), diff --git a/docs/search/criteria_reference/price_product_criterion.md b/docs/search/criteria_reference/price_product_criterion.md index 3de359c872..6aaf93a57d 100644 --- a/docs/search/criteria_reference/price_product_criterion.md +++ b/docs/search/criteria_reference/price_product_criterion.md @@ -14,7 +14,7 @@ The `Product` Search Criterion searches for prices based on product codes. ### PHP -``` php {skip-validation} +``` php $query = new PriceQuery( new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\Product('ergo_desk') ); diff --git a/docs/search/criteria_reference/priority_criterion.md b/docs/search/criteria_reference/priority_criterion.md index 96cfc6470f..34975939d0 100644 --- a/docs/search/criteria_reference/priority_criterion.md +++ b/docs/search/criteria_reference/priority_criterion.md @@ -22,6 +22,6 @@ The `value` argument requires: ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\Location\Priority(Criterion\Operator::GTE, 50); ``` diff --git a/docs/search/criteria_reference/productavailability_criterion.md b/docs/search/criteria_reference/productavailability_criterion.md index b21fa77316..21d0455641 100644 --- a/docs/search/criteria_reference/productavailability_criterion.md +++ b/docs/search/criteria_reference/productavailability_criterion.md @@ -14,7 +14,7 @@ The `ProductAvailability` Search Criterion searches for products by their availa ### PHP -``` php {skip-validation} +``` php $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductAvailability(true) @@ -43,4 +43,4 @@ $query = new ProductQuery( } } } - ``` + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/productcategory_criterion.md b/docs/search/criteria_reference/productcategory_criterion.md index cd9aa3ed45..76d5fa0002 100644 --- a/docs/search/criteria_reference/productcategory_criterion.md +++ b/docs/search/criteria_reference/productcategory_criterion.md @@ -14,7 +14,7 @@ The `ProductCategory` Search Criterion searches for products by the category the ### PHP -``` php {skip-validation} +``` php $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductCategory([2, 3]) diff --git a/docs/search/criteria_reference/productcode_criterion.md b/docs/search/criteria_reference/productcode_criterion.md index ae1cc9f203..78655b834d 100644 --- a/docs/search/criteria_reference/productcode_criterion.md +++ b/docs/search/criteria_reference/productcode_criterion.md @@ -14,7 +14,7 @@ The `ProductCode` Search Criterion searches for products by their codes. ### PHP -``` php {skip-validation} +``` php $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductCode(['ergo_desk', 'alter_desk']) @@ -47,4 +47,4 @@ $query = new ProductQuery( } } } - ``` + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/productname_criterion.md b/docs/search/criteria_reference/productname_criterion.md index 602066db8d..b19a270ae8 100644 --- a/docs/search/criteria_reference/productname_criterion.md +++ b/docs/search/criteria_reference/productname_criterion.md @@ -14,7 +14,7 @@ The `ProductName` Search Criterion searches for products by their names. ### PHP -``` php {skip-validation} +``` php $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductName('sofa*') diff --git a/docs/search/criteria_reference/productstock_criterion.md b/docs/search/criteria_reference/productstock_criterion.md index 347cbfe99c..ed88bc178c 100644 --- a/docs/search/criteria_reference/productstock_criterion.md +++ b/docs/search/criteria_reference/productstock_criterion.md @@ -15,14 +15,14 @@ The `ProductStock` Search Criterion searches for products by their numerical sto ### PHP -``` php {skip-validation} +``` php $productQuery = new ProductQuery( null, new Criterion\ProductStock(10) ); ``` -``` php {skip-validation} +``` php $productQuery = new ProductQuery( null, new Criterion\ProductStock(50, '>=') diff --git a/docs/search/criteria_reference/productstockrange_criterion.md b/docs/search/criteria_reference/productstockrange_criterion.md index 284cc9a876..f71c7f5adc 100644 --- a/docs/search/criteria_reference/productstockrange_criterion.md +++ b/docs/search/criteria_reference/productstockrange_criterion.md @@ -15,7 +15,7 @@ The `ProductStockRange` Search Criterion searches for products by their numerica ### PHP -``` php {skip-validation} +``` php $productQuery = new ProductQuery( null, new Criterion\ProductStockRange(10, 120) diff --git a/docs/search/criteria_reference/producttype_criterion.md b/docs/search/criteria_reference/producttype_criterion.md index f95a1f141c..aab290dcc7 100644 --- a/docs/search/criteria_reference/producttype_criterion.md +++ b/docs/search/criteria_reference/producttype_criterion.md @@ -14,7 +14,7 @@ The `ProductType` Search Criterion searches for products by their codes. ### PHP -``` php {skip-validation} +``` php $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductType(['dress']) @@ -43,4 +43,4 @@ $query = new ProductQuery( } } } - ``` + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/rangemeasurementattributemaximum_criterion.md b/docs/search/criteria_reference/rangemeasurementattributemaximum_criterion.md index 450f4b2824..c28be6ffd8 100644 --- a/docs/search/criteria_reference/rangemeasurementattributemaximum_criterion.md +++ b/docs/search/criteria_reference/rangemeasurementattributemaximum_criterion.md @@ -15,7 +15,7 @@ The `RangeMeasurementAttributeMaximum` Search Criterion searches for products by ### PHP -``` php {skip-validation} +``` php $value = $this->measurementService->buildSimpleValue('length', 150, 'centimeter'); $query = new ProductQuery( diff --git a/docs/search/criteria_reference/rangemeasurementattributeminimum_criterion.md b/docs/search/criteria_reference/rangemeasurementattributeminimum_criterion.md index ee599d3c8c..fb5d54dbad 100644 --- a/docs/search/criteria_reference/rangemeasurementattributeminimum_criterion.md +++ b/docs/search/criteria_reference/rangemeasurementattributeminimum_criterion.md @@ -15,7 +15,7 @@ The `RangeMeasurementAttributeMinimum` Search Criterion searches for products by ### PHP -``` php {skip-validation} +``` php $value = $this->measurementService->buildSimpleValue('length', 100, 'centimeter'); $query = new ProductQuery( diff --git a/docs/search/criteria_reference/remoteid_criterion.md b/docs/search/criteria_reference/remoteid_criterion.md index 5aa4b17d79..6677715cda 100644 --- a/docs/search/criteria_reference/remoteid_criterion.md +++ b/docs/search/criteria_reference/remoteid_criterion.md @@ -15,7 +15,7 @@ searches for content based on its remote content ID. ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\RemoteId('abab615dcf26699a4291657152da4337'); ``` diff --git a/docs/search/criteria_reference/sectionid_criterion.md b/docs/search/criteria_reference/sectionid_criterion.md index 95821a03d0..cfdc257ccb 100644 --- a/docs/search/criteria_reference/sectionid_criterion.md +++ b/docs/search/criteria_reference/sectionid_criterion.md @@ -14,7 +14,7 @@ The [`SectionId` Search Criterion](/api/php_api/php_api_reference/classes/Ibexa- ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\SectionId(3); ``` diff --git a/docs/search/criteria_reference/sectionidentifier_criterion.md b/docs/search/criteria_reference/sectionidentifier_criterion.md index 8e96f04718..dea856b606 100644 --- a/docs/search/criteria_reference/sectionidentifier_criterion.md +++ b/docs/search/criteria_reference/sectionidentifier_criterion.md @@ -14,7 +14,7 @@ The [`SectionIdentifier` Search Criterion](/api/php_api/php_api_reference/classe ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\SectionIdentifier(['sports', 'news']); ``` diff --git a/docs/search/criteria_reference/selectionattribute_criterion.md b/docs/search/criteria_reference/selectionattribute_criterion.md index b003d16c89..f8eeeed167 100644 --- a/docs/search/criteria_reference/selectionattribute_criterion.md +++ b/docs/search/criteria_reference/selectionattribute_criterion.md @@ -15,7 +15,7 @@ The `SelectionAttribute` Search Criterion searches for products by the value of ### PHP -``` php {skip-validation} +``` php $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\SelectionAttribute( @@ -55,4 +55,4 @@ $query = new ProductQuery( } } } - ``` + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/shipment_createdat_criterion.md b/docs/search/criteria_reference/shipment_createdat_criterion.md index 3ef020f7f6..be1ed48ff6 100644 --- a/docs/search/criteria_reference/shipment_createdat_criterion.md +++ b/docs/search/criteria_reference/shipment_createdat_criterion.md @@ -16,7 +16,7 @@ The `CreatedAt` Search Criterion searches for shipments based on the date when t ### PHP -``` php {skip-validation} +``` php $criteria = new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\CreatedAt( new DateTime('2023-03-01 14:07:02'), 'GTE' diff --git a/docs/search/criteria_reference/shipment_currency_criterion.md b/docs/search/criteria_reference/shipment_currency_criterion.md index f803d22eeb..eeb2e7e9b2 100644 --- a/docs/search/criteria_reference/shipment_currency_criterion.md +++ b/docs/search/criteria_reference/shipment_currency_criterion.md @@ -15,7 +15,7 @@ The `Currency` Search Criterion searches for shipments based on the currency cod ### PHP -``` php {skip-validation} +``` php $query = new ShipmentQuery( new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\Currency('USD', 'CZK') ); diff --git a/docs/search/criteria_reference/shipment_id_criterion.md b/docs/search/criteria_reference/shipment_id_criterion.md index 55d1bbc5fc..782150cccd 100644 --- a/docs/search/criteria_reference/shipment_id_criterion.md +++ b/docs/search/criteria_reference/shipment_id_criterion.md @@ -15,7 +15,7 @@ The `Id` Search Criterion searches for shipments based on the shipment ID. ### PHP -``` php {skip-validation} +``` php $query = new ShipmentQuery( new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\Id(2) ); diff --git a/docs/search/criteria_reference/shipment_identifier_criterion.md b/docs/search/criteria_reference/shipment_identifier_criterion.md index a759e1f82f..df67826223 100644 --- a/docs/search/criteria_reference/shipment_identifier_criterion.md +++ b/docs/search/criteria_reference/shipment_identifier_criterion.md @@ -15,7 +15,7 @@ The `Identifier` Search Criterion searches for shipments based on the shipment i ### PHP -``` php {skip-validation} +``` php $query = new ShipmentQuery( new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\Identifier('f1t7z-3rb3rt') ); diff --git a/docs/search/criteria_reference/shipment_logicaland_criterion.md b/docs/search/criteria_reference/shipment_logicaland_criterion.md index 6de9df2484..c77c345282 100644 --- a/docs/search/criteria_reference/shipment_logicaland_criterion.md +++ b/docs/search/criteria_reference/shipment_logicaland_criterion.md @@ -15,7 +15,7 @@ The `LogicalAnd` Search Criterion matches shipments if all provided Criteria mat ### PHP -``` php {skip-validation} +``` php $query->query = new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\LogicalAnd( [ new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\CreatedAt(new DateTime('2023-03-01')), diff --git a/docs/search/criteria_reference/shipment_logicalor_criterion.md b/docs/search/criteria_reference/shipment_logicalor_criterion.md index 5603b442f0..2903abb758 100644 --- a/docs/search/criteria_reference/shipment_logicalor_criterion.md +++ b/docs/search/criteria_reference/shipment_logicalor_criterion.md @@ -15,7 +15,7 @@ The `LogicalOr` Search Criterion matches shipments if at least one of the provid ### PHP -``` php {skip-validation} +``` php $query->query = new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\LogicalOr( [ new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\CreatedAt(new DateTime('2023-03-01')), diff --git a/docs/search/criteria_reference/shipment_owner_criterion.md b/docs/search/criteria_reference/shipment_owner_criterion.md index e74a013613..79c9e81c3c 100644 --- a/docs/search/criteria_reference/shipment_owner_criterion.md +++ b/docs/search/criteria_reference/shipment_owner_criterion.md @@ -13,7 +13,7 @@ The `Owner` Criterion searches for shipments based on the user reference. ## Example -``` php {skip-validation} +``` php $query = new ShipmentQuery( new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\Owner( \Ibexa\Contracts\Core\Repository\Values\User\UserReference(14) @@ -23,7 +23,7 @@ $query = new ShipmentQuery( `Owner` Criterion accepts also multiple values: -``` php {skip-validation} +``` php $query = new ShipmentQuery( new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\Owner( [ @@ -32,4 +32,4 @@ $query = new ShipmentQuery( ] ) ); -``` +``` \ No newline at end of file diff --git a/docs/search/criteria_reference/shipment_shipping_method_criterion.md b/docs/search/criteria_reference/shipment_shipping_method_criterion.md index 26a92a9956..2a503ead43 100644 --- a/docs/search/criteria_reference/shipment_shipping_method_criterion.md +++ b/docs/search/criteria_reference/shipment_shipping_method_criterion.md @@ -15,7 +15,7 @@ The `ShippingMethod` Search Criterion searches for shipments based on a shipping ### PHP -``` php {skip-validation} +``` php $query = new ShipmentQuery( new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\ShippingMethod($shippingMethod) ); diff --git a/docs/search/criteria_reference/shipment_status_criterion.md b/docs/search/criteria_reference/shipment_status_criterion.md index 29148f1da4..3e2c0d40bc 100644 --- a/docs/search/criteria_reference/shipment_status_criterion.md +++ b/docs/search/criteria_reference/shipment_status_criterion.md @@ -15,7 +15,7 @@ The `Status` Search Criterion searches for shipments based on shipment status. ### PHP -``` php {skip-validation} +``` php $query = new ShipmentQuery( new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\Status('pending') ); diff --git a/docs/search/criteria_reference/shipment_updatedat_criterion.md b/docs/search/criteria_reference/shipment_updatedat_criterion.md index 6c0f0f185a..e7e84e13b7 100644 --- a/docs/search/criteria_reference/shipment_updatedat_criterion.md +++ b/docs/search/criteria_reference/shipment_updatedat_criterion.md @@ -16,7 +16,7 @@ The `UpdatedAt` Search Criterion searches for shipments based on the date when t ### PHP -``` php {skip-validation} +``` php $criteria = new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\UpdatedAt( new DateTime('2023-03-01'), 'GTE' diff --git a/docs/search/criteria_reference/sibling_criterion.md b/docs/search/criteria_reference/sibling_criterion.md index 24873738a1..0a3780c3c7 100644 --- a/docs/search/criteria_reference/sibling_criterion.md +++ b/docs/search/criteria_reference/sibling_criterion.md @@ -15,13 +15,13 @@ The [`Sibling` Search Criterion](/api/php_api/php_api_reference/classes/Ibexa-Co ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\Sibling(59, 2); ``` You can also use the named constructor `Criterion\Sibling::fromLocation` and provide it with the location object: -``` php {skip-validation} +``` php $location = $locationService->loadLocation(59); $query->query = Criterion\Sibling::fromLocation($location); ``` diff --git a/docs/search/criteria_reference/simplemeasurementattribute_criterion.md b/docs/search/criteria_reference/simplemeasurementattribute_criterion.md index d2dec47836..034a221ed7 100644 --- a/docs/search/criteria_reference/simplemeasurementattribute_criterion.md +++ b/docs/search/criteria_reference/simplemeasurementattribute_criterion.md @@ -15,7 +15,7 @@ The `SimpleMeasurementAttribute` Search Criterion searches for products by the v ### PHP -``` php {skip-validation} +``` php $value = $this->measurementService->buildSimpleValue('length', 120, 'centimeter'); $query = new ProductQuery( diff --git a/docs/search/criteria_reference/subtree_criterion.md b/docs/search/criteria_reference/subtree_criterion.md index 118f1e2cf8..a814f314fa 100644 --- a/docs/search/criteria_reference/subtree_criterion.md +++ b/docs/search/criteria_reference/subtree_criterion.md @@ -15,7 +15,7 @@ It returns the content item and all the content items below it in the subtree. ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\Subtree('/1/2/71/72/'); ``` diff --git a/docs/search/criteria_reference/taxonomy_entry_id.md b/docs/search/criteria_reference/taxonomy_entry_id.md index 191cc5907c..1cceaeccc2 100644 --- a/docs/search/criteria_reference/taxonomy_entry_id.md +++ b/docs/search/criteria_reference/taxonomy_entry_id.md @@ -14,12 +14,12 @@ The [`TaxonomyEntryId` Search Criterion](/api/php_api/php_api_reference/classes/ ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\TaxonomyEntryId(1); ``` Add an array of ID's to find Content tagged with at least one of the tags (OR). -```php {skip-validation} +```php $query->query = new Criterion\TaxonomyEntryId([1, 2, 3]); ``` diff --git a/docs/search/criteria_reference/useremail_criterion.md b/docs/search/criteria_reference/useremail_criterion.md index 348ffe7b28..7cc730e21f 100644 --- a/docs/search/criteria_reference/useremail_criterion.md +++ b/docs/search/criteria_reference/useremail_criterion.md @@ -19,11 +19,11 @@ Solr search engine and Elasticsearch support IN and EQ operators only. ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\UserEmail(['johndoe']); ``` -``` php {skip-validation} +``` php $query->query = new Criterion\UserEmail('nospam*', Criterion\Operator::LIKE); ``` diff --git a/docs/search/criteria_reference/userid_criterion.md b/docs/search/criteria_reference/userid_criterion.md index d7c213a28a..0468cffdbc 100644 --- a/docs/search/criteria_reference/userid_criterion.md +++ b/docs/search/criteria_reference/userid_criterion.md @@ -14,7 +14,7 @@ The [`UserId` Search Criterion](/api/php_api/php_api_reference/classes/Ibexa-Con ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\UserId([14]); ``` diff --git a/docs/search/criteria_reference/userlogin_criterion.md b/docs/search/criteria_reference/userlogin_criterion.md index 42739e1d40..a3c6f048b4 100644 --- a/docs/search/criteria_reference/userlogin_criterion.md +++ b/docs/search/criteria_reference/userlogin_criterion.md @@ -19,11 +19,11 @@ Solr search engine and Elasticsearch support IN and EQ operators only. ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\UserLogin(['johndoe']); ``` -``` php {skip-validation} +``` php $query->query = new Criterion\UserLogin('adm*', Criterion\Operator::LIKE); ``` diff --git a/docs/search/criteria_reference/usermetadata_criterion.md b/docs/search/criteria_reference/usermetadata_criterion.md index 61c8fdd236..54a9d0725b 100644 --- a/docs/search/criteria_reference/usermetadata_criterion.md +++ b/docs/search/criteria_reference/usermetadata_criterion.md @@ -16,7 +16,7 @@ The [`UserMetadata` Search Criterion](/api/php_api/php_api_reference/classes/Ibe ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\UserMetadata(Criterion\UserMetadata::GROUP, Criterion\Operator::EQ, 12); ``` @@ -56,7 +56,7 @@ $query->query = new Criterion\UserMetadata(Criterion\UserMetadata::GROUP, Criter You can use the `UserMetadata` Criterion to search for blog posts created by the Contributor user group: -``` php {skip-validation} hl_lines="7" +``` php hl_lines="7" // ID of your custom Contributor User Group $contributorGroupId = 32; diff --git a/docs/search/criteria_reference/visibility_criterion.md b/docs/search/criteria_reference/visibility_criterion.md index 7f75bc0219..50ba1f4c47 100644 --- a/docs/search/criteria_reference/visibility_criterion.md +++ b/docs/search/criteria_reference/visibility_criterion.md @@ -20,7 +20,7 @@ Use Location Search to avoid this. ### PHP -``` php {skip-validation} +``` php $query->query = new Criterion\Visibility(Criterion\Visibility::HIDDEN); ``` diff --git a/docs/search/extensibility/create_custom_aggregation.md b/docs/search/extensibility/create_custom_aggregation.md index b03a155c95..44af319e63 100644 --- a/docs/search/extensibility/create_custom_aggregation.md +++ b/docs/search/extensibility/create_custom_aggregation.md @@ -9,7 +9,7 @@ description: Create custom Aggregation to use with Solr and Elasticsearch search To create a custom Aggregation, create an aggregation class. In the following example, an aggregation groups the location query results by the location priority: -``` php {skip-validation} +``` php --8<-- code_samples/search/custom/src/Query/Aggregation/PriorityRangeAggregation.php --8<-- @@ -138,7 +138,7 @@ In a more complex use case, you must create your own visitor and extractor. The aggregation visitor must implement [`Ibexa\Contracts\Solr\Query\AggregationVisitor`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Solr-Query-AggregationVisitor.html): - ``` php {skip-validation} + ``` php --8<-- code_samples/search/custom/src/Query/Aggregation/Solr/PriorityRangeAggregationVisitor.php --8<-- @@ -148,7 +148,7 @@ In a more complex use case, you must create your own visitor and extractor. The aggregation visitor must implement [`Ibexa\Contracts\ElasticSearchEngine\Query\AggregationVisitor`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Elasticsearch-Query-AggregationVisitor.html): - ``` php {skip-validation} + ``` php --8<-- code_samples/search/custom/src/Query/Aggregation/Elasticsearch/PriorityRangeAggregationVisitor.php --8<-- @@ -189,7 +189,7 @@ Finally, register the aggregation visitor as a service. You must also create a result extractor, which implements [`Ibexa\Contracts\Solr\ResultExtractor\AggregationResultExtractor`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Solr-ResultExtractor-AggregationResultExtractor.html) that transforms raw aggregation results from Solr into `AggregationResult` objects: - ``` php {skip-validation} + ``` php --8<-- code_samples/search/custom/src/Query/Aggregation/Solr/PriorityRangeAggregationResultExtractor.php --8<-- @@ -203,7 +203,7 @@ Finally, register the aggregation visitor as a service. You must also create a result extractor, which implements [`Ibexa\Contracts\ElasticSearchEngine\Query\AggregationResultExtractor`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Elasticsearch-Query-AggregationResultExtractor.html) that transforms raw aggregation results from Elasticsearch into `AggregationResult` objects: - ``` php {skip-validation} + ``` php --8<-- code_samples/search/custom/src/Query/Aggregation/Elasticsearch/PriorityRangeAggregationResultExtractor.php --8<-- diff --git a/docs/search/extensibility/create_custom_search_criterion.md b/docs/search/extensibility/create_custom_search_criterion.md index 237c400a16..eea7f735e8 100644 --- a/docs/search/extensibility/create_custom_search_criterion.md +++ b/docs/search/extensibility/create_custom_search_criterion.md @@ -10,7 +10,7 @@ To provide support for a custom Search Criterion, do the following. First, create a `CameraManufacturerCriterion.php` file that contains the Criterion class: -``` php {skip-validation} +``` php --8<-- code_samples/search/custom/src/Query/Criterion/CameraManufacturerCriterion.php --8<-- @@ -22,7 +22,7 @@ Then, add a `CameraManufacturerVisitor` class, implementing `CriterionVisitor`: === "Solr" - ``` php {skip-validation} + ``` php --8<-- code_samples/search/custom/src/Query/Criterion/Solr/CameraManufacturerVisitor.php --8<-- @@ -30,7 +30,7 @@ Then, add a `CameraManufacturerVisitor` class, implementing `CriterionVisitor`: === "Elasticsearch" - ``` php {skip-validation} + ``` php --8<-- code_samples/search/custom/src/Query/Criterion/Elasticsearch/CameraManufacturerVisitor.php --8<-- diff --git a/docs/search/extensibility/create_custom_sort_clause.md b/docs/search/extensibility/create_custom_sort_clause.md index 85970e78cd..259f421d39 100644 --- a/docs/search/extensibility/create_custom_sort_clause.md +++ b/docs/search/extensibility/create_custom_sort_clause.md @@ -10,7 +10,7 @@ To create a custom Sort Clause, do the following. First, add a `ScoreSortClause.php` file with the Sort Clause class: -``` php {skip-validation} +``` php --8<-- code_samples/search/custom/src/Query/SortClause/ScoreSortClause.php --8<-- @@ -22,7 +22,7 @@ Then, add a `ScoreVisitor` class that implements `SortClauseVisitor`: === "Solr" - ``` php {skip-validation} + ``` php --8<-- code_samples/search/custom/src/Query/SortClause/Solr/ScoreVisitor.php --8<-- @@ -30,7 +30,7 @@ Then, add a `ScoreVisitor` class that implements `SortClauseVisitor`: === "Elasticsearch" - ``` php {skip-validation} + ``` php --8<-- code_samples/search/custom/src/Query/SortClause/Elasticsearch/ScoreVisitor.php --8<-- diff --git a/docs/search/extensibility/index_custom_elasticsearch_data.md b/docs/search/extensibility/index_custom_elasticsearch_data.md index fae2c8442f..b9c9c215a3 100644 --- a/docs/search/extensibility/index_custom_elasticsearch_data.md +++ b/docs/search/extensibility/index_custom_elasticsearch_data.md @@ -18,7 +18,7 @@ You can pass the event to a subscriber which gives you access to the document th In the following example, when an index in created for a content or a location document, the event subscriber adds a `custom_field` of the type [`StringField`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Search-FieldType-StringField.html) to the index: -``` php {skip-validation} hl_lines="19 20 21" +``` php hl_lines="19 20 21" --8<-- code_samples/search/custom/src/EventSubscriber/CustomIndexDataSubscriber.php --8<-- diff --git a/docs/search/extensibility/manipulate_elasticsearch_query.md b/docs/search/extensibility/manipulate_elasticsearch_query.md index 06df646272..d0f41327ba 100644 --- a/docs/search/extensibility/manipulate_elasticsearch_query.md +++ b/docs/search/extensibility/manipulate_elasticsearch_query.md @@ -11,7 +11,7 @@ The following example shows how to add a Search Criterion to all queries. Depending on your configuration, this might impact all search queries, including those used for search and content tree in the back office. -``` php {skip-validation} hl_lines="34" +``` php hl_lines="34" --8<-- code_samples/search/custom/src/EventSubscriber/CustomQueryFilterSubscriber.php --8<-- diff --git a/docs/search/search_api.md b/docs/search/search_api.md index f6e9c2cb5b..e14213a1af 100644 --- a/docs/search/search_api.md +++ b/docs/search/search_api.md @@ -42,7 +42,7 @@ You can also use [`SearchService::findContent`](/api/php_api/php_api_reference/c To query for a single result, for example by providing a Content ID, use the [`SearchService::findSingle`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SearchService.html#method_findSingle) method: -``` php {skip-validation} +``` php $criterion = new Criterion\ContentId($contentId); $result = $this->searchService->findSingle($criterion); $output->writeln($result->getName()); @@ -57,7 +57,7 @@ $output->writeln($result->getName()); By default search returns up to 25 results. You can change it by setting a different limit to the query: - ``` php {skip-validation} + ``` php $query->limit = 100; ``` @@ -93,7 +93,7 @@ This enables iterating over results that are too large to handle due to memory c `BatchIterator` takes one of the available adapters ([`\Ibexa\Contracts\Core\Repository\Iterator\BatchIteratorAdapter`](/api/php_api/php_api_reference/namespaces/ibexa-contracts-core-repository-iterator-batchiteratoradapter.html)) and optional batch size. For example: -``` php {skip-validation} +``` php $query = new LocationQuery(); $iterator = new BatchIterator(new BatchIteratorAdapter\LocationSearchAdapter($this->searchService, $query)); @@ -172,7 +172,7 @@ You can use the following methods of the Filter: The following example filters for Folder content items under the parent location 2, sorts them by publication date and returns 10 results, starting from the third one: -``` php {skip-validation} +``` php $filter = new Filter(); $filter ->withCriterion(new Criterion\ContentTypeIdentifier('folder')) @@ -290,7 +290,7 @@ This can lead to unexpected behavior, for instance because content can have mult For example, a content item has two locations: visible location A and hidden location B. You perform the following query: -``` php {skip-validation} +``` php $query->filter = new Criterion\LogicalAnd([ new LocationId($bLocationId), new Visibility(Visibility::VISIBLE), @@ -365,7 +365,7 @@ The following example limits the number of terms returned to 5 and only consider To use a range aggregation, you must provide a `ranges` array containing a set of `Range` objects that define the borders of the specific range sets. -``` php {skip-validation} +``` php $query->aggregations[] = new IntegerRangeAggregation('range', 'person', 'age', [ new Query\Aggregation\Range(1,30), diff --git a/docs/search/search_engines/solr_search_engine/configure_solr.md b/docs/search/search_engines/solr_search_engine/configure_solr.md index d5108436d9..e38c5c5db9 100644 --- a/docs/search/search_engines/solr_search_engine/configure_solr.md +++ b/docs/search/search_engines/solr_search_engine/configure_solr.md @@ -72,7 +72,7 @@ The configuration above results in the following boosting (content type / Field) The second step requires you to use `\Novactive\EzSolrSearchExtra\Query\Content\Criterion\MultipleFieldsFullText` instead of default `\Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\FullText`. The following example shows custom query which benefits from the custom fields created in the previous example. - ```php {skip-validation} + ```php sortClauses = [new SortClause\ContentId()]; ``` diff --git a/docs/search/sort_clause_reference/contentname_sort_clause.md b/docs/search/sort_clause_reference/contentname_sort_clause.md index 8704640421..9f1106a4b5 100644 --- a/docs/search/sort_clause_reference/contentname_sort_clause.md +++ b/docs/search/sort_clause_reference/contentname_sort_clause.md @@ -12,7 +12,7 @@ The [`ContentName` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-Con ## Example -``` php {skip-validation} +``` php $query = new LocationQuery(); $query->sortClauses = [new SortClause\ContentName()]; ``` diff --git a/docs/search/sort_clause_reference/contenttranslatedname_sort_clause.md b/docs/search/sort_clause_reference/contenttranslatedname_sort_clause.md index 6b9c96aee8..957cc93109 100644 --- a/docs/search/sort_clause_reference/contenttranslatedname_sort_clause.md +++ b/docs/search/sort_clause_reference/contenttranslatedname_sort_clause.md @@ -16,7 +16,7 @@ The `ContentTranslatedName` Sort Clause isn't available in [Repository filtering ## Example -``` php {skip-validation} +``` php $query = new LocationQuery(); $query->sortClauses = [new SortClause\ContentTranslatedName()]; ``` diff --git a/docs/search/sort_clause_reference/contenttypename_sort_clause.md b/docs/search/sort_clause_reference/contenttypename_sort_clause.md index 13af659e9a..fc4c516ae2 100644 --- a/docs/search/sort_clause_reference/contenttypename_sort_clause.md +++ b/docs/search/sort_clause_reference/contenttypename_sort_clause.md @@ -12,7 +12,7 @@ The [`ContentTypeName` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->sortClauses = [new SortClause\Trash\ContentTypeName()]; ``` diff --git a/docs/search/sort_clause_reference/createdat_sort_clause.md b/docs/search/sort_clause_reference/createdat_sort_clause.md index 930983895a..2ef171dc82 100644 --- a/docs/search/sort_clause_reference/createdat_sort_clause.md +++ b/docs/search/sort_clause_reference/createdat_sort_clause.md @@ -12,7 +12,7 @@ The `CreatedAt` Sort Clause sorts search results by the date and time of the cre ## Example -``` php {skip-validation} +``` php $productQuery = new ProductQuery( null, null, diff --git a/docs/search/sort_clause_reference/customfield_sort_clause.md b/docs/search/sort_clause_reference/customfield_sort_clause.md index 551471db48..7770198082 100644 --- a/docs/search/sort_clause_reference/customfield_sort_clause.md +++ b/docs/search/sort_clause_reference/customfield_sort_clause.md @@ -22,7 +22,7 @@ The `CustomField` Sort Clause isn't available in [Repository filtering](search_a ## Example -``` php {skip-validation} +``` php $query = new LocationQuery(); $query->sortClauses = [new SortClause\CustomField('my_custom_field_s')]; ``` diff --git a/docs/search/sort_clause_reference/customprice_sort_clause.md b/docs/search/sort_clause_reference/customprice_sort_clause.md index a726d906f5..e042a16adb 100644 --- a/docs/search/sort_clause_reference/customprice_sort_clause.md +++ b/docs/search/sort_clause_reference/customprice_sort_clause.md @@ -19,7 +19,7 @@ The `CustomPrice` Sort Clause isn't available in the Legacy Search engine. ## Example -``` php {skip-validation} +``` php $sortClauses = [ new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\CustomPrice( $currency, diff --git a/docs/search/sort_clause_reference/datemodified_sort_clause.md b/docs/search/sort_clause_reference/datemodified_sort_clause.md index 0bbc44774f..a26a1f3749 100644 --- a/docs/search/sort_clause_reference/datemodified_sort_clause.md +++ b/docs/search/sort_clause_reference/datemodified_sort_clause.md @@ -12,7 +12,7 @@ The [`DateModified` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-Co ## Example -``` php {skip-validation} +``` php $query = new LocationQuery(); $query->sortClauses = [new SortClause\DateModified()]; ``` diff --git a/docs/search/sort_clause_reference/datepublished_sort_clause.md b/docs/search/sort_clause_reference/datepublished_sort_clause.md index 9fbbefde7a..39c6bc4f1c 100644 --- a/docs/search/sort_clause_reference/datepublished_sort_clause.md +++ b/docs/search/sort_clause_reference/datepublished_sort_clause.md @@ -12,7 +12,7 @@ The [`DatePublished` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-C ## Example -``` php {skip-validation} +``` php $query = new LocationQuery(); $query->sortClauses = [new SortClause\DatePublished()]; ``` diff --git a/docs/search/sort_clause_reference/datetrashed_sort_clause.md b/docs/search/sort_clause_reference/datetrashed_sort_clause.md index 18dccd0045..e82baf72c4 100644 --- a/docs/search/sort_clause_reference/datetrashed_sort_clause.md +++ b/docs/search/sort_clause_reference/datetrashed_sort_clause.md @@ -12,7 +12,7 @@ The [`DateTrashed` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-Con ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->sortClauses = [new SortClause\Trash\DateTrashed()]; ``` diff --git a/docs/search/sort_clause_reference/depth_sort_clause.md b/docs/search/sort_clause_reference/depth_sort_clause.md index 2a1324c381..78a0e8f45a 100644 --- a/docs/search/sort_clause_reference/depth_sort_clause.md +++ b/docs/search/sort_clause_reference/depth_sort_clause.md @@ -12,7 +12,7 @@ The [`Location\Depth` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa- ## Example -``` php {skip-validation} +``` php $query = new LocationQuery(); $query->sortClauses = [new SortClause\Depth()]; ``` diff --git a/docs/search/sort_clause_reference/field_sort_clause.md b/docs/search/sort_clause_reference/field_sort_clause.md index 2e8a3f8399..5db7bf10c5 100644 --- a/docs/search/sort_clause_reference/field_sort_clause.md +++ b/docs/search/sort_clause_reference/field_sort_clause.md @@ -20,7 +20,7 @@ The `Field` Sort Clause isn't available in [Repository filtering](search_api.md# ## Example -``` php {skip-validation} +``` php $query = new LocationQuery(); $query->sortClauses = [new SortClause\Field('article', 'title')]; ``` diff --git a/docs/search/sort_clause_reference/id_sort_clause.md b/docs/search/sort_clause_reference/id_sort_clause.md index 8c59c83246..1e869ae5a3 100644 --- a/docs/search/sort_clause_reference/id_sort_clause.md +++ b/docs/search/sort_clause_reference/id_sort_clause.md @@ -12,7 +12,7 @@ The [`Location\Id` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-Con ## Example -``` php {skip-validation} +``` php $query = new LocationQuery(); $query->sortClauses = [new SortClause\Location\Id()]; ``` diff --git a/docs/search/sort_clause_reference/ismainlocation_sort_clause.md b/docs/search/sort_clause_reference/ismainlocation_sort_clause.md index 5239dec8b8..ef8f5bed55 100644 --- a/docs/search/sort_clause_reference/ismainlocation_sort_clause.md +++ b/docs/search/sort_clause_reference/ismainlocation_sort_clause.md @@ -18,7 +18,7 @@ The `Location\IsMainLocation` Sort Clause isn't available in [Repository filteri ## Example -``` php {skip-validation} +``` php $query = new LocationQuery(); $query->sortClauses = [new SortClause\Location\InMainLocation()]; ``` diff --git a/docs/search/sort_clause_reference/maplocationdistance_sort_clause.md b/docs/search/sort_clause_reference/maplocationdistance_sort_clause.md index 68ff08525c..c13e240bb1 100644 --- a/docs/search/sort_clause_reference/maplocationdistance_sort_clause.md +++ b/docs/search/sort_clause_reference/maplocationdistance_sort_clause.md @@ -19,7 +19,7 @@ The `MapLocationDistance` Sort Clause isn't available in [Repository filtering]( ## Example -``` php {skip-validation} +``` php $query = new LocationQuery(); $query->sortClauses = [new SortClause\MapLocationDistance('place', 'location', 49.542889, 20.111349)]; ``` diff --git a/docs/search/sort_clause_reference/order_created_sort_clause.md b/docs/search/sort_clause_reference/order_created_sort_clause.md index 347136d8eb..c11efc7e38 100644 --- a/docs/search/sort_clause_reference/order_created_sort_clause.md +++ b/docs/search/sort_clause_reference/order_created_sort_clause.md @@ -13,7 +13,7 @@ The `Created` Sort Clause sorts search results by the date and time when the ord ## Example -``` php {skip-validation} +``` php $orderQuery = new OrderQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/order_id_sort_clause.md b/docs/search/sort_clause_reference/order_id_sort_clause.md index a0e3cbc6c2..2df732073d 100644 --- a/docs/search/sort_clause_reference/order_id_sort_clause.md +++ b/docs/search/sort_clause_reference/order_id_sort_clause.md @@ -13,7 +13,7 @@ The `Id` Sort Clause sorts search results by order Id. ## Example -``` php {skip-validation} +``` php $orderQuery = new OrderQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/order_status_sort_clause.md b/docs/search/sort_clause_reference/order_status_sort_clause.md index d2e4199ac2..e9711c752e 100644 --- a/docs/search/sort_clause_reference/order_status_sort_clause.md +++ b/docs/search/sort_clause_reference/order_status_sort_clause.md @@ -13,7 +13,7 @@ The `Status` Sort Clause sorts search results by order status. ## Example -``` php {skip-validation} +``` php $orderQuery = new OrderQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/order_updated_sort_clause.md b/docs/search/sort_clause_reference/order_updated_sort_clause.md index a648426b1b..9a17f8f2b3 100644 --- a/docs/search/sort_clause_reference/order_updated_sort_clause.md +++ b/docs/search/sort_clause_reference/order_updated_sort_clause.md @@ -13,7 +13,7 @@ The `Updated` Sort Clause sorts search results by the date and time when order s ## Example -``` php {skip-validation} +``` php $orderQuery = new OrderQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/path_sort_clause.md b/docs/search/sort_clause_reference/path_sort_clause.md index d40716b87b..26937e643f 100644 --- a/docs/search/sort_clause_reference/path_sort_clause.md +++ b/docs/search/sort_clause_reference/path_sort_clause.md @@ -16,7 +16,7 @@ The [`Location\Path` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-C ## Example -``` php {skip-validation} +``` php $query = new LocationQuery(); $query->sortClauses = [new SortClause\Location\Path()]; ``` diff --git a/docs/search/sort_clause_reference/payment_createdat_sort_clause.md b/docs/search/sort_clause_reference/payment_createdat_sort_clause.md index 14265e5ef7..c8c82ffec6 100644 --- a/docs/search/sort_clause_reference/payment_createdat_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_createdat_sort_clause.md @@ -13,7 +13,7 @@ The `CreatedAt` Sort Clause sorts search results by the date and time when the p ## Example -``` php {skip-validation} +``` php $paymentQuery = new PaymentQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/payment_id_sort_clause.md b/docs/search/sort_clause_reference/payment_id_sort_clause.md index 23d171ebbb..441cbd2edb 100644 --- a/docs/search/sort_clause_reference/payment_id_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_id_sort_clause.md @@ -13,7 +13,7 @@ The `Id` Sort Clause sorts search results by payment ID. ## Example -``` php {skip-validation} +``` php $paymentQuery = new PaymentQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/payment_identifier_sort_clause.md b/docs/search/sort_clause_reference/payment_identifier_sort_clause.md index 4b2e68d0d2..c8969c7f5e 100644 --- a/docs/search/sort_clause_reference/payment_identifier_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_identifier_sort_clause.md @@ -13,7 +13,7 @@ The `Identifier` Sort Clause sorts search results by payment identifier. ## Example -``` php {skip-validation} +``` php $paymentQuery = new PaymentQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/payment_method_createdat_sort_clause.md b/docs/search/sort_clause_reference/payment_method_createdat_sort_clause.md index a5b9206e7e..f89ad0c7d6 100644 --- a/docs/search/sort_clause_reference/payment_method_createdat_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_method_createdat_sort_clause.md @@ -13,7 +13,7 @@ The `CreatedAt` Sort Clause sorts search results by the date and time when the p ## Example -``` php {skip-validation} +``` php $paymentMethodQuery = new PaymentMethodQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/payment_method_enabled_sort_clause.md b/docs/search/sort_clause_reference/payment_method_enabled_sort_clause.md index 95cacb465e..5c3a20df97 100644 --- a/docs/search/sort_clause_reference/payment_method_enabled_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_method_enabled_sort_clause.md @@ -13,7 +13,7 @@ The `Enabled` Sort Clause sorts search results by payment method status. ## Example -``` php {skip-validation} +``` php $paymentMethodQuery = new PaymentMethodQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/payment_method_id_sort_clause.md b/docs/search/sort_clause_reference/payment_method_id_sort_clause.md index b8a6245a25..bd7bc8e50a 100644 --- a/docs/search/sort_clause_reference/payment_method_id_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_method_id_sort_clause.md @@ -13,7 +13,7 @@ The `Id` Sort Clause sorts search results by payment method ID. ## Example -``` php {skip-validation} +``` php $paymentMethodQuery = new PaymentMethodQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/payment_method_identifier_sort_clause.md b/docs/search/sort_clause_reference/payment_method_identifier_sort_clause.md index 85f5c7c552..02fa6e64d6 100644 --- a/docs/search/sort_clause_reference/payment_method_identifier_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_method_identifier_sort_clause.md @@ -13,7 +13,7 @@ The `Identifier` Sort Clause sorts search results by payment method identifier. ## Example -``` php {skip-validation} +``` php $paymentMethodQuery = new PaymentMethodQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/payment_method_updatedat_sort_clause.md b/docs/search/sort_clause_reference/payment_method_updatedat_sort_clause.md index b7e192297b..4c20548949 100644 --- a/docs/search/sort_clause_reference/payment_method_updatedat_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_method_updatedat_sort_clause.md @@ -13,7 +13,7 @@ The `UpdatedAt` Sort Clause sorts search results by the date and time when payme ## Example -``` php {skip-validation} +``` php $paymentMethodQuery = new PaymentMethodQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/payment_status_sort_clause.md b/docs/search/sort_clause_reference/payment_status_sort_clause.md index 4593b0a3d8..ea4afc15bf 100644 --- a/docs/search/sort_clause_reference/payment_status_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_status_sort_clause.md @@ -13,7 +13,7 @@ The `Status` Sort Clause sorts search results by payment status. ## Example -``` php {skip-validation} +``` php $paymentQuery = new PaymentQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/payment_updatedat_sort_clause.md b/docs/search/sort_clause_reference/payment_updatedat_sort_clause.md index 36c86783e6..82a65ab0a9 100644 --- a/docs/search/sort_clause_reference/payment_updatedat_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_updatedat_sort_clause.md @@ -13,7 +13,7 @@ The `UpdatedAt` Sort Clause sorts search results by the date and time when payme ## Example -``` php {skip-validation} +``` php $paymentQuery = new PaymentQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/priority_sort_clause.md b/docs/search/sort_clause_reference/priority_sort_clause.md index e30a401ea2..874bb8f919 100644 --- a/docs/search/sort_clause_reference/priority_sort_clause.md +++ b/docs/search/sort_clause_reference/priority_sort_clause.md @@ -12,7 +12,7 @@ The [`Location\Priority` Sort Clause](/api/php_api/php_api_reference/classes/Ibe ## Example -``` php {skip-validation} +``` php $query = new LocationQuery(); $query->sortClauses = [new SortClause\Location\Priority()]; ``` diff --git a/docs/search/sort_clause_reference/productavailability_sort_clause.md b/docs/search/sort_clause_reference/productavailability_sort_clause.md index 2e7adafa8c..4129785d5a 100644 --- a/docs/search/sort_clause_reference/productavailability_sort_clause.md +++ b/docs/search/sort_clause_reference/productavailability_sort_clause.md @@ -12,7 +12,7 @@ The `ProductAvailability` Sort Clause sorts search results by whether they have ## Example -``` php {skip-validation} +``` php $query = new ProductQuery( null, null, diff --git a/docs/search/sort_clause_reference/productcode_sort_clause.md b/docs/search/sort_clause_reference/productcode_sort_clause.md index 650b5df9bb..4eed6ce992 100644 --- a/docs/search/sort_clause_reference/productcode_sort_clause.md +++ b/docs/search/sort_clause_reference/productcode_sort_clause.md @@ -12,7 +12,7 @@ The `ProductCode` Sort Clause sorts search results by the product code. ## Example -``` php {skip-validation} +``` php $query = new ProductQuery( null, null, diff --git a/docs/search/sort_clause_reference/productname_sort_clause.md b/docs/search/sort_clause_reference/productname_sort_clause.md index fb03f406cb..4321cff756 100644 --- a/docs/search/sort_clause_reference/productname_sort_clause.md +++ b/docs/search/sort_clause_reference/productname_sort_clause.md @@ -12,7 +12,7 @@ The `ProductName` Sort Clause sorts search results by the Product code. ## Example -``` php {skip-validation} +``` php $query = new ProductQuery( null, null, diff --git a/docs/search/sort_clause_reference/random_sort_clause.md b/docs/search/sort_clause_reference/random_sort_clause.md index ede07f1ec4..2c83038981 100644 --- a/docs/search/sort_clause_reference/random_sort_clause.md +++ b/docs/search/sort_clause_reference/random_sort_clause.md @@ -18,7 +18,7 @@ In Elasticsearch engine, you cannot combine the `Random` Sort Clause with any ot ## Example -``` php {skip-validation} +``` php $query = new LocationQuery(); $query->sortClauses = [new SortClause\Random()]; ``` diff --git a/docs/search/sort_clause_reference/score_sort_clause.md b/docs/search/sort_clause_reference/score_sort_clause.md index 79a28f7853..87bb7f49c7 100644 --- a/docs/search/sort_clause_reference/score_sort_clause.md +++ b/docs/search/sort_clause_reference/score_sort_clause.md @@ -16,7 +16,7 @@ The `Score` Sort Clause isn't available in [Repository filtering](search_api.md# ## Example -``` php {skip-validation} +``` php $query = new LocationQuery(); $query->sortClauses = [new SortClause\Score()]; ``` diff --git a/docs/search/sort_clause_reference/sectionidentifier_sort_clause.md b/docs/search/sort_clause_reference/sectionidentifier_sort_clause.md index bdab557953..5999554176 100644 --- a/docs/search/sort_clause_reference/sectionidentifier_sort_clause.md +++ b/docs/search/sort_clause_reference/sectionidentifier_sort_clause.md @@ -16,7 +16,7 @@ The [`SectionIdentifier` Sort Clause](/api/php_api/php_api_reference/classes/Ibe ## Example -``` php {skip-validation} +``` php $query = new LocationQuery(); $query->sortClauses = [new SortClause\SectionIdentifier()]; ``` diff --git a/docs/search/sort_clause_reference/sectionname_sort_clause.md b/docs/search/sort_clause_reference/sectionname_sort_clause.md index 1ab4da3f87..950df555e2 100644 --- a/docs/search/sort_clause_reference/sectionname_sort_clause.md +++ b/docs/search/sort_clause_reference/sectionname_sort_clause.md @@ -12,7 +12,7 @@ The [`SectionName` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-Con ## Example -``` php {skip-validation} +``` php $query = new LocationQuery(); $query->sortClauses = [new SortClause\SectionName()]; ``` diff --git a/docs/search/sort_clause_reference/shipment_createdat_sort_clause.md b/docs/search/sort_clause_reference/shipment_createdat_sort_clause.md index 44cbc7a932..373aeb5d9e 100644 --- a/docs/search/sort_clause_reference/shipment_createdat_sort_clause.md +++ b/docs/search/sort_clause_reference/shipment_createdat_sort_clause.md @@ -13,7 +13,7 @@ The `CreatedAt` Sort Clause sorts search results by the date and time when the s ## Example -``` php {skip-validation} +``` php $shipmentQuery = new ShipmentQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/shipment_id_sort_clause.md b/docs/search/sort_clause_reference/shipment_id_sort_clause.md index 0008c6727f..fa405de54e 100644 --- a/docs/search/sort_clause_reference/shipment_id_sort_clause.md +++ b/docs/search/sort_clause_reference/shipment_id_sort_clause.md @@ -13,7 +13,7 @@ The `Id` Sort Clause sorts search results by shipment Id. ## Example -``` php {skip-validation} +``` php $shipmentQuery = new ShipmentQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/shipment_identifier_sort_clause.md b/docs/search/sort_clause_reference/shipment_identifier_sort_clause.md index 714c2f8d09..1bc1a60bf3 100644 --- a/docs/search/sort_clause_reference/shipment_identifier_sort_clause.md +++ b/docs/search/sort_clause_reference/shipment_identifier_sort_clause.md @@ -13,7 +13,7 @@ The `Identifier` Sort Clause sorts search results by shipment identifier. ## Example -``` php {skip-validation} +``` php $shipmentQuery = new ShipmentQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/shipment_status_sort_clause.md b/docs/search/sort_clause_reference/shipment_status_sort_clause.md index c76465a4ad..5a0cacf07b 100644 --- a/docs/search/sort_clause_reference/shipment_status_sort_clause.md +++ b/docs/search/sort_clause_reference/shipment_status_sort_clause.md @@ -13,7 +13,7 @@ The `Status` Sort Clause sorts search results by shipment status. ## Example -``` php {skip-validation} +``` php $shipmentQuery = new ShipmentQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/shipment_updatedat_sort_clause.md b/docs/search/sort_clause_reference/shipment_updatedat_sort_clause.md index bd9b96a1b5..0b6260a8ed 100644 --- a/docs/search/sort_clause_reference/shipment_updatedat_sort_clause.md +++ b/docs/search/sort_clause_reference/shipment_updatedat_sort_clause.md @@ -13,7 +13,7 @@ The `UpdatedAt` Sort Clause sorts search results by the date and time when shipm ## Example -``` php {skip-validation} +``` php $shipmentQuery = new ShipmentQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/userlogin_sort_clause.md b/docs/search/sort_clause_reference/userlogin_sort_clause.md index 7b8eaada1f..f234780543 100644 --- a/docs/search/sort_clause_reference/userlogin_sort_clause.md +++ b/docs/search/sort_clause_reference/userlogin_sort_clause.md @@ -12,7 +12,7 @@ The [`UserLogin` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-Contr ## Example -``` php {skip-validation} +``` php $query = new Query(); $query->sortClauses = [new SortClause\Trash\UserLogin()]; ``` diff --git a/docs/search/sort_clause_reference/visibility_sort_clause.md b/docs/search/sort_clause_reference/visibility_sort_clause.md index ed8b7fa198..258ee5fb72 100644 --- a/docs/search/sort_clause_reference/visibility_sort_clause.md +++ b/docs/search/sort_clause_reference/visibility_sort_clause.md @@ -14,7 +14,7 @@ Locations that aren't visible are ranked as higher values (for example, with asc ## Example -``` php {skip-validation} +``` php $query = new LocationQuery(); $query->sortClauses = [new SortClause\Location\Visibility()]; ``` diff --git a/docs/search/url_search_reference/id_url_sort_clause.md b/docs/search/url_search_reference/id_url_sort_clause.md index f492ae9f46..ba2420079e 100644 --- a/docs/search/url_search_reference/id_url_sort_clause.md +++ b/docs/search/url_search_reference/id_url_sort_clause.md @@ -12,7 +12,7 @@ The [`SortClause\Id` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-C ## Example -``` php {skip-validation} +``` php use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; use Ibexa\Contracts\Core\Repository\Values\URL\Query\SortClause; diff --git a/docs/search/url_search_reference/logicaland_url_criterion.md b/docs/search/url_search_reference/logicaland_url_criterion.md index a1e98b52a0..f7b77a1649 100644 --- a/docs/search/url_search_reference/logicaland_url_criterion.md +++ b/docs/search/url_search_reference/logicaland_url_criterion.md @@ -12,7 +12,7 @@ The [`LogicalAnd` URL Criterion](/api/php_api/php_api_reference/classes/Ibexa-Co ## Example -``` php {skip-validation} +``` php $query->filter = new Criterion\LogicalAnd( [ new Criterion\Validity(true), diff --git a/docs/search/url_search_reference/logicalnot_url_criterion.md b/docs/search/url_search_reference/logicalnot_url_criterion.md index ce9c6d42f3..6222fad435 100644 --- a/docs/search/url_search_reference/logicalnot_url_criterion.md +++ b/docs/search/url_search_reference/logicalnot_url_criterion.md @@ -14,7 +14,7 @@ It takes only one Criterion in the array parameter. ## Example -``` php {skip-validation} +``` php $query->filter = new Criterion\LogicalNot( new Criterion\Pattern('ibexa.co') ); diff --git a/docs/search/url_search_reference/logicalor_url_criterion.md b/docs/search/url_search_reference/logicalor_url_criterion.md index 5424306c2a..7e79da7f1f 100644 --- a/docs/search/url_search_reference/logicalor_url_criterion.md +++ b/docs/search/url_search_reference/logicalor_url_criterion.md @@ -12,7 +12,7 @@ The [`LogicalOr` URL Criterion](/api/php_api/php_api_reference/classes/Ibexa-Con ## Example -``` php {skip-validation} +``` php $query->filter = new Criterion\LogicalOr( [ new Criterion\SectionIdentifier(['sports', 'news']), diff --git a/docs/search/url_search_reference/pattern_url_criterion.md b/docs/search/url_search_reference/pattern_url_criterion.md index 12dbd9478d..34ed0afb67 100644 --- a/docs/search/url_search_reference/pattern_url_criterion.md +++ b/docs/search/url_search_reference/pattern_url_criterion.md @@ -12,6 +12,6 @@ The [`Pattern` URL Criterion](/api/php_api/php_api_reference/classes/Ibexa-Contr ## Example -``` php {skip-validation} +``` php $query->filter = new Criterion\Pattern('ibexa.co'); ``` diff --git a/docs/search/url_search_reference/sectionid_url_criterion.md b/docs/search/url_search_reference/sectionid_url_criterion.md index 7d6f005b77..8c0a67f03b 100644 --- a/docs/search/url_search_reference/sectionid_url_criterion.md +++ b/docs/search/url_search_reference/sectionid_url_criterion.md @@ -12,6 +12,6 @@ The [`SectionId` URL Criterion](/api/php_api/php_api_reference/classes/Ibexa-Con ## Example -``` php {skip-validation} +``` php $query->filter = new Criterion\SectionId(['1', '3']); ``` diff --git a/docs/search/url_search_reference/sectionidentifier_url_criterion.md b/docs/search/url_search_reference/sectionidentifier_url_criterion.md index 33845e0641..e0069e6287 100644 --- a/docs/search/url_search_reference/sectionidentifier_url_criterion.md +++ b/docs/search/url_search_reference/sectionidentifier_url_criterion.md @@ -12,6 +12,6 @@ The [SectionIdentifier URL Criterion](/api/php_api/php_api_reference/classes/Ibe ## Example -```php {skip-validation} +```php $query->filter = new Criterion\SectionIdentifier(['standard', 'media']); ``` diff --git a/docs/search/url_search_reference/url_url_sort_clause.md b/docs/search/url_search_reference/url_url_sort_clause.md index 714e25bfa3..100e56354a 100644 --- a/docs/search/url_search_reference/url_url_sort_clause.md +++ b/docs/search/url_search_reference/url_url_sort_clause.md @@ -12,7 +12,7 @@ The [`SortClause\Url` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa- ## Example -``` php {skip-validation} +``` php use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; use Ibexa\Contracts\Core\Repository\Values\URL\Query\SortClause; diff --git a/docs/search/url_search_reference/validity_url_criterion.md b/docs/search/url_search_reference/validity_url_criterion.md index 22ef80ae96..89b637d604 100644 --- a/docs/search/url_search_reference/validity_url_criterion.md +++ b/docs/search/url_search_reference/validity_url_criterion.md @@ -12,6 +12,6 @@ The [Validity URL Criterion](/api/php_api/php_api_reference/classes/Ibexa-Contra ## Example -```php {skip-validation} +```php $query->filter = new Criterion\Validity(true); ``` diff --git a/docs/snippets/search_term_aggregation_settings.md b/docs/snippets/search_term_aggregation_settings.md index d2352a020e..e67da0f71d 100644 --- a/docs/snippets/search_term_aggregation_settings.md +++ b/docs/snippets/search_term_aggregation_settings.md @@ -3,7 +3,7 @@ You can define additional limits to the results using the `setLimit()` and `setMinCount()` methods. The following example limits the number of terms returned to 5 and only considers terms that have 10 or more results: -``` php {skip-validation} +``` php $aggregation = new //... $aggregation->setLimit(5); $aggregation->setMinCount(10); diff --git a/docs/templating/layout/add_login_form.md b/docs/templating/layout/add_login_form.md index 0195badcff..d035abf03e 100644 --- a/docs/templating/layout/add_login_form.md +++ b/docs/templating/layout/add_login_form.md @@ -56,7 +56,7 @@ You can use a custom template for example to display information about password In case of more advanced template customization, you can use a subscriber, for example in `src/EventSubscriber/LoginFormViewSubscriber.php`: -``` php {skip-validation} hl_lines="23 35 40 42" +``` php hl_lines="23 35 40 42" getMethod() != REQUEST::METHOD_POST) { throw new NotFoundHttpException(); } diff --git a/docs/tutorials/beginner_tutorial/5_display_a_list_of_content_items.md b/docs/tutorials/beginner_tutorial/5_display_a_list_of_content_items.md index af6cbd3170..6ddef06e21 100644 --- a/docs/tutorials/beginner_tutorial/5_display_a_list_of_content_items.md +++ b/docs/tutorials/beginner_tutorial/5_display_a_list_of_content_items.md @@ -57,7 +57,7 @@ For more information, see [Built-In Query Types](built-in_query_types.md). Here, you need to display `ride` objects that have been published (are visible). Create a `RideQueryType.php` file in `src/QueryType`: -``` php {skip-validation} hl_lines="21 22" +``` php hl_lines="21 22"
{% if zones[0].blocks %} @@ -197,7 +197,7 @@ defined in the [Enterprise Beginner tutorial](page_and_form_tutorial.md) `src/AppBundle/Block/RandomBlock.php`: - ``` php {skip-validation} + ``` php
{% if zones[0].blocks %} @@ -456,7 +456,7 @@ defined in the [Enterprise Beginner tutorial](page_and_form_tutorial.md) `src/AppBundle/Block/Event/Listener/RandomBlockListener.php` in place of `src/AppBundle/Block/RandomBlock.php`: - ``` php {skip-validation} + ``` php ['all' => true], Ibexa\Bundle\Checkout\IbexaCheckoutBundle::class => ['all' => true], Ibexa\Bundle\Storefront\IbexaStorefrontBundle::class => ['all' => true], diff --git a/docs/update_and_migration/from_4.6/update_from_4.6.md b/docs/update_and_migration/from_4.6/update_from_4.6.md index 99b5292a6c..1aadddff0c 100644 --- a/docs/update_and_migration/from_4.6/update_from_4.6.md +++ b/docs/update_and_migration/from_4.6/update_from_4.6.md @@ -161,7 +161,7 @@ merge with your custom settings if needed, and commit them to Git. If the new bundle `ibexa/core-search` has not been added by the recipes, enable it by adding the following line in `config/bundles.php`: -```php {skip-validation} +```php Ibexa\Bundle\CoreSearch\IbexaCoreSearchBundle::class => ['all' => true], ``` diff --git a/docs/update_and_migration/from_4.6/update_to_5.0.md b/docs/update_and_migration/from_4.6/update_to_5.0.md index 598b811d6e..0b9c561ce6 100644 --- a/docs/update_and_migration/from_4.6/update_to_5.0.md +++ b/docs/update_and_migration/from_4.6/update_to_5.0.md @@ -50,7 +50,7 @@ It's recommended to activate one rule set at a time and preview the output by ru Your configuration could look like the following example: -```php {skip-validation} +```php return RectorConfig::configure() ->withPaths( [ @@ -461,7 +461,7 @@ Again, it's recommended to activate one rule set at a time and preview the outpu As this update spans across a broad range of versions, multiple rules can be considered as in the example below. -```php {skip-validation} +```php //… use Rector\Symfony\Set\SymfonySetList; use Rector\Symfony\Set\SensiolabsSetList; diff --git a/docs/update_and_migration/migrate_to_ibexa_dxp/migrating_from_ez_publish_platform.md b/docs/update_and_migration/migrate_to_ibexa_dxp/migrating_from_ez_publish_platform.md index 8c644e2475..c90101af41 100644 --- a/docs/update_and_migration/migrate_to_ibexa_dxp/migrating_from_ez_publish_platform.md +++ b/docs/update_and_migration/migrate_to_ibexa_dxp/migrating_from_ez_publish_platform.md @@ -582,7 +582,7 @@ To use the script, do the following: **2.** Add `ezflow-migration-toolkit` to `AppKernel.php`. -``` php {skip-validation} +``` php // AppKernel.php new EzSystems\EzFlowMigrationToolkitBundle\EzSystemsEzFlowMigrationToolkitBundle() ``` @@ -618,7 +618,7 @@ You can see a report summarizing the results of the migration. **6.** Add `MigrationBundle` to `AppKernel.php`. -``` php {skip-validation} +``` php // AppKernel.php new MigrationBundle\MigrationBundle() ``` diff --git a/docs/users/oauth_server.md b/docs/users/oauth_server.md index 3cb99f8da4..bc12a9889f 100644 --- a/docs/users/oauth_server.md +++ b/docs/users/oauth_server.md @@ -34,7 +34,7 @@ Add the tables needed by the bundle: Then, in `config/bundles.php`, at the end of an array with a list of bundles, add the following two lines : -```php {skip-validation} +```php segmentationService->removeSegmentGroup($group); ``` diff --git a/docs/users/user_authentication.md b/docs/users/user_authentication.md index e2dd4b4da9..9ec9e79c5d 100644 --- a/docs/users/user_authentication.md +++ b/docs/users/user_authentication.md @@ -71,7 +71,7 @@ services: Don't mix `MVCEvents::INTERACTIVE_LOGIN` event (specific to [[= product_name =]]) and `SecurityEvents::INTERACTIVE_LOGIN` event (fired by Symfony security component). -``` php {skip-validation} +``` php Date: Sun, 17 May 2026 12:29:55 +0200 Subject: [PATCH 03/18] PHPStan green --- .../src/Command/SegmentCommand.php | 2 + .../formatting_date_and_time.md | 2 +- .../back_office_menus/back_office_menus.md | 2 + .../back_office/browser/browser.md | 14 +- .../back_office/customize_calendar.md | 10 +- .../back_office/notifications.md | 3 +- .../configuration/configuration.md | 3 +- .../configuration/dynamic_configuration.md | 16 +-- .../configuration/repository_configuration.md | 4 + docs/ai_actions/configure_ai_actions.md | 3 + docs/api/php_api/php_api.md | 5 +- .../creating_new_rest_resource.md | 6 +- docs/commerce/cart/cart_api.md | 20 ++- .../shopping_list/install_shopping_list.md | 3 + .../shopping_list/shopping_list_api.md | 17 ++- docs/commerce/storefront/extend_storefront.md | 7 + .../extend_transactional_emails.md | 8 +- .../content_api/browsing_content.md | 32 ++++- .../content_api/creating_content.md | 5 +- .../content_api/managing_content.md | 8 +- .../field_type_reference/addressfield.md | 2 + .../field_type_reference/authorfield.md | 12 +- .../field_type_reference/binaryfilefield.md | 1 + .../field_type_reference/checkboxfield.md | 12 +- .../field_type_reference/countryfield.md | 5 +- .../field_type_reference/dateandtimefield.md | 2 +- .../field_type_reference/emailaddressfield.md | 8 +- .../field_type_reference/floatfield.md | 13 +- .../field_type_reference/imageassetfield.md | 5 + .../field_type_reference/imagefield.md | 12 +- .../field_type_reference/integerfield.md | 3 +- .../field_type_reference/isbnfield.md | 7 +- .../field_type_reference/keywordfield.md | 8 +- .../field_type_reference/maplocationfield.md | 1 + .../field_type_reference/matrixfield.md | 4 + .../field_type_reference/measurementfield.md | 12 +- .../field_type_reference/mediafield.md | 2 + .../field_type_reference/relationfield.md | 4 + .../field_type_reference/relationlistfield.md | 8 +- .../field_type_reference/richtextfield.md | 2 + .../field_type_reference/selectionfield.md | 4 +- .../taxonomyentryassignmentfield.md | 15 ++- .../taxonomyentryfield.md | 27 ++-- .../field_type_reference/textlinefield.md | 4 +- .../field_type_reference/timefield.md | 2 +- .../field_type_reference/urlfield.md | 2 + .../field_types/field_type_search.md | 6 +- .../field_types/field_type_validation.md | 2 +- .../field_types/form_and_template.md | 101 +++++++------- .../file_management/file_management.md | 6 +- .../images/configure_image_editor.md | 6 +- .../taxonomy/taxonomy_api.md | 8 +- .../url_management/url_management.md | 5 +- .../workflow/add_custom_workflow_action.md | 2 + .../cache/http_cache/content_aware_cache.md | 9 +- .../cache/http_cache/context_aware_cache.md | 33 ++++- .../cache/http_cache/reverse_proxy.md | 5 +- .../cache/persistence_cache.md | 18 ++- .../languages/back_office_translations.md | 36 ++--- .../siteaccess/injecting_siteaccess.md | 8 +- .../siteaccess_aware_configuration.md | 7 +- docs/permissions/custom_policies.md | 11 +- docs/permissions/permission_overview.md | 6 +- .../personalization/enable_personalization.md | 2 +- .../integrate_recommendation_service.md | 6 +- docs/release_notes/ez_platform_v2.4.md | 2 +- .../ez_platform_v3.0_deprecations.md | 2 +- docs/release_notes/ibexa_dxp_v4.6.md | 2 +- .../contributing/package_structure.md | 24 ++-- .../action_criterion.md | 7 +- .../logged_at_criterion.md | 2 + .../object_criterion.md | 6 +- .../object_name_criterion.md | 2 + .../user_criterion.md | 2 + .../authorterm_aggregation.md | 3 + .../basepricestats_aggregation.md | 5 + .../checkboxterm_aggregation.md | 3 + .../contenttypegroupterm_aggregation.md | 3 + .../contenttypeterm_aggregation.md | 3 + .../countryterm_aggregation.md | 3 + .../custompricestats_aggregation.md | 7 + .../datemetadatarange_aggregation.md | 10 +- .../daterange_aggregation.md | 10 +- .../datetimerange_aggregation.md | 10 +- .../floatrange_aggregation.md | 10 +- .../floatstats_aggregation.md | 3 + .../integerrange_aggregation.md | 10 +- .../integerstats_aggregation.md | 3 + .../keywordterm_aggregation.md | 3 + .../languageterm_aggregation.md | 3 + .../locationchildrenterm_aggregation.md | 3 + .../objectstateterm_aggregation.md | 5 +- .../product_attribute_aggregations.md | 17 ++- .../productavailabilityterm_aggregation.md | 3 + .../productpricerange_aggregation.md | 8 +- .../productstockrange_aggregation.md | 10 +- .../producttypeterm_aggregation.md | 3 + .../rawrange_aggregation.md | 8 +- .../rawstats_aggregation.md | 3 + .../rawterm_aggregation.md | 3 + .../sectionterm_aggregation.md | 3 + .../selectionterm_aggregation.md | 3 + .../subtreeterm_aggregation.md | 3 + .../taxonomyentryid_aggregation.md | 8 +- .../timerange_aggregation.md | 13 +- .../usermetadataterm_aggregation.md | 3 + .../visibilityterm_aggregation.md | 3 + .../criteria_reference/ancestor_criterion.md | 14 +- .../criteria_reference/baseprice_criterion.md | 3 + .../checkboxattribute_criterion.md | 3 + .../colorattribute_criterion.md | 3 + .../criteria_reference/contentid_criterion.md | 4 + .../contentname_criterion.md | 4 + .../contenttypegroupid_criterion.md | 25 ++-- .../contenttypeid_criterion.md | 4 + .../contenttypeidentifier_criterion.md | 4 + .../criteria_reference/createdat_criterion.md | 3 + .../createdatrange_criterion.md | 3 + .../currencycode_criterion.md | 6 +- .../customergroupid_criterion.md | 4 + .../customprice_criterion.md | 4 + .../datemetadata_criterion.md | 8 ++ .../criteria_reference/depth_criterion.md | 4 + .../criteria_reference/field_criterion.md | 8 ++ .../fieldrelation_criterion.md | 4 + .../floatattribute_criterion.md | 3 + .../criteria_reference/fulltext_criterion.md | 16 +++ .../criteria_reference/image_criterion.md | 5 + .../imagedimensions_criterion.md | 6 +- .../imagefilesize_criterion.md | 6 +- .../imageheight_criterion.md | 6 +- .../imagemimetype_criterion.md | 12 +- .../imageorientation_criterion.md | 18 ++- .../imagewidth_criterion.md | 6 +- .../integerattribute_criterion.md | 3 + .../iscontainer_criterion.md | 4 + .../iscurrencyenabled_criterion.md | 6 +- .../isfieldempty_criterion.md | 8 ++ .../ismainlocation_criterion.md | 5 + .../isproductbased_criterion.md | 6 +- .../isuserbased_criterion.md | 4 + .../isuserenabled_criterion.md | 4 + .../criteria_reference/isvirtual_criterion.md | 3 + .../languagecode_criterion.md | 19 ++- .../locationid_criterion.md | 4 + .../locationremoteid_criterion.md | 4 + .../logicaland_criterion.md | 6 +- .../logicalnot_criterion.md | 8 +- .../criteria_reference/logicalor_criterion.md | 6 +- .../maplocationdistance_criterion.md | 4 + .../objectstateid_criterion.md | 4 + .../objectstateidentifier_criterion.md | 8 ++ .../order_company_associated_criterion.md | 3 + .../order_company_name_criterion.md | 3 + .../order_created_criterion.md | 3 + .../order_currency_code_criterion.md | 3 + .../order_customer_name_criterion.md | 3 + .../order_identifier_criterion.md | 3 + .../order_owner_criterion.md | 23 +++- .../order_price_criterion.md | 3 + .../order_source_criterion.md | 3 + .../order_status_criterion.md | 3 + .../parentlocationid_criterion.md | 11 ++ .../payment_createdat_criterion.md | 3 + .../payment_currency_criterion.md | 6 +- .../payment_id_criterion.md | 6 +- .../payment_identifier_criterion.md | 6 +- .../payment_logicaland_criterion.md | 16 ++- .../payment_logicalor_criterion.md | 16 ++- .../payment_method_createdat_criterion.md | 3 + .../payment_method_enabled_criterion.md | 6 +- .../payment_method_id_criterion.md | 6 +- .../payment_method_identifier_criterion.md | 6 +- .../payment_method_logicaland_criterion.md | 16 ++- .../payment_method_logicalor_criterion.md | 15 ++- .../payment_method_name_criterion.md | 6 +- .../payment_method_type_criterion.md | 9 +- .../payment_method_updatedat_criterion.md | 3 + .../payment_order_criterion.md | 9 +- .../payment_payment_method_criterion.md | 9 +- .../payment_status_criterion.md | 6 +- .../payment_updatedat_criterion.md | 3 + .../price_currency_criterion.md | 6 +- .../price_customergroup_criterion.md | 4 + .../price_isbaseprice_criterion.md | 3 + .../price_iscustomprice_criterion.md | 3 + .../price_logicaland_criterion.md | 11 +- .../price_logicalor_criterion.md | 14 +- .../price_product_criterion.md | 3 + .../criteria_reference/priority_criterion.md | 4 + .../productavailability_criterion.md | 3 + .../productcategory_criterion.md | 3 + .../productcode_criterion.md | 3 + .../productname_criterion.md | 3 + .../productstock_criterion.md | 6 + .../productstockrange_criterion.md | 3 + .../producttype_criterion.md | 3 + ...gemeasurementattributemaximum_criterion.md | 8 +- ...gemeasurementattributeminimum_criterion.md | 8 +- .../criteria_reference/remoteid_criterion.md | 4 + .../criteria_reference/sectionid_criterion.md | 4 + .../sectionidentifier_criterion.md | 4 + .../selectionattribute_criterion.md | 3 + .../shipment_createdat_criterion.md | 3 + .../shipment_currency_criterion.md | 5 +- .../shipment_id_criterion.md | 3 + .../shipment_identifier_criterion.md | 3 + .../shipment_logicaland_criterion.md | 9 +- .../shipment_logicalor_criterion.md | 9 +- .../shipment_owner_criterion.md | 20 ++- .../shipment_shipping_method_criterion.md | 4 + .../shipment_status_criterion.md | 3 + .../shipment_updatedat_criterion.md | 3 + .../criteria_reference/sibling_criterion.md | 9 ++ .../simplemeasurementattribute_criterion.md | 8 +- .../criteria_reference/subtree_criterion.md | 4 + .../criteria_reference/taxonomy_entry_id.md | 8 ++ .../criteria_reference/useremail_criterion.md | 8 ++ .../criteria_reference/userid_criterion.md | 4 + .../criteria_reference/userlogin_criterion.md | 8 ++ .../usermetadata_criterion.md | 8 ++ .../visibility_criterion.md | 4 + docs/search/search_api.md | 56 ++++++-- .../solr_search_engine/configure_solr.md | 2 +- .../shopping_list_criteria.md | 2 + .../baseprice_sort_clause.md | 4 + .../contentid_sort_clause.md | 4 + .../contentname_sort_clause.md | 4 + .../contenttranslatedname_sort_clause.md | 4 + .../contenttypename_sort_clause.md | 4 + .../createdat_sort_clause.md | 3 + .../customfield_sort_clause.md | 4 + .../customprice_sort_clause.md | 6 + .../datemodified_sort_clause.md | 4 + .../datepublished_sort_clause.md | 4 + .../datetrashed_sort_clause.md | 4 + .../depth_sort_clause.md | 5 +- .../field_sort_clause.md | 4 + .../sort_clause_reference/id_sort_clause.md | 3 + .../ismainlocation_sort_clause.md | 5 +- .../maplocationdistance_sort_clause.md | 4 + .../order_created_sort_clause.md | 4 + .../order_id_sort_clause.md | 4 + .../order_status_sort_clause.md | 4 + .../order_updated_sort_clause.md | 4 + .../sort_clause_reference/path_sort_clause.md | 4 + .../payment_createdat_sort_clause.md | 4 + .../payment_id_sort_clause.md | 4 + .../payment_identifier_sort_clause.md | 4 + .../payment_method_createdat_sort_clause.md | 4 + .../payment_method_enabled_sort_clause.md | 4 + .../payment_method_id_sort_clause.md | 4 + .../payment_method_identifier_sort_clause.md | 4 + .../payment_method_updatedat_sort_clause.md | 4 + .../payment_status_sort_clause.md | 4 + .../payment_updatedat_sort_clause.md | 4 + .../priority_sort_clause.md | 4 + .../productavailability_sort_clause.md | 3 + .../productcode_sort_clause.md | 3 + .../productname_sort_clause.md | 3 + .../random_sort_clause.md | 4 + .../score_sort_clause.md | 4 + .../sectionidentifier_sort_clause.md | 4 + .../sectionname_sort_clause.md | 4 + .../shipment_createdat_sort_clause.md | 3 + .../shipment_id_sort_clause.md | 3 + .../shipment_identifier_sort_clause.md | 3 + .../shipment_status_sort_clause.md | 3 + .../shipment_updatedat_sort_clause.md | 3 + .../userlogin_sort_clause.md | 4 + .../visibility_sort_clause.md | 4 + .../logicaland_url_criterion.md | 4 + .../logicalnot_url_criterion.md | 4 + .../logicalor_url_criterion.md | 4 + .../pattern_url_criterion.md | 4 + .../sectionid_url_criterion.md | 6 +- .../sectionidentifier_url_criterion.md | 4 + .../validity_url_criterion.md | 4 + .../search_term_aggregation_settings.md | 2 +- .../urls_and_routes/custom_breadcrumbs.md | 6 +- .../5_display_a_list_of_content_items.md | 8 +- .../beginner_tutorial/7_embed_content.md | 4 +- .../from_1.x_2.x/update_db_to_2.5.md | 12 +- .../update_code/2_update_configuration.md | 4 +- .../update_code/4_update_signal_slots.md | 10 +- .../from_2.5/update_code/8_update_rest.md | 8 +- .../from_4.3/update_from_4.3_new_commerce.md | 6 +- .../from_4.3/update_from_4.3_old_commerce.md | 2 +- .../from_4.6/update_from_4.6.md | 3 + .../from_4.6/update_to_5.0.md | 8 +- .../migrating_from_ez_publish_platform.md | 4 +- docs/users/segment_api.md | 2 +- docs/users/user_authentication.md | 2 +- phpstan-baseline.neon | 126 ++++++++++++++++++ 294 files changed, 1668 insertions(+), 397 deletions(-) diff --git a/code_samples/api/public_php_api/src/Command/SegmentCommand.php b/code_samples/api/public_php_api/src/Command/SegmentCommand.php index 3b3fdd5f0f..64c2c4d95c 100644 --- a/code_samples/api/public_php_api/src/Command/SegmentCommand.php +++ b/code_samples/api/public_php_api/src/Command/SegmentCommand.php @@ -64,6 +64,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int : 'The user is not assigned to the segment.' )); + $this->segmentationService->removeSegmentGroup($segmentGroup); + return self::SUCCESS; } } diff --git a/docs/administration/back_office/back_office_elements/formatting_date_and_time.md b/docs/administration/back_office/back_office_elements/formatting_date_and_time.md index ff14689b20..56ed659966 100644 --- a/docs/administration/back_office/back_office_elements/formatting_date_and_time.md +++ b/docs/administration/back_office/back_office_elements/formatting_date_and_time.md @@ -40,7 +40,7 @@ class MyService // your code } - public function foo() + public function foo(): void { // your code diff --git a/docs/administration/back_office/back_office_menus/back_office_menus.md b/docs/administration/back_office/back_office_menus/back_office_menus.md index 5ae4e704bb..8604a0663f 100644 --- a/docs/administration/back_office/back_office_menus/back_office_menus.md +++ b/docs/administration/back_office/back_office_menus/back_office_menus.md @@ -86,6 +86,7 @@ The following method adds a new menu section under **Content**, and under it, a You can also pass parameters to templates used to render menu items with `template_parameters`: ``` php +/** @var \Knp\Menu\ItemInterface $menu */ $menu->addChild( 'all_content_list', [ @@ -106,6 +107,7 @@ You can then use the variable `custom_parameter` in `templates/themes/admin/list To have translatable labels, use `translation.key` from the `messages` domain: ``` php +/** @var \Knp\Menu\ItemInterface $menu */ $menu->addChild( 'all_content_list', [ diff --git a/docs/administration/back_office/browser/browser.md b/docs/administration/back_office/browser/browser.md index 1addc5b3d8..6d3f8cd1a8 100644 --- a/docs/administration/back_office/browser/browser.md +++ b/docs/administration/back_office/browser/browser.md @@ -147,6 +147,11 @@ If an event listener catches additional parameters passed with context, it uses In the example below, the `johndoe` parameter enables the user to choose multiple items from a **Browser window** by changing `multiple: false` from `my_custom_udw` configuration to `multiple: true`. ```php hl_lines="29 30 31" + The event names to listen to */ - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ ConfigResolveEvent::NAME => 'onUdwConfigResolve', ]; } - /** - * @param \Ibexa\AdminUi\UniversalDiscovery\Event $event - */ - public function onUdwConfigResolve(ConfigResolveEvent $event) + public function onUdwConfigResolve(ConfigResolveEvent $event): void { if ($event->getConfigName() !== self::CONFIGURATION_NAME) { return; diff --git a/docs/administration/back_office/customize_calendar.md b/docs/administration/back_office/customize_calendar.md index 5e56e0a7cd..5c8d8f75d3 100644 --- a/docs/administration/back_office/customize_calendar.md +++ b/docs/administration/back_office/customize_calendar.md @@ -81,10 +81,16 @@ To add an in-memory collection as an event source, create `src/Calendar/Holidays For example: ``` php + use Ibexa\Contracts\Calendar\EventCollection; + use Ibexa\Contracts\Calendar\EventInterface; + use App\Calendar\Holidays\Event; + + /** @var \App\Calendar\Holidays\EventType $eventType */ $collection = new EventCollection([ - $this->createEvent("Event 1", new DateTime("2024-01-01")), - $this->createEvent("Event 2", new DateTime("2024-01-02")), + new Event("Event 1", new DateTime("2024-01-01"), $eventType), + new Event("Event 2", new DateTime("2024-01-02"), $eventType), // ... + ]); ``` Next, register the event source as a service: diff --git a/docs/administration/back_office/notifications.md b/docs/administration/back_office/notifications.md index 84ac4be9f8..1d59a3e537 100644 --- a/docs/administration/back_office/notifications.md +++ b/docs/administration/back_office/notifications.md @@ -26,7 +26,8 @@ There are four types of notifications: `info`, `success`, `warning` and `error`. To send a notification from PHP, inject the `TranslatableNotificationHandlerInterface` into your class. ``` php -$this->notificationHandler->info( +/** @var \Ibexa\Contracts\AdminUi\Notification\TranslatableNotificationHandlerInterface $notificationHandler */ +$notificationHandler->info( /** @Desc("Notification text") */ 'example.notification.text', [], diff --git a/docs/administration/configuration/configuration.md b/docs/administration/configuration/configuration.md index eb26f7ec2a..871f4c5f19 100644 --- a/docs/administration/configuration/configuration.md +++ b/docs/administration/configuration/configuration.md @@ -74,7 +74,8 @@ parameters: ``` php // Usage inside a controller -$myParameter = $this->container->getParameter( 'myapp.parameter.name' ); +/** @var \Symfony\Component\DependencyInjection\ContainerInterface $container */ +$myParameter = $container->getParameter( 'myapp.parameter.name' ); ``` ## Configuration settings diff --git a/docs/administration/configuration/dynamic_configuration.md b/docs/administration/configuration/dynamic_configuration.md index c847e0899d..e0688ac0b3 100644 --- a/docs/administration/configuration/dynamic_configuration.md +++ b/docs/administration/configuration/dynamic_configuration.md @@ -27,11 +27,11 @@ parameters: myapp.default.my_param: Default value ``` -Inside a controller, in `site_group` SiteAccess, you can use the parameters in the following way (the same applies for `hasParameter()`): +Inside a controller extending the `Ibexa\Core\MVC\Symfony\Controller\Controller` class, in `site_group` SiteAccess, you can use the parameters in the following way (the same applies for `hasParameter()`): -``` php +``` php skip-validation $configResolver = $this->getConfigResolver(); -  + // ibexa.site_access.config is the default namespace, so no need to specify it // The following will resolve ibexa.site_access.config..content.default_ttl // In the case of site_group, it will return 3600. @@ -81,20 +81,20 @@ For more information about dependency injection, see [Service container](php_api namespace App; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; -  + class Service { -  /** + /** * @var \Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface */ private $configResolver; -  - public function __construct( ConfigResolverInterface $configResolver ) + + public function __construct(ConfigResolverInterface $configResolver) { $this->configResolver = $configResolver; } - public function someMethodThatNeedConfig() + public function someMethodThatNeedConfig(): void { $configValue = $this->configResolver->getParameter('my_param', 'myapp'); } diff --git a/docs/administration/configuration/repository_configuration.md b/docs/administration/configuration/repository_configuration.md index 126b39e841..82f7066ade 100644 --- a/docs/administration/configuration/repository_configuration.md +++ b/docs/administration/configuration/repository_configuration.md @@ -327,6 +327,9 @@ final class CustomRepositoryConfigParser implements RepositoryConfigParserInterf You need to register this configuration extension in the following way: ``` php +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\HttpKernel\Bundle\Bundle; + final class AcmeFeatureBundle extends Bundle { public function build(ContainerBuilder $container): void @@ -343,5 +346,6 @@ final class AcmeFeatureBundle extends Bundle To access the configuration settings, use the `Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider::getRepositoryConfig` method: ``` php +/** @var \Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider $repositoryConfigProvider */ $acmeConfig = $repositoryConfigProvider->getRepositoryConfig()['acme']; ``` diff --git a/docs/ai_actions/configure_ai_actions.md b/docs/ai_actions/configure_ai_actions.md index 1611b11286..fe4fc3af7f 100644 --- a/docs/ai_actions/configure_ai_actions.md +++ b/docs/ai_actions/configure_ai_actions.md @@ -92,7 +92,10 @@ composer require ibexa/connector-gemini Then, if not using Symfony Flex, enable the bundle in `config/bundles.php`: ``` php +return [ + // ... Ibexa\Bundle\ConnectorGemini\IbexaConnectorGeminiBundle::class => ['all' => true], +]; ``` This command adds the feature code, including basic handlers that let you refine text or generate alternative text for images. diff --git a/docs/api/php_api/php_api.md b/docs/api/php_api/php_api.md index fe7d8b0c16..8f66fb3090 100644 --- a/docs/api/php_api/php_api.md +++ b/docs/api/php_api/php_api.md @@ -110,10 +110,13 @@ For example, to [hide a Location](managing_content.md#hiding-and-revealing-locat ``` php use Ibexa\Contracts\Core\Repository\Repository; +use Ibexa\Contracts\Core\Repository\Values\Content\Location; //... -$hiddenLocation = $repository->sudo(function (Repository $repository) use ($location) { +/** @var Repository $repository */ +/** @var Location $location */ +$hiddenLocation = $repository->sudo(function (Repository $repository) use ($location): Location { return $repository->getLocationService()->hideLocation($location); }); ``` diff --git a/docs/api/rest_api/extending_rest_api/creating_new_rest_resource.md b/docs/api/rest_api/extending_rest_api/creating_new_rest_resource.md index 37e53f8f0a..603de807a3 100644 --- a/docs/api/rest_api/extending_rest_api/creating_new_rest_resource.md +++ b/docs/api/rest_api/extending_rest_api/creating_new_rest_resource.md @@ -69,8 +69,12 @@ If the returned value was depending on a location, it could have been wrapped in `CachedValue` is used in the following way: ```php +use Ibexa\Rest\Server\Values\CachedValue; + +$locationId = 12345; + return new CachedValue( - new MyValue($args…), + new MyValue($args), ['locationId'=> $locationId] ); ``` diff --git a/docs/commerce/cart/cart_api.md b/docs/commerce/cart/cart_api.md index d8208d737a..5efbb62aca 100644 --- a/docs/commerce/cart/cart_api.md +++ b/docs/commerce/cart/cart_api.md @@ -69,6 +69,9 @@ use Ibexa\Contracts\Cart\Value\CartMetadataUpdateStruct; // ... +/** @var \Ibexa\Contracts\Core\Repository\UserService $userService */ +/** @var \Ibexa\Contracts\Cart\CartServiceInterface $cartService */ +/** @var \Ibexa\Contracts\Cart\Value\CartInterface $cart */ $updateMetadataStruct = new CartMetadataUpdateStruct(); $updateMetadataStruct->setOwner($userService->loadUserByLogin('user')); @@ -151,7 +154,13 @@ It can include any relevant information that you want to associate with a partic To add context data to a cart, follow this example: ```php -$createStruct = new CartCreateStruct(...); +use Ibexa\Contracts\Cart\Value\CartCreateStruct; +use Ibexa\Contracts\Core\Collection\ArrayMap; +use Ibexa\Contracts\ProductCatalog\Values\CurrencyInterface; + +/** @var \Ibexa\Contracts\Cart\CartServiceInterface $cartService */ +/** @var CurrencyInterface $currency */ +$createStruct = new CartCreateStruct('My Cart', $currency); $createStruct->setContext(new ArrayMap([ 'coupon_code' => 'X1MF7699', ])); @@ -167,7 +176,14 @@ You also add "X1MF7699" coupon code as context data to the cart. To attach context data to a cart entry, proceed as follows: ```php -$entryAddStruct = new EntryAddStruct(...); +use Ibexa\Contracts\Cart\Value\EntryAddStruct; +use Ibexa\Contracts\Core\Collection\ArrayMap; +use Ibexa\ProductCatalog\Local\Repository\Values\Product; + +/** @var \Ibexa\Contracts\Cart\CartServiceInterface $cartService */ +/** @var \Ibexa\Contracts\Cart\Value\CartInterface $cart */ +/** @var Product $product */ +$entryAddStruct = new EntryAddStruct($product); $entryAddStruct->setContext(new ArrayMap([ 'tshirt_text' => 'EqEqEqEq', ])); diff --git a/docs/commerce/shopping_list/install_shopping_list.md b/docs/commerce/shopping_list/install_shopping_list.md index 6dbfc025a5..7b59a7d8c4 100644 --- a/docs/commerce/shopping_list/install_shopping_list.md +++ b/docs/commerce/shopping_list/install_shopping_list.md @@ -18,7 +18,10 @@ The associated Symfony Flex recipe configures the bundle and its routes. Check that the following line has been added by the recipe to `config/bundles.php` file's array: ```php +return [ + // ... Ibexa\Bundle\ShoppingList\IbexaShoppingListBundle::class => ['all' => true], +]; ``` And that you have a `config/routes/ibexa_shopping_list.yaml` file configuring the following routes: diff --git a/docs/commerce/shopping_list/shopping_list_api.md b/docs/commerce/shopping_list/shopping_list_api.md index 1fea806f89..297b9694a1 100644 --- a/docs/commerce/shopping_list/shopping_list_api.md +++ b/docs/commerce/shopping_list/shopping_list_api.md @@ -41,7 +41,11 @@ and with sort clauses from the [`SortClause` namespace](/api/php_api/php_api_ref To get all shopping lists (of the current user or of the whole repository depending on the current user limitation), use the search method without criterion: ```php -$lists = $this->shoppingListService->findShoppingLists(new ShoppingListQuery()); +use Ibexa\Contracts\ShoppingList\ShoppingListServiceInterface; +use Ibexa\Contracts\ShoppingList\Value\ShoppingListQuery; + +/** @var ShoppingListServiceInterface $shoppingListService */ +$lists = $shoppingListService->findShoppingLists(new ShoppingListQuery()); ``` For more information about the shopping list search, @@ -57,11 +61,16 @@ In the following example, if some assignments (`$list =`) are removed, the dumpe If only the middle assignment is removed, the last dumped variable contains the up-to-date shopping list. ```php -$list = $this->shoppingListService->getOrCreateDefaultShoppingList(); +use Ibexa\Contracts\ShoppingList\ShoppingListServiceInterface; +use Ibexa\Contracts\ShoppingList\Value\EntryAddStruct; + +/** @var ShoppingListServiceInterface $shoppingListService */ +/** @var string $productCode */ +$list = $shoppingListService->getOrCreateDefaultShoppingList(); dump($list); -$list = $this->shoppingListService->clearShoppingList($list); +$list = $shoppingListService->clearShoppingList($list); dump($list); -$list = $this->shoppingListService->addEntries($list, [new EntryAddStruct($productCode)]); +$list = $shoppingListService->addEntries($list, [new EntryAddStruct($productCode)]); dump($list); ``` When adding array of entries with `ShoppingListService::addEntries()`, diff --git a/docs/commerce/storefront/extend_storefront.md b/docs/commerce/storefront/extend_storefront.md index 82fc5e0dff..511d763555 100644 --- a/docs/commerce/storefront/extend_storefront.md +++ b/docs/commerce/storefront/extend_storefront.md @@ -100,6 +100,12 @@ Define your own logic in a custom controller. Refer to the code snippet below and create your own file, for example, `CustomProductRenderController.php`: ``` php +use Ibexa\Contracts\ProductCatalog\Values\ProductInterface; +use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; +use Symfony\Component\HttpFoundation\Response; + +class CustomProductRenderController extends AbstractController +{ public function renderAction(ProductInterface $product): Response { return $this->render('@ibexadesign/storefront/product_card.html.twig', [ @@ -109,4 +115,5 @@ Refer to the code snippet below and create your own file, for example, `CustomPr 'is_relative' => true, ]); } +} ``` diff --git a/docs/commerce/transactional_emails/extend_transactional_emails.md b/docs/commerce/transactional_emails/extend_transactional_emails.md index 665ed1cb9a..8157931ee4 100644 --- a/docs/commerce/transactional_emails/extend_transactional_emails.md +++ b/docs/commerce/transactional_emails/extend_transactional_emails.md @@ -103,7 +103,7 @@ final class TransactionalMailFactoryEventSubscriber implements EventSubscriberIn $recipient = $event->getRecipient(); $profile = $event->getProfile(); $user = $recipient->getUser(); - + // Provide additional data if your profile has more attributes: $attributes = $profile->getAttributes(); $attributes[] = new Attribute('name', $user->getName()); @@ -120,8 +120,8 @@ final class TransactionalMailFactoryEventSubscriber implements EventSubscriberIn $profile->setSegmentations($segmentations); // Use the same mechanism to pass other profile data - $profile->setSubscriptions(...); - $profile->setDataCollection(...); + // $profile->setSubscriptions($subscriptions); + // $profile->setDataCollection($dataCollection); } } ``` @@ -164,4 +164,4 @@ final class ResolveCampaginEventSubscriber implements EventSubscriberInterface $event->setCampaign($campaign); } } -``` \ No newline at end of file +``` diff --git a/docs/content_management/content_api/browsing_content.md b/docs/content_management/content_api/browsing_content.md index 3f57158cf7..c93f02c8c0 100644 --- a/docs/content_management/content_api/browsing_content.md +++ b/docs/content_management/content_api/browsing_content.md @@ -104,7 +104,9 @@ You can get the current version's `VersionInfo` using [`ContentService::loadVers You can also specify the version number as the second argument to get Relations for a specific version: ``` php -$versionInfo = $this->contentService->loadVersionInfo($contentInfo, 2); +/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo */ +/** @var \Ibexa\Contracts\Core\Repository\ContentService $contentService */ +$versionInfo = $contentService->loadVersionInfo($contentInfo, 2); ``` `loadRelationList` provides an iterable [`RelationList`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-RelationList.html) object @@ -170,12 +172,18 @@ The repository is SiteAccess-aware, so languages defined by the SiteAccess are a To load a specific language, provide its language code when loading the content item: ``` php -$content = $this->contentService->loadContent($contentId, ['ger-DE']); +/** @var int $contentId */ +/** @var \Ibexa\Contracts\Core\Repository\ContentService $contentService */ +$content = $contentService->loadContent($contentId, ['ger-DE']); ``` To load all languages as a prioritized list, use `Language::ALL`: ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Language; + +/** @var \Ibexa\Contracts\Core\Repository\ContentService $contentService */ +/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Content $content */ $contentService->loadContent($content->id, Language::ALL); ``` @@ -203,8 +211,13 @@ You can do it through the `getMainLocation` method of the ContentInfo object. Next, use the `getParentLocation` method of the location object to access the parent location: ``` php +/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo */ $mainLocation = $contentInfo->getMainLocation(); -$output->writeln("Parent Location: " . $mainLocation->getParentLocation()->pathString); +$parentLocation = $mainLocation?->getParentLocation(); +if ($parentLocation !== null) { + $message = "Parent Location: " . $parentLocation->pathString; +} + ``` ## Getting content from a location @@ -223,10 +236,15 @@ The versions must have the same language. For example, to get the comparison between the `name` field of two versions: ```php -$versionFrom = $this->contentService->loadVersionInfo($contentInfo, $versionFromId); -$versionTo = $this->contentService->loadVersionInfo($contentInfo, $versionToId); - -$nameComparison = $this->comparisonService->compare($versionFrom, $versionTo)->getFieldValueDiffByIdentifier('name')->getComparisonResult(); +/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo */ +/** @var int $versionFromId */ +/** @var int $versionToId */ +/** @var \Ibexa\Contracts\Core\Repository\ContentService $contentService */ +/** @var \Ibexa\Contracts\VersionComparison\Service\VersionComparisonServiceInterface $comparisonService */ +$versionFrom = $contentService->loadVersionInfo($contentInfo, $versionFromId); +$versionTo = $contentService->loadVersionInfo($contentInfo, $versionToId); + +$nameComparison = $comparisonService->compare($versionFrom, $versionTo)->getFieldValueDiffByIdentifier('name')->getComparisonResult(); ``` `getComparisonResult` returns a `ComparisonResult` object, which depends on the field type being compared. diff --git a/docs/content_management/content_api/creating_content.md b/docs/content_management/content_api/creating_content.md index bed7373eb5..15266bf023 100644 --- a/docs/content_management/content_api/creating_content.md +++ b/docs/content_management/content_api/creating_content.md @@ -104,5 +104,8 @@ You can delete a single translation from a content item's version using [`Conten The method must be provided with a `VersionInfo` object and the code of the language to delete: ``` php -$this->contentService->deleteTranslationFromDraft($versionInfo, $language); +/** @var \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo $versionInfo */ +$languageCode = 'ger-DE'; +/** @var \Ibexa\Contracts\Core\Repository\ContentService $contentService */ +$contentService->deleteTranslationFromDraft($versionInfo, $languageCode); ``` diff --git a/docs/content_management/content_api/managing_content.md b/docs/content_management/content_api/managing_content.md index 976b53354c..72aa2bf61c 100644 --- a/docs/content_management/content_api/managing_content.md +++ b/docs/content_management/content_api/managing_content.md @@ -117,8 +117,12 @@ The content item is restored under its previous location. You can also provide a different location to restore in as a second argument: ``` php -$newParent = $this->locationService->loadLocation($location); -$this->trashService->recover($trashItem, $newParent); +/** @var \Ibexa\Contracts\Core\Repository\Values\Content\TrashItem $trashItem */ +/** @var \Ibexa\Contracts\Core\Repository\LocationService $locationService */ +/** @var \Ibexa\Contracts\Core\Repository\TrashService $trashService */ +$locationId = 12345; +$newParent = $locationService->loadLocation($locationId); +$trashService->recover($trashItem, $newParent); ``` You can also search through Trash items and sort the results using several public PHP API Search Criteria and Sort Clauses that have been exposed for `TrashService` queries. diff --git a/docs/content_management/field_types/field_type_reference/addressfield.md b/docs/content_management/field_types/field_type_reference/addressfield.md index d374937caa..e036100b2d 100644 --- a/docs/content_management/field_types/field_type_reference/addressfield.md +++ b/docs/content_management/field_types/field_type_reference/addressfield.md @@ -28,6 +28,8 @@ provided by the `ibexa/fieldtype-address` package. ### Example input ```php +use Ibexa\FieldTypeAddress\FieldType; + new FieldType\Value( 'My home address', 'PL', diff --git a/docs/content_management/field_types/field_type_reference/authorfield.md b/docs/content_management/field_types/field_type_reference/authorfield.md index c26c2dcb11..9446817f4f 100644 --- a/docs/content_management/field_types/field_type_reference/authorfield.md +++ b/docs/content_management/field_types/field_type_reference/authorfield.md @@ -19,7 +19,9 @@ This field type allows the storage and retrieval of one or more authors. For eac Example: ``` php -$authorList = Author\Value([ +use Ibexa\Core\FieldType\Author; + +$authorList = new Author\Value([ new Author\Author([ 'id' => 1, 'name' => 'Boba Fett', @@ -39,7 +41,7 @@ The hash format mostly matches the value object. It has the following key `autho Example -``` php +``` php skip-validation [ [ 'id' => 1, @@ -50,8 +52,8 @@ Example 'id' => 2, 'name' => 'Darth Vader', 'email' => 'darth.vader@example.com' - ] -] + ], +]; ``` ##### String representation @@ -85,6 +87,6 @@ Following `defaultAuthor` default value options are available as constants in use Ibexa\Core\FieldType\Author\Type; $settings = [ - "defaultAuthor" => Type::DEFAULT_VALUE_EMPTY + "defaultAuthor" => Type::DEFAULT_VALUE_EMPTY, ]; ``` diff --git a/docs/content_management/field_types/field_type_reference/binaryfilefield.md b/docs/content_management/field_types/field_type_reference/binaryfilefield.md index 3b7d612234..d115b6653e 100644 --- a/docs/content_management/field_types/field_type_reference/binaryfilefield.md +++ b/docs/content_management/field_types/field_type_reference/binaryfilefield.md @@ -47,6 +47,7 @@ The hash format mostly matches the value object. It has the following keys: Example: ```php +/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentCreateStruct $fileContentCreateStruct */ $fileContentCreateStruct->setField('file', new Ibexa\Core\FieldType\BinaryFile\Value([ 'fileName' => 'example.pdf', 'inputUri' => '/tmp/example_for_website.pdf', diff --git a/docs/content_management/field_types/field_type_reference/checkboxfield.md b/docs/content_management/field_types/field_type_reference/checkboxfield.md index 54380b2469..de54b2bdb4 100644 --- a/docs/content_management/field_types/field_type_reference/checkboxfield.md +++ b/docs/content_management/field_types/field_type_reference/checkboxfield.md @@ -20,16 +20,16 @@ The Value class of this field type contains the following properties: ``` php //Value object content examples -use Ibexa\Core\FieldType\Checkbox\Type; +use Ibexa\Core\FieldType\Checkbox\Value; // Instantiates a checkbox value with a default state (false) -$checkboxValue = new Checkbox\Value(); +$checkboxValue = new Value(); // Checked -$value->bool = true; +$checkboxValue->bool = true; // Unchecked -$value->bool = false; +$checkboxValue->bool = false; ``` ##### Constructor @@ -38,10 +38,10 @@ The `Checkbox\Value` constructor accepts a boolean value: ``` php // Constructor example -use Ibexa\Core\FieldType\Checkbox\Type; +use Ibexa\Core\FieldType\Checkbox\Value; // Instantiates a checkbox value with a checked state -$checkboxValue = new Checkbox\Value( true ); +$checkboxValue = new Value( true ); ``` ##### String representation diff --git a/docs/content_management/field_types/field_type_reference/countryfield.md b/docs/content_management/field_types/field_type_reference/countryfield.md index 521b06bd94..3d5502ecf9 100644 --- a/docs/content_management/field_types/field_type_reference/countryfield.md +++ b/docs/content_management/field_types/field_type_reference/countryfield.md @@ -12,7 +12,7 @@ This field type represents one or multiple countries. Example array: -``` php +``` php skip-validation [ "JP" => [ "Name" => "Japan", @@ -51,6 +51,7 @@ It's also available when setting value on the content field, by setting the valu ``` php // Value object content example +/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Content $content */ $content->fields["countries"] = [ "JP", "NO" ]; ``` @@ -68,6 +69,7 @@ The Value class of this field type contains the following properties: ``` php // Value object content example +/** @var \Ibexa\Core\FieldType\Country\Value $value */ $value->countries = [ "JP" => [ "Name" => "Japan", @@ -85,6 +87,7 @@ It expects an array as input. ``` php // Constructor example +use Ibexa\Core\FieldType\Country as Country; // Instantiates a Country Value object $countryValue = new Country\Value( diff --git a/docs/content_management/field_types/field_type_reference/dateandtimefield.md b/docs/content_management/field_types/field_type_reference/dateandtimefield.md index d0d5e3fd25..94cec9a836 100644 --- a/docs/content_management/field_types/field_type_reference/dateandtimefield.md +++ b/docs/content_management/field_types/field_type_reference/dateandtimefield.md @@ -110,6 +110,6 @@ The template called by the [`ibexa_render_field()` Twig function](field_twig_fun Example: -``` php +``` html+twig {{ ibexa_render_field(content, 'datetime') }} ``` diff --git a/docs/content_management/field_types/field_type_reference/emailaddressfield.md b/docs/content_management/field_types/field_type_reference/emailaddressfield.md index db376e9eee..ee1c1b6b92 100644 --- a/docs/content_management/field_types/field_type_reference/emailaddressfield.md +++ b/docs/content_management/field_types/field_type_reference/emailaddressfield.md @@ -21,10 +21,10 @@ The `Value` class of this field type contains the following properties: ``` php // Value object content example -use Ibexa\Core\FieldType\EmailAddress\Type; +use Ibexa\Core\FieldType\EmailAddress\Value; // Instantiates an EmailAddress Value object with default value (empty string) -$emailaddressValue = new Type\Value(); +$emailaddressValue = new Value(); // Email definition $emailaddressValue->email = "someuser@example.com"; @@ -38,10 +38,10 @@ It accepts a string as input. ``` php // Constructor example -use Ibexa\Core\FieldType\EmailAddress\Type; +use Ibexa\Core\FieldType\EmailAddress\Value; // Instantiates an EmailAddress Value object -$emailaddressValue = new Type\Value( "someuser@example.com" ); +$emailaddressValue = new Value( "someuser@example.com" ); ``` ##### String representation diff --git a/docs/content_management/field_types/field_type_reference/floatfield.md b/docs/content_management/field_types/field_type_reference/floatfield.md index ec09b0eeaf..b0e6a72122 100644 --- a/docs/content_management/field_types/field_type_reference/floatfield.md +++ b/docs/content_management/field_types/field_type_reference/floatfield.md @@ -30,12 +30,12 @@ The Value class of this field type contains the following properties: ``` php // Value object content example -use Ibexa\Core\FieldType\Float\Type; +use Ibexa\Core\FieldType\Float\Value as FloatValue; // Instantiates a Float Value object -$floatValue = new Type\Value(); +$floatValue = new FloatValue(); -$float->value = 284.773 +$floatValue->value = 284.773; ``` ##### Constructor @@ -46,10 +46,10 @@ It expects a numeric value with or without decimals. ``` php // Constructor example -use Ibexa\Core\FieldType\Float\Type; +use Ibexa\Core\FieldType\Float\Value as FloatValue; // Instantiates a Float Value object -$floatValue = new Type\Value( 284.773 ); +$floatValue = new FloatValue( 284.773 ); ``` ### Validation @@ -64,8 +64,7 @@ This field type supports `FloatValueValidator`, defining maximum and minimum flo ``` php // Validator configuration example in PHP -use Ibexa\Core\FieldType\Float\Type; - +/** @var \Ibexa\Contracts\Core\Repository\Repository $repository */ $contentTypeService = $repository->getContentTypeService(); $floatFieldCreateStruct = $contentTypeService->newFieldDefinitionCreateStruct( "float", "ibexa_float" ); diff --git a/docs/content_management/field_types/field_type_reference/imageassetfield.md b/docs/content_management/field_types/field_type_reference/imageassetfield.md index 65da261fd9..4bac72c2a2 100644 --- a/docs/content_management/field_types/field_type_reference/imageassetfield.md +++ b/docs/content_management/field_types/field_type_reference/imageassetfield.md @@ -32,6 +32,8 @@ Value object of `ibexa_image_asset` contains the following properties: ``` php // Value object content example +/** @var \Ibexa\Core\FieldType\ImageAsset\Value $imageAssetValue */ +/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo */ $imageAssetValue->destinationContentId = $contentInfo->id; $imageAssetValue->alternativeText = "Picture of an apple."; ``` @@ -44,6 +46,9 @@ It expects an ID of a content item representing asset and the alternative text. ``` php // Constructor example +use Ibexa\Core\FieldType\ImageAsset as ImageAsset; + +/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo */ // Instantiates a ImageAsset Value object $imageAssetValue = new ImageAsset\Value($contentInfo->id, "Picture of an apple."); ``` diff --git a/docs/content_management/field_types/field_type_reference/imagefield.md b/docs/content_management/field_types/field_type_reference/imagefield.md index 3752a8bef1..40377a8d0c 100644 --- a/docs/content_management/field_types/field_type_reference/imagefield.md +++ b/docs/content_management/field_types/field_type_reference/imagefield.md @@ -150,6 +150,9 @@ The variation service, `ibexa.field_type.ibexa_image.variation_service`, can be It expects a VersionInfo, the Image field, and the variation name as a string (`large`, `medium`, and more.): ``` php +/** @var \Ibexa\Contracts\Core\Variation\VariationHandler $imageVariationHandler */ +/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Field $imageField */ +/** @var \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo $versionInfo */ $variation = $imageVariationHandler->getVariation( $imageField, $versionInfo, 'large' ); @@ -165,8 +168,10 @@ As for any field type, there are several ways to input content to a field. For an Image, the quickest is to call `setField()` on the ContentStruct: ``` php +/** @var \Ibexa\Contracts\Core\Repository\ContentService $contentService */ +/** @var \Ibexa\Contracts\Core\Repository\ContentTypeService $contentTypeService */ $createStruct = $contentService->newContentCreateStruct( - $contentTypeService->loadContentType( 'image' ), + $contentTypeService->loadContentTypeByIdentifier( 'image' ), 'eng-GB' ); @@ -177,8 +182,10 @@ To customize the Image's alternative texts, you must first get an `Image\Value` For that, you can use the `Image\Value::fromString()` method that accepts the path to a local file: ``` php +/** @var \Ibexa\Contracts\Core\Repository\ContentService $contentService */ +/** @var \Ibexa\Contracts\Core\Repository\ContentTypeService $contentTypeService */ $createStruct = $contentService->newContentCreateStruct( - $contentTypeService->loadContentType( 'image' ), + $contentTypeService->loadContentTypeByIdentifier( 'image' ), 'eng-GB' ); @@ -190,6 +197,7 @@ $createStruct->setField( 'image', $imageField ); You can also provide a hash of `Image\Value` properties, either to `setField()`, or to the constructor: ``` php +/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentCreateStruct $createStruct */ $imageValue = new \Ibexa\Core\FieldType\Image\Value( [ 'id' => '/tmp/image.png', diff --git a/docs/content_management/field_types/field_type_reference/integerfield.md b/docs/content_management/field_types/field_type_reference/integerfield.md index c1eb8f3b9d..17da940854 100644 --- a/docs/content_management/field_types/field_type_reference/integerfield.md +++ b/docs/content_management/field_types/field_type_reference/integerfield.md @@ -26,7 +26,8 @@ The Value class of this field type contains the following properties: ``` php // Value object content example -$integer->value = 8 +/** @var \Ibexa\Core\FieldType\Integer\Value $integer */ +$integer->value = 8; ``` ##### Constructor diff --git a/docs/content_management/field_types/field_type_reference/isbnfield.md b/docs/content_management/field_types/field_type_reference/isbnfield.md index 8b4baf9c51..23ccd54ed6 100644 --- a/docs/content_management/field_types/field_type_reference/isbnfield.md +++ b/docs/content_management/field_types/field_type_reference/isbnfield.md @@ -33,8 +33,7 @@ The input passed into this field type is subject of ISBN validation depending on An example of this field setting is shown below and controls if input is validated as ISBN-13 or ISBN-10: ``` php -Array -( - [isISBN13] => true -) +[ + 'isISBN13' => true, +]; ``` diff --git a/docs/content_management/field_types/field_type_reference/keywordfield.md b/docs/content_management/field_types/field_type_reference/keywordfield.md index 1d1d09b35f..12a370792b 100644 --- a/docs/content_management/field_types/field_type_reference/keywordfield.md +++ b/docs/content_management/field_types/field_type_reference/keywordfield.md @@ -22,9 +22,9 @@ This field type stores one or several comma-separated keywords as a string or ar The Value class of this field type contains the following properties: -| Property | Type | Description | -|----------|------------|----------------------------------------| -| `$value` | `string[]` | Holds an array of keywords as strings. | +| Property | Type | Description | +|-----------|------------|----------------------------------------| +| `$values` | `string[]` | Holds an array of keywords as strings. | ``` php // Value object content example @@ -34,7 +34,7 @@ use Ibexa\Core\FieldType\Keyword\Value; $keywordValue = new Value(); // Sets an array of keywords as a value -$keyword->value = [ "php", "css3", "html5", "Ibexa Platform" ]; +$keywordValue->values = [ "php", "css3", "html5", "Ibexa Platform" ]; ``` #### Constructor diff --git a/docs/content_management/field_types/field_type_reference/maplocationfield.md b/docs/content_management/field_types/field_type_reference/maplocationfield.md index feaf4ef115..e0f64d78b4 100644 --- a/docs/content_management/field_types/field_type_reference/maplocationfield.md +++ b/docs/content_management/field_types/field_type_reference/maplocationfield.md @@ -38,6 +38,7 @@ Accepted keys are `latitude` (`float`), `longitude` (`float`), `address` (`strin ``` php // Constructor example +use Ibexa\Core\FieldType\MapLocation as MapLocation; // Instantiates a MapLocation Value object $MapLocationValue = new MapLocation\Value( diff --git a/docs/content_management/field_types/field_type_reference/matrixfield.md b/docs/content_management/field_types/field_type_reference/matrixfield.md index 1542ceeebd..7353e329d6 100644 --- a/docs/content_management/field_types/field_type_reference/matrixfield.md +++ b/docs/content_management/field_types/field_type_reference/matrixfield.md @@ -19,6 +19,8 @@ The Matrix field type is available via the Matrix Bundle provided by the [ibexa/ Example of input: ```php +use Ibexa\FieldTypeMatrix\FieldType; + new FieldType\Value([ new FieldType\Value\Row(['col1' => 'Row 1, Col 1', 'col2' => 'Row 1, Col 2']), new FieldType\Value\Row(['col1' => 'Row 2, Col 1', 'col2' => 'Row 2, Col 2']), @@ -47,6 +49,8 @@ If, after removing empty rows, the number of rows doesn't fulfill the configured For example, the following input doesn't validate if `Minimum number of rows` is set to 3, because the second row is empty: ```php +use Ibexa\FieldTypeMatrix\FieldType; + new FieldType\Value([ new FieldType\Value\Row(['col1' => 'Row 1, Col 1', 'col2' => 'Row 1, Col 2']), new FieldType\Value\Row(['col1' => '', 'col2' => '']), diff --git a/docs/content_management/field_types/field_type_reference/measurementfield.md b/docs/content_management/field_types/field_type_reference/measurementfield.md index 5db02da753..1d68944c67 100644 --- a/docs/content_management/field_types/field_type_reference/measurementfield.md +++ b/docs/content_management/field_types/field_type_reference/measurementfield.md @@ -45,10 +45,12 @@ Depending on the selected input type, the object resembles the following example ``` php // Simple input (single value) example -// @var MeasurementServiceInterface $measurementService +use Ibexa\Measurement\FieldType\MeasurementValue; + +/** @var \Ibexa\Contracts\Measurement\MeasurementServiceInterface $measurementService */ // Instantiates a Measurement Value object -$measurementValue = new Measurement\Value( +$measurementValue = new MeasurementValue( $measurementService->buildSimpleValue( 'length', 13.5, @@ -60,10 +62,12 @@ $measurementValue = new Measurement\Value( ``` php // Range input value example -// @var MeasurementServiceInterface $measurementService +use Ibexa\Measurement\FieldType\MeasurementValue; + +/** @var \Ibexa\Contracts\Measurement\MeasurementServiceInterface $measurementService */ // Instantiates a Measurement Value object -$measurementValue = new Measurement\Value( +$measurementValue = new MeasurementValue( $measurementService->buildRangeValue( 'volume', 0.5, diff --git a/docs/content_management/field_types/field_type_reference/mediafield.md b/docs/content_management/field_types/field_type_reference/mediafield.md index 42c04d15b9..a1d49b6a45 100644 --- a/docs/content_management/field_types/field_type_reference/mediafield.md +++ b/docs/content_management/field_types/field_type_reference/mediafield.md @@ -76,6 +76,7 @@ The field type supports `FileSizeValidator`, defining maximum size of media file use Ibexa\Core\FieldType\Media\Type; +/** @var \Ibexa\Contracts\Core\Repository\Repository $repository */ $contentTypeService = $repository->getContentTypeService(); $mediaFieldCreateStruct = $contentTypeService->newFieldDefinitionCreateStruct( "media", "ibexa_media" ); @@ -112,6 +113,7 @@ List of all available `mediaType` constants is defined in the `Ibexa\Core\FieldT use Ibexa\Core\FieldType\Media\Type; +/** @var \Ibexa\Contracts\Core\Repository\Repository $repository */ $contentTypeService = $repository->getContentTypeService(); $mediaFieldCreateStruct = $contentTypeService->newFieldDefinitionCreateStruct( "media", "ibexa_media" ); diff --git a/docs/content_management/field_types/field_type_reference/relationfield.md b/docs/content_management/field_types/field_type_reference/relationfield.md index 6f8b9a8543..08d02a58c3 100644 --- a/docs/content_management/field_types/field_type_reference/relationfield.md +++ b/docs/content_management/field_types/field_type_reference/relationfield.md @@ -28,6 +28,8 @@ The Value class of this field type contains the following properties: ``` php // Value object content example +/** @var \Ibexa\Core\FieldType\Relation\Value $relation */ +/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo */ $relation->destinationContentId = $contentInfo->id; ``` @@ -37,7 +39,9 @@ The `Relation\Value` constructor initializes a new value object with the value p ``` php // Constructor example +use Ibexa\Core\FieldType\Relation as Relation; +/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo */ // Instantiates a Relation Value object $relationValue = new Relation\Value( $contentInfo->id ); ``` diff --git a/docs/content_management/field_types/field_type_reference/relationlistfield.md b/docs/content_management/field_types/field_type_reference/relationlistfield.md index f920a2a9ae..45813c490e 100644 --- a/docs/content_management/field_types/field_type_reference/relationlistfield.md +++ b/docs/content_management/field_types/field_type_reference/relationlistfield.md @@ -29,7 +29,10 @@ This field type makes it possible to store and retrieve values of a relation to ``` php // Value object content example -$relationList->destinationContentId = [ +/** @var \Ibexa\Core\FieldType\RelationList\Value $relationList */ +/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo1 */ +/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo2 */ +$relationList->destinationContentIds = [ $contentInfo1->id, $contentInfo2->id, 170 @@ -43,7 +46,10 @@ It expects a mixed array as value. ``` php //Constructor example +use Ibexa\Core\FieldType\RelationList as RelationList; +/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo1 */ +/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo2 */ // Instantiates a RelationList Value object $relationListValue = new RelationList\Value( [ diff --git a/docs/content_management/field_types/field_type_reference/richtextfield.md b/docs/content_management/field_types/field_type_reference/richtextfield.md index 1729dbffd2..b4f9871ec3 100644 --- a/docs/content_management/field_types/field_type_reference/richtextfield.md +++ b/docs/content_management/field_types/field_type_reference/richtextfield.md @@ -71,6 +71,8 @@ You can use the [[= product_name_base =]] flavor of the DocBook format in PHP AP The following example shows how to pass DocBook content to a [create struct](creating_content.md#creating-content-item-draft): ``` php +/** @var \Ibexa\Contracts\Core\Repository\ContentService $contentService */ +/** @var \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType $contentType */ $contentCreateStruct = $contentService->newContentCreateStruct( $contentType, "eng-GB" ); $inputString = <<selection = 1; +$value->selection = [1]; // Multiple selection $value->selection = [ 1, 4, 5 ]; @@ -40,6 +41,7 @@ The `Selection\Value` constructor accepts an array of selected element identifie ``` php // Constructor example +use Ibexa\Core\FieldType\Selection as Selection; // Instanciates a selection value with items #1 and #2 selected $selectionValue = new Selection\Value( [ 1, 2 ] ); diff --git a/docs/content_management/field_types/field_type_reference/taxonomyentryassignmentfield.md b/docs/content_management/field_types/field_type_reference/taxonomyentryassignmentfield.md index 476c043d1f..bffb69a4f1 100644 --- a/docs/content_management/field_types/field_type_reference/taxonomyentryassignmentfield.md +++ b/docs/content_management/field_types/field_type_reference/taxonomyentryassignmentfield.md @@ -24,8 +24,11 @@ To be able to assign tags to the content, first, you need to add a `TaxonomyEntr Example using an `Ibexa\Taxonomy\FieldType\TaxonomyEntryAssignment\Value` object: ``` php -$taxonomyEntry1 = $this->taxonomyService->loadEntryByIdentifier('example_entry', 'tags'); -$taxonomyEntry2 = $this->taxonomyService->loadEntryByIdentifier('example_entry_2', 'tags'); +use Ibexa\Contracts\Taxonomy\Service\TaxonomyServiceInterface; + +/** @var TaxonomyServiceInterface $taxonomyService */ +$taxonomyEntry1 = $taxonomyService->loadEntryByIdentifier('example_entry', 'tags'); +$taxonomyEntry2 = $taxonomyService->loadEntryByIdentifier('example_entry_2', 'tags'); new \Ibexa\Taxonomy\FieldType\TaxonomyEntryAssignment\Value( [ $taxonomyEntry1, @@ -38,10 +41,14 @@ new \Ibexa\Taxonomy\FieldType\TaxonomyEntryAssignment\Value( Example using array: ``` php -[ +use Ibexa\Contracts\Taxonomy\Value\TaxonomyEntry; + +/** @var TaxonomyEntry $taxonomyEntry */ +/** @var TaxonomyEntry $taxonomyEntry2 */ +return [ 'taxonomy_entries' => [$taxonomyEntry, $taxonomyEntry2], // load entries using TaxonomyService 'taxonomy' => 'tags', -] +]; ``` ### Value object diff --git a/docs/content_management/field_types/field_type_reference/taxonomyentryfield.md b/docs/content_management/field_types/field_type_reference/taxonomyentryfield.md index 1fdbb9ec8b..d37fd40fdb 100644 --- a/docs/content_management/field_types/field_type_reference/taxonomyentryfield.md +++ b/docs/content_management/field_types/field_type_reference/taxonomyentryfield.md @@ -18,18 +18,20 @@ A `TaxonomyEntry` field accepts an array with an `Ibexa\Contracts\Taxonomy\Value Example using an `Ibexa\Taxonomy\FieldType\TaxonomyEntry\Value` object: ``` php -$taxonomyEntry = $this->taxonomyService->loadEntryByIdentifier('example_entry', 'tags'); -new \Ibexa\Taxonomy\FieldType\TaxonomyEntry\Value( - new \Ibexa\Contracts\Taxonomy\Value\TaxonomyEntry( - $taxonomyEntry - ) -); +use Ibexa\Contracts\Taxonomy\Service\TaxonomyServiceInterface; + +/** @var TaxonomyServiceInterface $taxonomyService */ +$taxonomyEntry = $taxonomyService->loadEntryByIdentifier('example_entry', 'tags'); +$taxonomyEntryField = new \Ibexa\Taxonomy\FieldType\TaxonomyEntry\Value($taxonomyEntry); ``` Example using array: ``` php -[ +use Ibexa\Contracts\Taxonomy\Value\TaxonomyEntry; + +/** @var TaxonomyEntry $taxonomyEntry */ +return [ 'taxonomy_entry' => $taxonomyEntry, // load Entry using TaxonomyService -] +]; ``` ### Value object @@ -46,14 +48,17 @@ The constructor accepts an `Ibexa\Contracts\Taxonomy\Value\TaxonomyEntry` object ``` php // Constructor example +use Ibexa\Contracts\Taxonomy\Service\TaxonomyServiceInterface; use Ibexa\Taxonomy\FieldType\TaxonomyEntry; // Fetches TaxonomyEntry from TaxonomyService -$taxonomyEntry = $this->taxonomyService->loadEntryByIdentifier('example_entry', 'tags'); -  -// Instantiates a checkbox value with a checked state +/** @var TaxonomyServiceInterface $taxonomyService */ +$taxonomyEntry = $taxonomyService->loadEntryByIdentifier('example_entry', 'tags'); + +// Instantiates a taxonomy entry value $taxonomyEntryFieldTypeValue = new TaxonomyEntry\Value($taxonomyEntry); ``` + #### String representation `taxonomyEntry` string identifier or empty string if no Taxonomy Entry is selected. diff --git a/docs/content_management/field_types/field_type_reference/textlinefield.md b/docs/content_management/field_types/field_type_reference/textlinefield.md index 7867869265..04ed186ff0 100644 --- a/docs/content_management/field_types/field_type_reference/textlinefield.md +++ b/docs/content_management/field_types/field_type_reference/textlinefield.md @@ -38,8 +38,8 @@ To set the validation properties, the `validateValidatorConfiguration()` method ```php [ 'StringLengthValidator' => [ - 'maxStringLength' => 60 + 'maxStringLength' => 60, 'minStringLength' => 1 ] -] +]; ``` diff --git a/docs/content_management/field_types/field_type_reference/timefield.md b/docs/content_management/field_types/field_type_reference/timefield.md index 8fc0bd7916..71e6448425 100644 --- a/docs/content_management/field_types/field_type_reference/timefield.md +++ b/docs/content_management/field_types/field_type_reference/timefield.md @@ -75,7 +75,7 @@ The Field definition of this field type can be configured with several options: use Ibexa\Core\FieldType\Time\Type; $settings = [ - "defaultType" => DateAndTime::DEFAULT_EMPTY + "defaultType" => Type::DEFAULT_EMPTY ]; ``` diff --git a/docs/content_management/field_types/field_type_reference/urlfield.md b/docs/content_management/field_types/field_type_reference/urlfield.md index 5a29baa0e2..1caac1b7e0 100644 --- a/docs/content_management/field_types/field_type_reference/urlfield.md +++ b/docs/content_management/field_types/field_type_reference/urlfield.md @@ -30,6 +30,7 @@ The Value class of this field type contains the following properties: ``` php // Value object content example +/** @var \Ibexa\Core\FieldType\Url\Value $url */ $url->link = "https://www.ibexa.co"; $url->text = "Ibexa"; ``` @@ -41,6 +42,7 @@ It expects two comma-separated strings, corresponding to the link and text. ``` php // Constructor example +use Ibexa\Core\FieldType\Url as Url; // Instantiates an Url Value object $UrlValue = new Url\Value( "https://www.ibexa.co/", "Ibexa" ); diff --git a/docs/content_management/field_types/field_type_search.md b/docs/content_management/field_types/field_type_search.md index 807726cb40..01cd2cc862 100644 --- a/docs/content_management/field_types/field_type_search.md +++ b/docs/content_management/field_types/field_type_search.md @@ -22,10 +22,12 @@ They're described below in further detail. To be able to query data properly an indexable field type also is required to return search specification. You must return an associative array of `Ibexa\Contracts\Core\Search\FieldType` instances from this method, which could look like: ```php -[ +use Ibexa\Contracts\Core\Search; + +return [ 'url' => new Search\FieldType\StringField(), 'text' => new Search\FieldType\StringField(), -] +]; ``` This example from the `Url` field type shows that the field type always returns two indexable values, both strings. diff --git a/docs/content_management/field_types/field_type_validation.md b/docs/content_management/field_types/field_type_validation.md index d2f9a5553a..23352400d9 100644 --- a/docs/content_management/field_types/field_type_validation.md +++ b/docs/content_management/field_types/field_type_validation.md @@ -25,7 +25,7 @@ For example, for the `ibexa_string` type, the validator schema could be: 'default' => 0, ], 'maxStringLength' => [ - 'type' => 'int' + 'type' => 'int', 'default' => null, ] ], diff --git a/docs/content_management/field_types/form_and_template.md b/docs/content_management/field_types/form_and_template.md index b5f0eba859..1843372219 100644 --- a/docs/content_management/field_types/form_and_template.md +++ b/docs/content_management/field_types/form_and_template.md @@ -25,30 +25,35 @@ You have to add your form type to the content editing form. The example shows ho ``` php use Ibexa\Contracts\ContentForms\Data\Content\FieldData; +use Ibexa\Contracts\ContentForms\FieldType\FieldValueFormMapperInterface; use Ibexa\ContentForms\Form\Type\FieldType\CheckboxFieldType; use Symfony\Component\Form\FormInterface; -public function mapFieldValueForm(FormInterface $fieldForm, FieldData $data) +class MyMapper implements FieldValueFormMapperInterface { - $fieldDefinition = $data->fieldDefinition; - $formConfig = $fieldForm->getConfig(); - - $fieldForm - ->add( - $formConfig->getFormFactory()->createBuilder() - ->create( - 'value', - CheckboxFieldType::class, - [ - 'required' => $fieldDefinition->isRequired, - 'label' => $fieldDefinition->getName( - $formConfig->getOption('languageCode') - ), - ] - ) - ->setAutoInitialize(false) - ->getForm() - ); + /** @param FormInterface $fieldForm */ + public function mapFieldValueForm(FormInterface $fieldForm, FieldData $data): void + { + $fieldDefinition = $data->getFieldDefinition(); + $formConfig = $fieldForm->getConfig(); + + $fieldForm + ->add( + $formConfig->getFormFactory()->createBuilder() + ->create( + 'value', + CheckboxFieldType::class, + [ + 'required' => $fieldDefinition->isRequired, + 'label' => $fieldDefinition->getName( + $formConfig->getOption('languageCode') + ), + ] + ) + ->setAutoInitialize(false) + ->getForm() + ); + } } ``` @@ -64,37 +69,43 @@ You can use a [`DataTransformer`]([[= symfony_doc =]]/form/data_transformers.htm Providing definition editing support is almost identical to creating content editing support. The only difference are field names: ``` php +use Ibexa\AdminUi\FieldType\FieldDefinitionFormMapperInterface; use Ibexa\AdminUi\Form\Data\FieldDefinitionData; use Ibexa\ContentForms\Form\Type\FieldType\CountryFieldType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\FormInterface; -public function mapFieldDefinitionForm(FormInterface $fieldDefinitionForm, FieldDefinitionData $data) + +class MyMapper implements FieldDefinitionFormMapperInterface { - $fieldDefinitionForm - ->add( - 'isMultiple', - CheckboxType::class, [ - 'required' => false, - 'property_path' => 'fieldSettings[isMultiple]', - 'label' => 'field_definition.ibexa_country.is_multiple', - ] - ) - ->add( - $fieldDefinitionForm->getConfig()->getFormFactory()->createBuilder() - ->create( - 'defaultValue', - CountryFieldType::class, [ - 'choices_as_values' => true, - 'multiple' => true, - 'expanded' => false, - 'required' => false, - 'label' => 'field_definition.ibexa_country.default_value', - ] - ) - // Deactivate auto-initialize as you're not on the root form. - ->setAutoInitialize(false)->getForm() - ); + /** @param FormInterface $fieldDefinitionForm */ + public function mapFieldDefinitionForm(FormInterface $fieldDefinitionForm, FieldDefinitionData $data): void + { + $fieldDefinitionForm + ->add( + 'isMultiple', + CheckboxType::class, [ + 'required' => false, + 'property_path' => 'fieldSettings[isMultiple]', + 'label' => 'field_definition.ibexa_country.is_multiple', + ] + ) + ->add( + $fieldDefinitionForm->getConfig()->getFormFactory()->createBuilder() + ->create( + 'defaultValue', + CountryFieldType::class, [ + 'choices_as_values' => true, + 'multiple' => true, + 'expanded' => false, + 'required' => false, + 'label' => 'field_definition.ibexa_country.default_value', + ] + ) + // Deactivate auto-initialize as you're not on the root form. + ->setAutoInitialize(false)->getForm() + ); + } } ``` diff --git a/docs/content_management/file_management/file_management.md b/docs/content_management/file_management/file_management.md index bedce65245..948ba64762 100644 --- a/docs/content_management/file_management/file_management.md +++ b/docs/content_management/file_management/file_management.md @@ -9,8 +9,10 @@ description: Configurations and management of binary files. To access binary files from the PHP API, use the `Ibexa\Core\IO\IOServiceInterface::loadBinaryFile()` method: ```php -$file = $this->ioService->loadBinaryFile($field->value->id); -$fileContent = $this->ioService->getFileContents($file); +/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Field $field */ +/** @var \Ibexa\Core\IO\IOServiceInterface $ioService */ +$file = $ioService->loadBinaryFile($field->value->id); +$fileContent = $ioService->getFileContents($file); ``` ## Handling binary files diff --git a/docs/content_management/images/configure_image_editor.md b/docs/content_management/images/configure_image_editor.md index ed37e270ec..8214f219aa 100644 --- a/docs/content_management/images/configure_image_editor.md +++ b/docs/content_management/images/configure_image_editor.md @@ -52,7 +52,9 @@ By default, additional information stores the coordinates of the [focal point]([ To modify the value of additional information programmatically, you can set a value of the `Image` field by using the PHP API, for example: ``` php -new FieldValue([ +use Ibexa\Core\FieldType\Image\Value as FieldValue; + +$value = new FieldValue([ 'data' => [ 'width' => '100', 'height' => '200', @@ -66,5 +68,5 @@ new FieldValue([ 'author' => 'John Smith', ], ], - ]), + ]); ``` diff --git a/docs/content_management/taxonomy/taxonomy_api.md b/docs/content_management/taxonomy/taxonomy_api.md index 613abecde4..98ea9ff85b 100644 --- a/docs/content_management/taxonomy/taxonomy_api.md +++ b/docs/content_management/taxonomy/taxonomy_api.md @@ -21,9 +21,11 @@ and use `TaxonomyServiceInterface::loadEntryByIdentifier()`: A taxonomy entry identifier is unique per taxonomy. If you have [several taxonomies](taxonomy.md#customize-taxonomy-structure), you can increase code readability by always passing the taxonomy identifier even when it's the default one. The default taxonomy is `tags` if it exists, else the first configured taxonomy (see `\Ibexa\Taxonomy\Service\TaxonomyConfiguration::getDefaultTaxonomyName` for details). ``` php - $springs[] = $this->taxonomyService->loadEntryByIdentifier('spring', 'tags'); - $springs[] = $this->taxonomyService->loadEntryByIdentifier('spring', 'events'); - $springs[] = $this->taxonomyService->loadEntryByIdentifier('spring', 'devices'); + /** @var array $springs */ + /** @var \Ibexa\Contracts\Taxonomy\Service\TaxonomyServiceInterface $taxonomyService */ + $springs[] = $taxonomyService->loadEntryByIdentifier('spring', 'tags'); + $springs[] = $taxonomyService->loadEntryByIdentifier('spring', 'events'); + $springs[] = $taxonomyService->loadEntryByIdentifier('spring', 'devices'); ``` You can also get a taxonomy entry from the ID of its underlying content item, by using `TaxonomyServiceInterface::loadEntryByContentId()`. diff --git a/docs/content_management/url_management/url_management.md b/docs/content_management/url_management/url_management.md index ed56dadc75..ccf5b183cc 100644 --- a/docs/content_management/url_management/url_management.md +++ b/docs/content_management/url_management/url_management.md @@ -119,7 +119,7 @@ interface URLHandlerInterface * * @param \Ibexa\Contracts\Core\Repository\Values\URL\URL[] $urls */ - public function validate(array $urls); + public function validate(array $urls): void; } ``` @@ -249,12 +249,13 @@ The **URL wildcards** tab contains all the information about each URL wildcard. You can create URL wildcards with the public PHP API by using the `URLWildcardService` service: ``` php +/** @var \Ibexa\Contracts\Core\Repository\Repository $repository */ $source = 'pictures/*/*'; $destination = 'media/images/{1}/{2}'; $redirect = true; $urlWildcardService = $repository->getURLWildcardService(); -$repository->sudo(function ($repository) use ($urlWildcardService, $source, $destination, $redirect) { +$repository->sudo(function ($repository) use ($urlWildcardService, $source, $destination, $redirect): void { $urlWildcardService->create($source, $destination, $redirect); }); ``` diff --git a/docs/content_management/workflow/add_custom_workflow_action.md b/docs/content_management/workflow/add_custom_workflow_action.md index fc8c8fdcf7..77df1169d2 100644 --- a/docs/content_management/workflow/add_custom_workflow_action.md +++ b/docs/content_management/workflow/add_custom_workflow_action.md @@ -81,6 +81,8 @@ You can also modify the context using the `setContext()` method. For example, you can override the message typed by the user: ``` php +/** @var array $context */ +/** @var \Symfony\Component\Workflow\Event\TransitionEvent $event */ $new_context = $context; $new_context['message'] = "This article went through proofreading"; $event->setContext($new_context); diff --git a/docs/infrastructure_and_maintenance/cache/http_cache/content_aware_cache.md b/docs/infrastructure_and_maintenance/cache/http_cache/content_aware_cache.md index 6e93ca73d3..2a7a5d7216 100644 --- a/docs/infrastructure_and_maintenance/cache/http_cache/content_aware_cache.md +++ b/docs/infrastructure_and_maintenance/cache/http_cache/content_aware_cache.md @@ -173,6 +173,8 @@ Examples for adding specific content tags using the autowireable `ContentTagInte ``` php /** @var \Ibexa\Contracts\HttpCache\Handler\ContentTagInterface $tagHandler */ +/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Content $content */ +/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Location $location */ // Example for tagging everything needed for Content: $tagHandler->addContentTags([$content->id]); @@ -192,6 +194,8 @@ In PHP, FOSHttpCache exposes the `fos_http_cache.http.symfony_response_tagger` s The following example adds minimal tags when ID 33 and 34 are rendered in ESI, but parent response needs these tags to get refreshed if they're deleted: ``` php +use Ibexa\Contracts\HttpCache\Handler\ContentTagInterface; + /** @var \FOS\HttpCacheBundle\Http\SymfonyResponseTagger $responseTagger */ $responseTagger->addTags([ContentTagInterface::RELATION_PREFIX . '33', ContentTagInterface::RELATION_PREFIX . '34']); ``` @@ -205,7 +209,7 @@ It supports singular and comma-separated location ID value(s): ```php /** @var \Symfony\Component\HttpFoundation\Response $response */ -$response->headers->set('X-Location-Id', 123); +$response->headers->set('X-Location-Id', '123'); // Alternatively using several Location ID values $response->headers->set('X-Location-Id', '123,212,42'); @@ -324,7 +328,10 @@ While the system purges tags whenever API is used to change data, you may need t For that you can use the built-in purge client: ```php +use Ibexa\Contracts\HttpCache\Handler\ContentTagInterface; + /** @var \Ibexa\Contracts\HttpCache\PurgeClient\PurgeClientInterface $purgeClient */ +/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Location $location */ // Example for purging by Location ID: $purgeClient->purge([ContentTagInterface::LOCATION_PREFIX . $location->id]); diff --git a/docs/infrastructure_and_maintenance/cache/http_cache/context_aware_cache.md b/docs/infrastructure_and_maintenance/cache/http_cache/context_aware_cache.md index 9d299b4f34..70ae95df57 100644 --- a/docs/infrastructure_and_maintenance/cache/http_cache/context_aware_cache.md +++ b/docs/infrastructure_and_maintenance/cache/http_cache/context_aware_cache.md @@ -92,8 +92,11 @@ This a low effort solution, and can be enough for one fragment that is reused ac Example: ```php - // Inside a custom controller action, or even a Content View controller - $response->setVary('Cookie'); +use Symfony\Component\HttpFoundation\Response; + +// Inside a custom controller action, or even a Content View controller +/** @var Response $response */ +$response->setVary('Cookie'); ``` 2\. Ajax/JS lookup to "uncached" custom Symfony controllers: @@ -140,14 +143,27 @@ To avoid overloading any application code, take advantage of Symfony's event sys 1\. Add a [Response event (`kernel.response`)]([[= symfony_doc =]]/reference/events.html#kernel-response) [listener or subscriber]([[= symfony_doc =]]/event_dispatcher.html) to add your own hash to `/_fos_user_context_hash`: ```php -public function addPreferenceHash(FilterResponseEvent $event) +use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\HttpKernel\Event\ResponseEvent; + +final class MyEventSubscriber implements EventSubscriberInterface { - $response = $event->getResponse(); - if ($response->headers->get('Content-Type') !== 'application/vnd.fos.user-context-hash') { - return; + public static function getSubscribedEvents(): array + { + return [ + ResponseEvent::class => 'addPreferenceHash', + ]; } - $response->headers->set('X-User-Preference-Hash', ''); + public function addPreferenceHash(ResponseEvent $event): void + { + $response = $event->getResponse(); + if ($response->headers->get('Content-Type') !== 'application/vnd.fos.user-context-hash') { + return; + } + + $response->headers->set('X-User-Preference-Hash', ''); + } } ``` @@ -187,6 +203,9 @@ public function addPreferenceHash(FilterResponseEvent $event) 3\. Add `Vary` in your custom controller or content view controller: ```php +use Symfony\Component\HttpFoundation\Response; + +/** @var Response $response */ $response->setVary('X-User-Preference-Hash'); // If you _also_ need to vary on [[= product_name =]] permissions, instead use: diff --git a/docs/infrastructure_and_maintenance/cache/http_cache/reverse_proxy.md b/docs/infrastructure_and_maintenance/cache/http_cache/reverse_proxy.md index 3cb48b9002..dca195f828 100644 --- a/docs/infrastructure_and_maintenance/cache/http_cache/reverse_proxy.md +++ b/docs/infrastructure_and_maintenance/cache/http_cache/reverse_proxy.md @@ -91,7 +91,10 @@ framework: For this reason, the `TRUSTED_PROXIES` env variable supports being set to value `REMOTE_ADDR`, which is equal to: ```php - Request::setTrustedProxies([$request->server->get('REMOTE_ADDR')], Request::HEADER_X_FORWARDED_ALL); + use Symfony\Component\HttpFoundation\Request; + + /** @var \Symfony\Component\HttpFoundation\Request $request */ + Request::setTrustedProxies([$request->server->get('REMOTE_ADDR')], Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PROTO | Request::HEADER_X_FORWARDED_PORT); ``` When trusting remote IP like this, make sure your application is only accessible through Varnish. diff --git a/docs/infrastructure_and_maintenance/cache/persistence_cache.md b/docs/infrastructure_and_maintenance/cache/persistence_cache.md index 4b34d52a2d..28b48f4b4d 100644 --- a/docs/infrastructure_and_maintenance/cache/persistence_cache.md +++ b/docs/infrastructure_and_maintenance/cache/persistence_cache.md @@ -249,10 +249,14 @@ This service is an instance of `Symfony\Component\Cache\Adapter\TagAwareAdapterI Like any other service, you can also get the cache service with the [service container](php_api.md#service-container) like so: ``` php +use Symfony\Component\Cache\Adapter\TagAwareAdapterInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; + // Getting the cache service in PHP -/** @var \Symfony\Component\Cache\Adapter\TagAwareAdapterInterface */ +/** @var ContainerInterface $container */ $pool = $container->get('ibexa.cache_pool'); +/** @var TagAwareAdapterInterface $pool */ ``` ### Using the cache service @@ -260,13 +264,19 @@ $pool = $container->get('ibexa.cache_pool'); Example usage of the cache service: ``` php +use Symfony\Component\Cache\Adapter\TagAwareAdapterInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; + // Example +/** @var TagAwareAdapterInterface $pool */ +/** @var ContainerInterface $container */ +/** @var int $id */ $cacheItem = $pool->getItem("myApp-object-${id}"); if ($cacheItem->isHit()) { return $cacheItem->get(); } -$myObject = $container->get('my_app.backend_service')->loadObject($id) +$myObject = $container->get('my_app.backend_service')->loadObject($id); $cacheItem->set($myObject); $cacheItem->tag(['myApp-category-' . $myObject->categoryId]); $pool->save($cacheItem); @@ -281,6 +291,10 @@ For more info on usage, see [Symfony Cache's documentation]([[= symfony_doc =]]/ Persistence cache prefixes it's cache using "ibx-". Clearing persistence cache can thus be done in the following ways: ``` php +use Symfony\Component\Cache\Adapter\TagAwareAdapterInterface; + +/** @var TagAwareAdapterInterface $pool */ +/** @var int $contentId */ // To clear all cache (not recommended without a good reason) $pool->clear(); diff --git a/docs/multisite/languages/back_office_translations.md b/docs/multisite/languages/back_office_translations.md index 2cc69f5143..cfec823433 100644 --- a/docs/multisite/languages/back_office_translations.md +++ b/docs/multisite/languages/back_office_translations.md @@ -58,23 +58,25 @@ The method takes as arguments: - domain of the string Here's an example: -``` php hl_lines="13 14 15" -use Symfony\Component\Translation\TranslatorInterface; - -private $translator; - -public function __construct(TranslatorInterface $translator) -{ - $this->translator = $translator; -} - -private function getTranslatedDescription(): string -{ - return $this->translator->trans( - 'custom.extension.description', - [], - 'custom_extension' - ); +``` php hl_lines="14-16" +use Symfony\Contracts\Translation\TranslatorInterface; + +final class MyService { + private TranslatorInterface $translator; + + public function __construct(TranslatorInterface $translator) + { + $this->translator = $translator; + } + + public function getTranslatedDescription(): string + { + return $this->translator->trans( + 'custom.extension.description', + [], + 'custom_extension' + ); + } } ``` diff --git a/docs/multisite/siteaccess/injecting_siteaccess.md b/docs/multisite/siteaccess/injecting_siteaccess.md index 66d6f862c8..43d52d38ab 100644 --- a/docs/multisite/siteaccess/injecting_siteaccess.md +++ b/docs/multisite/siteaccess/injecting_siteaccess.md @@ -26,12 +26,8 @@ use Ibexa\Core\MVC\Symfony\SiteAccess\SiteAccessServiceInterface; class MyService { - /** @var \Ibexa\Contracts\Core\Repository\ContentService */ - private $contentService; - - /** @var \Ibexa\Core\MVC\Symfony\SiteAccess\SiteAccessServiceInterface */ - private $siteAccessService; - + private ContentService $contentService; + private SiteAccessServiceInterface $siteAccessService; public function __construct( SiteAccessServiceInterface $siteAccessService, ContentService $contentService diff --git a/docs/multisite/siteaccess/siteaccess_aware_configuration.md b/docs/multisite/siteaccess/siteaccess_aware_configuration.md index 1d3a656ab4..b3d72943b4 100644 --- a/docs/multisite/siteaccess/siteaccess_aware_configuration.md +++ b/docs/multisite/siteaccess/siteaccess_aware_configuration.md @@ -27,8 +27,11 @@ For more information about the ConfigResolver, namespaces and scopes, see [confi The example below assumes you're using an `Acme\ExampleBundle`. Remember to register the bundle by adding it to `config/bundles.php`: -``` php -Acme\ExampleBundle\AcmeExampleBundle::class => ['all' => true], +``` php skip-validation +return [ + // ... + Acme\ExampleBundle\AcmeExampleBundle::class => ['all' => true], +]; ``` ### Parsing semantic configuration diff --git a/docs/permissions/custom_policies.md b/docs/permissions/custom_policies.md index 27df7b67c5..4d8268adef 100644 --- a/docs/permissions/custom_policies.md +++ b/docs/permissions/custom_policies.md @@ -21,7 +21,7 @@ Function value is an array of available limitations, identified by the alias dec If no limitation is provided, value can be `null` or an empty array. ``` php -[ +$config = [ "content" => [ "read" => ["Class", "ParentClass", "Node", "Language"], "edit" => ["Class", "ParentClass", "Language"] @@ -30,7 +30,7 @@ If no limitation is provided, value can be `null` or an empty array. "custom_function_1" => null, "custom_function_2" => ["CustomLimitation"] ], -] +]; ``` Limitations need to be implemented as *Limitation types* and declared as services identified with `ibexa.permissions.limitation_type` tag. @@ -48,7 +48,7 @@ use Ibexa\Bundle\Core\DependencyInjection\Security\PolicyProvider\PolicyProvider class MyPolicyProvider implements PolicyProviderInterface { - public function addPolicies(ConfigBuilderInterface $configBuilder) + public function addPolicies(ConfigBuilderInterface $configBuilder): void { $configBuilder->addConfig([ "custom_module" => [ @@ -102,10 +102,12 @@ namespace App\Security; use Ibexa\Bundle\Core\DependencyInjection\Configuration\ConfigBuilderInterface; use Ibexa\Bundle\Core\DependencyInjection\Security\PolicyProvider\PolicyProviderInterface; +use JMS\TranslationBundle\Model\Message; +use JMS\TranslationBundle\Translation\TranslationContainerInterface; class MyPolicyProvider implements PolicyProviderInterface, TranslationContainerInterface { - public function addPolicies(ConfigBuilderInterface $configBuilder) + public function addPolicies(ConfigBuilderInterface $configBuilder): void { $configBuilder->addConfig([ "custom_module" => [ @@ -115,6 +117,7 @@ class MyPolicyProvider implements PolicyProviderInterface, TranslationContainerI ]); } + /** @return array<\JMS\TranslationBundle\Model\Message> */ public static function getTranslationMessages(): array { return [ diff --git a/docs/permissions/permission_overview.md b/docs/permissions/permission_overview.md index 6a8b2f1dbe..dc2b4502ad 100644 --- a/docs/permissions/permission_overview.md +++ b/docs/permissions/permission_overview.md @@ -38,7 +38,7 @@ You can control access to a custom controller by implementing the `performAccess In the following example the user doesn't have access to the controller unless they have the `section/view` policy: -``` php +``` php skip-validation use Ibexa\Core\MVC\Symfony\Security\Authorization\Attribute; public function performAccessCheck(): void @@ -63,7 +63,7 @@ public function performAccessCheck(): void To check if a user has access to an operation, use the `isGranted()` method. For example, to check if content can be assigned to a Section: -``` php +``` php skip-validation $hasAccess = $this->isGranted( new Attribute('section', 'assign', ['valueObject' => $contentInfo, 'targets' => [$section]]) ); @@ -79,6 +79,6 @@ checks the `content/edit` permission for the provided content item at the provid To block access to a specific action of the controller, add the following to the action's definition: -``` php +``` php skip-validation $this->denyAccessUnlessGranted(new Attribute('state', 'administrate')); ``` diff --git a/docs/personalization/enable_personalization.md b/docs/personalization/enable_personalization.md index 7d3d2b4f17..5c66279b2c 100644 --- a/docs/personalization/enable_personalization.md +++ b/docs/personalization/enable_personalization.md @@ -491,7 +491,7 @@ You can retrieve data returned from the Personalization server and modify it bef To modify recommendation data, subscribe to `RecommendationResponseEvent`. See [`Event/Subscriber/RecommendationEventSubscriber.php`](https://github.com/ibexa/personalization-client/blob/main/src/lib/Event/Subscriber/RecommendationEventSubscriber.php) for an example: -``` php +``` php skip-validation public static function getSubscribedEvents(): array { return [ diff --git a/docs/personalization/integrate_recommendation_service.md b/docs/personalization/integrate_recommendation_service.md index a2049f526c..e42d07ecdf 100644 --- a/docs/personalization/integrate_recommendation_service.md +++ b/docs/personalization/integrate_recommendation_service.md @@ -34,7 +34,7 @@ The following examples show how you can integrate a CLICK event: PHP: -``` php +``` php skip-validation $mandator_id = '00000'; $content_type_id = '1'; $product_id = '123'; @@ -57,7 +57,7 @@ ycimg.src=url; A similar tracking image can be placed on a confirmation page that ends the payment process. -``` php +``` php skip-validation $server = '//event.perso.ibexa.co'; foreach ($just_bought_products as $product_id) { $tracking = $server.'/api/'.$mandator_id.'/buy/'.urlencode(user_id()).$content_type_id.$product_id; @@ -122,7 +122,7 @@ A response with two recommendations resembles the following object: You can use the following code to make requests and parse results: -``` php +``` php skip-validation $mandator_id = '00000'; $license_key = '67890-1234-5678-90123-4567'; $server = "https://reco.perso.ibexa.co"; diff --git a/docs/release_notes/ez_platform_v2.4.md b/docs/release_notes/ez_platform_v2.4.md index 16d92cbdb2..4fb51d888b 100644 --- a/docs/release_notes/ez_platform_v2.4.md +++ b/docs/release_notes/ez_platform_v2.4.md @@ -182,7 +182,7 @@ The biggest benefit of this feature is saving load time on complex landing pages 1\. Register `LexikJWTAuthenticationBundle` bundle in `/app/AppKernel.php` - ``` php + ``` php skip-validation public function registerBundles() { $bundles = array( diff --git a/docs/release_notes/ez_platform_v3.0_deprecations.md b/docs/release_notes/ez_platform_v3.0_deprecations.md index a53c0491b1..630820ee3e 100644 --- a/docs/release_notes/ez_platform_v3.0_deprecations.md +++ b/docs/release_notes/ez_platform_v3.0_deprecations.md @@ -772,7 +772,7 @@ All classes and interfaces from `eZ\Publish\Core\Persistence\Database` and `eZ\P The signature of the `\eZ\Publish\Core\Persistence\Legacy\URL\Query\CriterionHandler::handle` contract now accepts `\Doctrine\DBAL\Query\QueryBuilder` instead of `\eZ\Publish\Core\Persistence\Database\SelectQuery` and has the following form: -``` php +``` php skip-validation use \Doctrine\DBAL\Query\QueryBuilder; use \eZ\Publish\Core\Persistence\Legacy\URL\Query\CriteriaConverter; use \eZ\Publish\API\Repository\Values\URL\Query\Criterion; diff --git a/docs/release_notes/ibexa_dxp_v4.6.md b/docs/release_notes/ibexa_dxp_v4.6.md index 46c05487bc..f04e188ced 100644 --- a/docs/release_notes/ibexa_dxp_v4.6.md +++ b/docs/release_notes/ibexa_dxp_v4.6.md @@ -1640,7 +1640,7 @@ Endpoints that allow you to manage prices in your platform with REST API: A signature for the `\Ibexa\Contracts\Rest\Output\Generator::startValueElement` method has been updated to the following: -```php +```php skip-validation /** * @phpstan-param scalar $value * @phpstan-param array $attributes diff --git a/docs/resources/contributing/package_structure.md b/docs/resources/contributing/package_structure.md index 05330652da..471b36ed4d 100644 --- a/docs/resources/contributing/package_structure.md +++ b/docs/resources/contributing/package_structure.md @@ -17,17 +17,17 @@ The following conventions apply to contributions to [[= product_name_base =]] co Define [[= product_name =]] core PHP code in a namespace with the following prefix: -```php +```php skip-validation namespace Ibexa; ``` A package which groups some DXP features can use an additional prefix, for example: -```php +```php skip-validation namespace Ibexa\Commerce; ``` -```php +```php skip-validation namespace Ibexa\Personalization; ``` @@ -55,11 +55,11 @@ The `src/lib` directory and its corresponding `Ibexa\` namespace ar Examples: -```php +```php skip-validation namespace Ibexa\Search; ``` -```php +```php skip-validation namespace Ibexa\Commerce\Shop; ``` @@ -67,7 +67,7 @@ namespace Ibexa\Commerce\Shop; The bundle class definition in the `src/bundle` directory must be: -```php +```php skip-validation namespace Ibexa\Bundle\; class Ibexa[ProductGroup]Bundle // ... @@ -76,13 +76,13 @@ class Ibexa[ProductGroup]Bundle // ... Examples: -```php +```php skip-validation namespace Ibexa\Bundle\Search; class IbexaSearchBundle // ... ``` -```php +```php skip-validation namespace Ibexa\Bundle\Commerce\Shop; class IbexaCommerceShopBundle // ... @@ -92,21 +92,21 @@ class IbexaCommerceShopBundle // ... A package may introduce a namespace for contracts, to be consumed by first and third party packages and projects, which must be prefixed as: -```php +```php skip-validation namespace Ibexa\Contracts; ``` Examples: -```php +```php skip-validation namespace Ibexa\Contracts\Kernel; ``` -```php +```php skip-validation namespace Ibexa\Contracts\SiteFactory; ``` -```php +```php skip-validation namespace Ibexa\Contracts\Commerce\Shop; ``` diff --git a/docs/search/activity_log_search_reference/action_criterion.md b/docs/search/activity_log_search_reference/action_criterion.md index b89e51d6eb..d969bf08ab 100644 --- a/docs/search/activity_log_search_reference/action_criterion.md +++ b/docs/search/activity_log_search_reference/action_criterion.md @@ -11,10 +11,13 @@ A set of built-in names is available as `ActivityLogServiceInterface`'s `ACTION_ ## Example ```php +use Ibexa\Contracts\ActivityLog\ActivityLogServiceInterface; +use Ibexa\Contracts\ActivityLog\Values\ActivityLog as ActivityLog; + $query = new ActivityLog\Query([ new ActivityLog\Criterion\ActionCriterion([ - ActivityLog\ActivityLogServiceInterface::ACTION_DELETE, - ActivityLog\ActivityLogServiceInterface::ACTION_TRASH, + ActivityLogServiceInterface::ACTION_DELETE, + ActivityLogServiceInterface::ACTION_TRASH, ]), ]); ``` diff --git a/docs/search/activity_log_search_reference/logged_at_criterion.md b/docs/search/activity_log_search_reference/logged_at_criterion.md index b48457b347..1e7d8c6a44 100644 --- a/docs/search/activity_log_search_reference/logged_at_criterion.md +++ b/docs/search/activity_log_search_reference/logged_at_criterion.md @@ -21,6 +21,8 @@ The `LoggedAtCriterion` Activity Log Criterion matches activity log group that h The following example is to match all activity log groups that aren't older than a day: ```php +use Ibexa\Contracts\ActivityLog\Values\ActivityLog as ActivityLog; + $query = new ActivityLog\Query([ new ActivityLog\Criterion\LoggedAtCriterion(new \DateTime('- 1 day'), ActivityLog\Criterion\LoggedAtCriterion::GTE), ]); diff --git a/docs/search/activity_log_search_reference/object_criterion.md b/docs/search/activity_log_search_reference/object_criterion.md index 7be18ad3c5..85ada40ec6 100644 --- a/docs/search/activity_log_search_reference/object_criterion.md +++ b/docs/search/activity_log_search_reference/object_criterion.md @@ -10,13 +10,17 @@ The `ObjectCriterion` Activity Log Criterion matches log group with a log entry ## Examples ```php +use Ibexa\Contracts\ActivityLog\Values\ActivityLog as ActivityLog; + $query = new ActivityLog\Query([ new ActivityLog\Criterion\ObjectCriterion(Ibexa\Contracts\Core\Repository\Values\Content\Content::class), ]); ``` ```php +use Ibexa\Contracts\ActivityLog\Values\ActivityLog as ActivityLog; + $query = new ActivityLog\Query([ - new ActivityLog\Criterion\ObjectCriterion(Ibexa\Contracts\ProductCatalog\Values\ProductVariantInterface::class, [123, 234, 345]), + new ActivityLog\Criterion\ObjectCriterion(Ibexa\Contracts\ProductCatalog\Values\ProductVariantInterface::class, ['123', '234', '345']), ]); ``` diff --git a/docs/search/activity_log_search_reference/object_name_criterion.md b/docs/search/activity_log_search_reference/object_name_criterion.md index 48ad0b1248..9d7494bca4 100644 --- a/docs/search/activity_log_search_reference/object_name_criterion.md +++ b/docs/search/activity_log_search_reference/object_name_criterion.md @@ -14,6 +14,8 @@ The `ObjectNameCriterion` Activity Log Criterion matches log groups that have a ## Example ```php +use Ibexa\Contracts\ActivityLog\Values\ActivityLog as ActivityLog; + $query = new ActivityLog\Query([ new ActivityLog\Criterion\ObjectNameCriterion('Ibexa', ActivityLog\Criterion\ObjectNameCriterion::OPERATOR_CONTAINS), ]); diff --git a/docs/search/activity_log_search_reference/user_criterion.md b/docs/search/activity_log_search_reference/user_criterion.md index def4663f95..d3c15dd5e0 100644 --- a/docs/search/activity_log_search_reference/user_criterion.md +++ b/docs/search/activity_log_search_reference/user_criterion.md @@ -9,6 +9,8 @@ The `UserCriterion` Activity Log Criterion matches log groups that have an activ ## Example ```php +use Ibexa\Contracts\ActivityLog\Values\ActivityLog as ActivityLog; + $query = new ActivityLog\Query([ new ActivityLog\Criterion\UserCriterion([10, 14]), ]); diff --git a/docs/search/aggregation_reference/authorterm_aggregation.md b/docs/search/aggregation_reference/authorterm_aggregation.md index 80d155c488..d170997b61 100644 --- a/docs/search/aggregation_reference/authorterm_aggregation.md +++ b/docs/search/aggregation_reference/authorterm_aggregation.md @@ -13,6 +13,9 @@ The field-based [AuthorTermAggregation](/api/php_api/php_api_reference/classes/I ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; + $query = new Query(); $query->aggregations[] = new Aggregation\Field\AuthorTermAggregation('author', 'article', 'authors'); ``` diff --git a/docs/search/aggregation_reference/basepricestats_aggregation.md b/docs/search/aggregation_reference/basepricestats_aggregation.md index 74f3bd6a77..44903bb291 100644 --- a/docs/search/aggregation_reference/basepricestats_aggregation.md +++ b/docs/search/aggregation_reference/basepricestats_aggregation.md @@ -21,6 +21,11 @@ You can use the provided getters to access the values: ## Example ``` php +use Ibexa\Contracts\ProductCatalog\Values\CurrencyInterface; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Aggregation\BasePriceStatsAggregation; + +/** @var CurrencyInterface $currency */ $query = new ProductQuery(); $query->setAggregations([ new BasePriceStatsAggregation('base_price_stats_aggregation', $currency), diff --git a/docs/search/aggregation_reference/checkboxterm_aggregation.md b/docs/search/aggregation_reference/checkboxterm_aggregation.md index 7a595366ff..7f503ff832 100644 --- a/docs/search/aggregation_reference/checkboxterm_aggregation.md +++ b/docs/search/aggregation_reference/checkboxterm_aggregation.md @@ -13,6 +13,9 @@ The field-based [CheckboxTermAggregation](/api/php_api/php_api_reference/classes ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; + $query = new Query(); $query->aggregations[] = new Aggregation\Field\CheckboxTermAggregation('checkbox', 'article', 'enable_comments'); ``` diff --git a/docs/search/aggregation_reference/contenttypegroupterm_aggregation.md b/docs/search/aggregation_reference/contenttypegroupterm_aggregation.md index 1d42dced95..0a77afbe98 100644 --- a/docs/search/aggregation_reference/contenttypegroupterm_aggregation.md +++ b/docs/search/aggregation_reference/contenttypegroupterm_aggregation.md @@ -13,6 +13,9 @@ The [ContentTypeGroupTermAggregation](/api/php_api/php_api_reference/classes/Ibe ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; + $query = new Query(); $query->aggregations[] = new Aggregation\ContentTypeGroupTermAggregation('content_type_group'); ``` diff --git a/docs/search/aggregation_reference/contenttypeterm_aggregation.md b/docs/search/aggregation_reference/contenttypeterm_aggregation.md index 1d3d242f26..62d729603c 100644 --- a/docs/search/aggregation_reference/contenttypeterm_aggregation.md +++ b/docs/search/aggregation_reference/contenttypeterm_aggregation.md @@ -13,6 +13,9 @@ The [ContentTypeTermAggregation](/api/php_api/php_api_reference/classes/Ibexa-Co ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; + $query = new Query(); $query->aggregations[] = new Aggregation\ContentTypeTermAggregation('content_type'); ``` diff --git a/docs/search/aggregation_reference/countryterm_aggregation.md b/docs/search/aggregation_reference/countryterm_aggregation.md index 6bc909190e..81e34ddde9 100644 --- a/docs/search/aggregation_reference/countryterm_aggregation.md +++ b/docs/search/aggregation_reference/countryterm_aggregation.md @@ -13,6 +13,9 @@ The field-based [CountryTermAggregation](/api/php_api/php_api_reference/classes/ ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; + $query = new Query(); $query->aggregations[] = new Aggregation\Field\CountryTermAggregation('country', 'article', 'country'); ``` diff --git a/docs/search/aggregation_reference/custompricestats_aggregation.md b/docs/search/aggregation_reference/custompricestats_aggregation.md index 08413b7888..78d7b67445 100644 --- a/docs/search/aggregation_reference/custompricestats_aggregation.md +++ b/docs/search/aggregation_reference/custompricestats_aggregation.md @@ -21,6 +21,13 @@ The CustomPriceStatsAggregation aggregates search results by the value of the cu ## Example ``` php +use Ibexa\Contracts\ProductCatalog\Values\CurrencyInterface; +use Ibexa\Contracts\ProductCatalog\Values\CustomerGroupInterface; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Aggregation\CustomPriceStatsAggregation; + +/** @var CurrencyInterface $currency */ +/** @var CustomerGroupInterface $customerGroup */ $query = new ProductQuery(); $query->setAggregations([ new CustomPriceStatsAggregation('custom_price_stats_aggregation', $currency, $customerGroup), diff --git a/docs/search/aggregation_reference/datemetadatarange_aggregation.md b/docs/search/aggregation_reference/datemetadatarange_aggregation.md index fbd1e431fb..d47dcbd4ef 100644 --- a/docs/search/aggregation_reference/datemetadatarange_aggregation.md +++ b/docs/search/aggregation_reference/datemetadatarange_aggregation.md @@ -15,11 +15,15 @@ The [DateMetadataRangeAggregation](/api/php_api/php_api_reference/classes/Ibexa- ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; + $query = new Query(); $query->aggregations[] = new Aggregation\DateMetadataRangeAggregation('date_metadata', Aggregation\DateMetadataRangeAggregation::PUBLISHED, [ - new Query\Aggregation\Range(null, new DateTime('2020-06-01')), - new Query\Aggregation\Range(new DateTime('2020-06-01'), new DateTime('2020-12-31')), - new Query\Aggregation\Range(new DateTime('2020-12-31'), null), + Range::ofDateTime(null, new DateTime('2020-06-01')), + Range::ofDateTime(new DateTime('2020-06-01'), new DateTime('2020-12-31')), + Range::ofDateTime(new DateTime('2020-12-31'), null), ]); ``` diff --git a/docs/search/aggregation_reference/daterange_aggregation.md b/docs/search/aggregation_reference/daterange_aggregation.md index 518cc39b77..b8e1ac1823 100644 --- a/docs/search/aggregation_reference/daterange_aggregation.md +++ b/docs/search/aggregation_reference/daterange_aggregation.md @@ -14,11 +14,15 @@ The field-based [DateRangeAggregation](/api/php_api/php_api_reference/classes/Ib ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; + $query = new Query(); $query->aggregations[] = new Aggregation\Field\DateRangeAggregation('date', 'event', 'event_date', [ - new Query\Aggregation\Range(null, new DateTime('2020-06-01')), - new Query\Aggregation\Range(new DateTime('2020-06-01'), new DateTime('2020-12-31')), - new Query\Aggregation\Range(new DateTime('2020-12-31'), null), + Range::ofDateTime(null, new DateTime('2020-06-01')), + Range::ofDateTime(new DateTime('2020-06-01'), new DateTime('2020-12-31')), + Range::ofDateTime(new DateTime('2020-12-31'), null), ]); ``` diff --git a/docs/search/aggregation_reference/datetimerange_aggregation.md b/docs/search/aggregation_reference/datetimerange_aggregation.md index 84b6c7fe62..17e8d14e0c 100644 --- a/docs/search/aggregation_reference/datetimerange_aggregation.md +++ b/docs/search/aggregation_reference/datetimerange_aggregation.md @@ -14,11 +14,15 @@ The field-based [DateTimeRangeAggregation](/api/php_api/php_api_reference/classe ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; + $query = new Query(); $query->aggregations[] = new Aggregation\Field\DateTimeRangeAggregation('date', 'event', 'event_date', [ - new Query\Aggregation\Range(null, new DateTime('2020-06-01')), - new Query\Aggregation\Range(new DateTime('2020-06-01'), new DateTime('2020-12-31')), - new Query\Aggregation\Range(new DateTime('2020-12-31'), null), + Range::ofDateTime(null, new DateTime('2020-06-01')), + Range::ofDateTime(new DateTime('2020-06-01'), new DateTime('2020-12-31')), + Range::ofDateTime(new DateTime('2020-12-31'), null), ]); ``` diff --git a/docs/search/aggregation_reference/floatrange_aggregation.md b/docs/search/aggregation_reference/floatrange_aggregation.md index d94c1dedc9..8bcb0eb15c 100644 --- a/docs/search/aggregation_reference/floatrange_aggregation.md +++ b/docs/search/aggregation_reference/floatrange_aggregation.md @@ -14,11 +14,15 @@ The field-based [FloatRangeAggregation](/api/php_api/php_api_reference/classes/I ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; + $query = new Query(); $query->aggregations[] = new Aggregation\Field\FloatRangeAggregation('float', 'product', 'weight', [ - new Query\Aggregation\Range(null, 0.25), - new Query\Aggregation\Range(0.25, 0.75), - new Query\Aggregation\Range(0.75, null), + Range::ofFloat(null, 0.25), + Range::ofFloat(0.25, 0.75), + Range::ofFloat(0.75, null), ]); ``` diff --git a/docs/search/aggregation_reference/floatstats_aggregation.md b/docs/search/aggregation_reference/floatstats_aggregation.md index 5d2be9bb13..5fc9445378 100644 --- a/docs/search/aggregation_reference/floatstats_aggregation.md +++ b/docs/search/aggregation_reference/floatstats_aggregation.md @@ -20,6 +20,9 @@ You can use the provided getters to access the values: ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; + $query = new Query(); $query->aggregations[] = new Aggregation\Field\FloatStatsAggregation('float', 'product', 'weight'); ``` diff --git a/docs/search/aggregation_reference/integerrange_aggregation.md b/docs/search/aggregation_reference/integerrange_aggregation.md index 37c51b76a6..0a422a87d5 100644 --- a/docs/search/aggregation_reference/integerrange_aggregation.md +++ b/docs/search/aggregation_reference/integerrange_aggregation.md @@ -14,11 +14,15 @@ The field-based [IntegerRangeAggregation](/api/php_api/php_api_reference/classes ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; + $query = new Query(); $query->aggregations[] = new Aggregation\Field\IntegerRangeAggregation('integer', 'product', 'amount', [ - new Query\Aggregation\Range(null, 12), - new Query\Aggregation\Range(12, 24), - new Query\Aggregation\Range(24, null), + Range::ofInt(null, 12), + Range::ofInt(12, 24), + Range::ofInt(24, null), ]); ``` diff --git a/docs/search/aggregation_reference/integerstats_aggregation.md b/docs/search/aggregation_reference/integerstats_aggregation.md index 13d65dcd3a..ff31603d22 100644 --- a/docs/search/aggregation_reference/integerstats_aggregation.md +++ b/docs/search/aggregation_reference/integerstats_aggregation.md @@ -19,6 +19,9 @@ The field-based [IntegerStatsAggregation](/api/php_api/php_api_reference/classes ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; + $query = new Query(); $query->aggregations[] = new Aggregation\Field\IntegerStatsAggregation('integer', 'product', 'amount'); ``` diff --git a/docs/search/aggregation_reference/keywordterm_aggregation.md b/docs/search/aggregation_reference/keywordterm_aggregation.md index e0eff92f43..4457069e31 100644 --- a/docs/search/aggregation_reference/keywordterm_aggregation.md +++ b/docs/search/aggregation_reference/keywordterm_aggregation.md @@ -13,6 +13,9 @@ The field-based [KeywordTermAggregation](/api/php_api/php_api_reference/classes/ ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; + $query = new Query(); $query->aggregations[] = new Aggregation\Field\KeywordTermAggregation('keyword', 'article', 'tags'); ``` diff --git a/docs/search/aggregation_reference/languageterm_aggregation.md b/docs/search/aggregation_reference/languageterm_aggregation.md index 6f5e6bd09f..41a7f88dbb 100644 --- a/docs/search/aggregation_reference/languageterm_aggregation.md +++ b/docs/search/aggregation_reference/languageterm_aggregation.md @@ -13,6 +13,9 @@ The [LanguageTermAggregation](/api/php_api/php_api_reference/classes/Ibexa-Contr ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; + $query = new Query(); $query->aggregations[] = new Aggregation\LanguageTermAggregation('language'); ``` diff --git a/docs/search/aggregation_reference/locationchildrenterm_aggregation.md b/docs/search/aggregation_reference/locationchildrenterm_aggregation.md index b530e83ab2..077bdaca94 100644 --- a/docs/search/aggregation_reference/locationchildrenterm_aggregation.md +++ b/docs/search/aggregation_reference/locationchildrenterm_aggregation.md @@ -13,6 +13,9 @@ The [LocationChildrenTermAggregation](/api/php_api/php_api_reference/classes/Ibe ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; + $query = new LocationQuery(); $query->aggregations[] = new Aggregation\Location\LocationChildrenTermAggregation('location_children'); ``` diff --git a/docs/search/aggregation_reference/objectstateterm_aggregation.md b/docs/search/aggregation_reference/objectstateterm_aggregation.md index 099df6822c..cd5b1ffa13 100644 --- a/docs/search/aggregation_reference/objectstateterm_aggregation.md +++ b/docs/search/aggregation_reference/objectstateterm_aggregation.md @@ -14,8 +14,11 @@ The [ObjectStateTermAggregation](/api/php_api/php_api_reference/classes/Ibexa-Co ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; + $query = new Query(); -$query->aggregations[] = new Aggregation\Location\ObjectStateTermAggregation('object_state', 'ibexa_lock'); +$query->aggregations[] = new Aggregation\ObjectStateTermAggregation('object_state', 'ibexa_lock'); ``` [[= include_file('docs/snippets/search_term_aggregation_settings.md') =]] diff --git a/docs/search/aggregation_reference/product_attribute_aggregations.md b/docs/search/aggregation_reference/product_attribute_aggregations.md index d6a533713e..845092669d 100644 --- a/docs/search/aggregation_reference/product_attribute_aggregations.md +++ b/docs/search/aggregation_reference/product_attribute_aggregations.md @@ -28,19 +28,26 @@ Range aggregations (`ProductAttributeFloatRangeAggregation` and `ProductAttribut ## Example ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Aggregation\AttributeSelectionTermAggregation; + $query = new ProductQuery(); $query->setAggregations([ - new ProductAttributeSelectionAggregation('skin', 'skin_type'), + new AttributeSelectionTermAggregation('skin', 'skin_type'), ]); ``` ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Aggregation\AttributeIntegerRangeAggregation; + $query = new ProductQuery(); $query->setAggregations([ - new ProductAttributeIntegerRangeAggregation('buttons', 'number_of_buttons', [ - new \Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range(null, 5), - new \Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range(5, 10), - new \Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range(10, null), + new AttributeIntegerRangeAggregation('buttons', 'number_of_buttons', [ + Range::ofInt(null, 5), + Range::ofInt(5, 10), + Range::ofInt(10, null), ]), ]); ``` diff --git a/docs/search/aggregation_reference/productavailabilityterm_aggregation.md b/docs/search/aggregation_reference/productavailabilityterm_aggregation.md index 45058d73d6..946fb1d611 100644 --- a/docs/search/aggregation_reference/productavailabilityterm_aggregation.md +++ b/docs/search/aggregation_reference/productavailabilityterm_aggregation.md @@ -13,6 +13,9 @@ The ProductAvailabilityTermAggregation aggregates search results by product avai ## Example ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Aggregation\ProductAvailabilityTermAggregation; + $query = new ProductQuery(); $query->setAggregations([ new ProductAvailabilityTermAggregation('product_availability'), diff --git a/docs/search/aggregation_reference/productpricerange_aggregation.md b/docs/search/aggregation_reference/productpricerange_aggregation.md index aa6774888c..ea1455dbc9 100644 --- a/docs/search/aggregation_reference/productpricerange_aggregation.md +++ b/docs/search/aggregation_reference/productpricerange_aggregation.md @@ -15,11 +15,15 @@ The ProductPriceRangeAggregation aggregates search results by the value of the p ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Aggregation\ProductPriceRangeAggregation; + $query = new ProductQuery(); $query->setAggregations([ new ProductPriceRangeAggregation('price', 'PLN', [ - new \Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range(0, 10000), - new \Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range(10000, null), + Range::ofInt(0, 10000), + Range::ofInt(10000, null), ]), ]); ``` diff --git a/docs/search/aggregation_reference/productstockrange_aggregation.md b/docs/search/aggregation_reference/productstockrange_aggregation.md index 0b29292bc6..d098fe6bca 100644 --- a/docs/search/aggregation_reference/productstockrange_aggregation.md +++ b/docs/search/aggregation_reference/productstockrange_aggregation.md @@ -14,12 +14,16 @@ The ProductStockRangeAggregation aggregates search results by products' numerica ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Aggregation\ProductStockRangeAggregation; + $productQuery = new ProductQuery(); $productQuery->setAggregations([ new ProductStockRangeAggregation('stock', [ - new Range(null, 10), - new Range(10, 100), - new Range(100, null), + Range::ofInt(null, 10), + Range::ofInt(10, 100), + Range::ofInt(100, null), ]), ]); ``` diff --git a/docs/search/aggregation_reference/producttypeterm_aggregation.md b/docs/search/aggregation_reference/producttypeterm_aggregation.md index aac92ab6d7..d5f5c10c26 100644 --- a/docs/search/aggregation_reference/producttypeterm_aggregation.md +++ b/docs/search/aggregation_reference/producttypeterm_aggregation.md @@ -13,6 +13,9 @@ The ProductTypeTermAggregation aggregates search results by the product type. ## Example ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Aggregation\ProductTypeTermAggregation; + $query = new ProductQuery(); $query->setAggregations([ new ProductTypeTermAggregation('product_type'), diff --git a/docs/search/aggregation_reference/rawrange_aggregation.md b/docs/search/aggregation_reference/rawrange_aggregation.md index 98b7f9c156..1e0d36e81a 100644 --- a/docs/search/aggregation_reference/rawrange_aggregation.md +++ b/docs/search/aggregation_reference/rawrange_aggregation.md @@ -22,9 +22,13 @@ The [RawRangeAggregation](/api/php_api/php_api_reference/classes/Ibexa-Contracts ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; + $query = new LocationQuery(); $query->aggregations[] = new Aggregation\RawRangeAggregation('priority', 'priority_id', [ - new Query\Aggregation\Range(1, 10), - new Query\Aggregation\Range(10, 100) + Range::ofInt(1, 10), + Range::ofInt(10, 100), ]); ``` diff --git a/docs/search/aggregation_reference/rawstats_aggregation.md b/docs/search/aggregation_reference/rawstats_aggregation.md index fd8b51e0d9..67315492d6 100644 --- a/docs/search/aggregation_reference/rawstats_aggregation.md +++ b/docs/search/aggregation_reference/rawstats_aggregation.md @@ -28,6 +28,9 @@ You can use the provided getters to access the values: ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; + $query = new Query(); $query->aggregations[] = new Aggregation\RawStatsAggregation('location_depth', 'depth_i'); ``` diff --git a/docs/search/aggregation_reference/rawterm_aggregation.md b/docs/search/aggregation_reference/rawterm_aggregation.md index 94d629b520..a1b4aee7eb 100644 --- a/docs/search/aggregation_reference/rawterm_aggregation.md +++ b/docs/search/aggregation_reference/rawterm_aggregation.md @@ -21,6 +21,9 @@ The [RawTermAggregation](/api/php_api/php_api_reference/classes/Ibexa-Contracts- ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; + $query = new Query(); $query->aggregations[] = new Aggregation\RawTermAggregation('content_per_content_type', 'content_type_id_id'); ``` diff --git a/docs/search/aggregation_reference/sectionterm_aggregation.md b/docs/search/aggregation_reference/sectionterm_aggregation.md index 51980b5f76..0dc3a5ae99 100644 --- a/docs/search/aggregation_reference/sectionterm_aggregation.md +++ b/docs/search/aggregation_reference/sectionterm_aggregation.md @@ -13,6 +13,9 @@ The [SectionTermAggregation](/api/php_api/php_api_reference/classes/Ibexa-Contra ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; + $query = new Query(); $query->aggregations[] = new Aggregation\SectionTermAggregation('section'); ``` diff --git a/docs/search/aggregation_reference/selectionterm_aggregation.md b/docs/search/aggregation_reference/selectionterm_aggregation.md index d6b468f228..17164582ba 100644 --- a/docs/search/aggregation_reference/selectionterm_aggregation.md +++ b/docs/search/aggregation_reference/selectionterm_aggregation.md @@ -13,6 +13,9 @@ The field-based [SelectionTermAggregation](/api/php_api/php_api_reference/classe ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; + $query = new Query(); $query->aggregations[] = new Aggregation\Field\SelectionTermAggregation('selection', 'article', 'select'); ``` diff --git a/docs/search/aggregation_reference/subtreeterm_aggregation.md b/docs/search/aggregation_reference/subtreeterm_aggregation.md index 780140492b..902a59f5bd 100644 --- a/docs/search/aggregation_reference/subtreeterm_aggregation.md +++ b/docs/search/aggregation_reference/subtreeterm_aggregation.md @@ -14,6 +14,9 @@ The [SubtreeTermAggregation](/api/php_api/php_api_reference/classes/Ibexa-Contra ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; + $query = new Query(); $query->aggregations[] = new Aggregation\Location\SubtreeTermAggregation('pathstring', '/1/2/'); ``` diff --git a/docs/search/aggregation_reference/taxonomyentryid_aggregation.md b/docs/search/aggregation_reference/taxonomyentryid_aggregation.md index cff1e2b455..ce35d66f94 100644 --- a/docs/search/aggregation_reference/taxonomyentryid_aggregation.md +++ b/docs/search/aggregation_reference/taxonomyentryid_aggregation.md @@ -14,11 +14,17 @@ The `TaxonomyEntryIdAggregation` aggregates search results by the content item's ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Taxonomy\Search\Query\Aggregation as Aggregation; + $query = new Query(); $query->aggregations[] = new Aggregation\TaxonomyEntryIdAggregation('taxonomy', 'tags'); ``` ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\Taxonomy\Search\Query\Aggregation\TaxonomyEntryIdAggregation; + $query = new ProductQuery(); -$query->aggregations[] = new Aggregation\TaxonomyEntryIdAggregation('categories', 'product_categories'); +$query->setAggregations([new TaxonomyEntryIdAggregation('categories', 'product_categories')]); ``` diff --git a/docs/search/aggregation_reference/timerange_aggregation.md b/docs/search/aggregation_reference/timerange_aggregation.md index c38920833b..0e34cd1d4a 100644 --- a/docs/search/aggregation_reference/timerange_aggregation.md +++ b/docs/search/aggregation_reference/timerange_aggregation.md @@ -14,10 +14,19 @@ The field-based [TimeRangeAggregation](/api/php_api/php_api_reference/classes/Ib ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; + +$timestamp = mktime(14, 0, 0); +if ($timestamp === false) { + throw new RuntimeException('Failed to create timestamp with mktime.'); +} + $query = new Query(); $query->aggregations[] = new Aggregation\Field\TimeRangeAggregation('date', 'event', 'event_time', [ - new Query\Aggregation\Range(null, new DateTime('T14:00')), - new Query\Aggregation\Range(new DateTime('T14:003'), null), + Range::ofInt(null, $timestamp), + Range::ofInt($timestamp, null), ]); ``` diff --git a/docs/search/aggregation_reference/usermetadataterm_aggregation.md b/docs/search/aggregation_reference/usermetadataterm_aggregation.md index 275e2742e1..b61f72f109 100644 --- a/docs/search/aggregation_reference/usermetadataterm_aggregation.md +++ b/docs/search/aggregation_reference/usermetadataterm_aggregation.md @@ -13,6 +13,9 @@ The [UserMetadataTermAggregation](/api/php_api/php_api_reference/classes/Ibexa-C ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; + $query = new Query(); $query->aggregations[] = new Aggregation\UserMetadataTermAggregation('user_metadata'); ``` diff --git a/docs/search/aggregation_reference/visibilityterm_aggregation.md b/docs/search/aggregation_reference/visibilityterm_aggregation.md index 780fa57d48..843cb5a36c 100644 --- a/docs/search/aggregation_reference/visibilityterm_aggregation.md +++ b/docs/search/aggregation_reference/visibilityterm_aggregation.md @@ -13,6 +13,9 @@ The [VisibilityTermAggregation](/api/php_api/php_api_reference/classes/Ibexa-Con ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; + $query = new Query(); $query->aggregations[] = new Aggregation\VisibilityTermAggregation('visibility'); ``` diff --git a/docs/search/criteria_reference/ancestor_criterion.md b/docs/search/criteria_reference/ancestor_criterion.md index d0853413a0..81c74ce7b6 100644 --- a/docs/search/criteria_reference/ancestor_criterion.md +++ b/docs/search/criteria_reference/ancestor_criterion.md @@ -15,7 +15,12 @@ The [`Ancestor` Search Criterion](/api/php_api/php_api_reference/classes/Ibexa-C ### PHP ``` php -$query->query = new Criterion\Ancestor([$this->locationService->loadLocation(62)->pathString]); +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); +/** @var \Ibexa\Contracts\Core\Repository\LocationService $locationService */ +$query->query = new Criterion\Ancestor([$locationService->loadLocation(62)->pathString]); ``` ### REST API @@ -45,6 +50,12 @@ $query->query = new Criterion\Ancestor([$this->locationService->loadLocation(62) You can use the Ancestor Search Criterion to create a list of breadcrumbs leading to the Location: ``` php hl_lines="2" +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +/** @var int $locationId */ +/** @var object{locationService: \Ibexa\Contracts\Core\Repository\LocationService, searchService: \Ibexa\Contracts\Core\Repository\SearchService} $this */ $query = new LocationQuery(); $query->query = new Criterion\Ancestor([$this->locationService->loadLocation($locationId)->pathString]); @@ -54,6 +65,7 @@ foreach ($results->searchHits as $searchHit) { $breadcrumbs[] = $searchHit; } +// @phpstan-ignore-next-line return $this->render('parts/breadcrumbs.html.twig', [ 'breadcrumbs' => $breadcrumbs, ]); diff --git a/docs/search/criteria_reference/baseprice_criterion.md b/docs/search/criteria_reference/baseprice_criterion.md index bbc95e06cc..69e625c861 100644 --- a/docs/search/criteria_reference/baseprice_criterion.md +++ b/docs/search/criteria_reference/baseprice_criterion.md @@ -20,6 +20,9 @@ The `BasePrice` Criterion isn't available in the Legacy Search engine. ### PHP ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\BasePrice( diff --git a/docs/search/criteria_reference/checkboxattribute_criterion.md b/docs/search/criteria_reference/checkboxattribute_criterion.md index eb72b6a723..126bc24c06 100644 --- a/docs/search/criteria_reference/checkboxattribute_criterion.md +++ b/docs/search/criteria_reference/checkboxattribute_criterion.md @@ -16,6 +16,9 @@ The `CheckboxAttribute` Search Criterion searches for products by the value of t ### PHP ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\CheckboxAttribute('automatic', true) diff --git a/docs/search/criteria_reference/colorattribute_criterion.md b/docs/search/criteria_reference/colorattribute_criterion.md index e196933a1f..7e8055b36e 100644 --- a/docs/search/criteria_reference/colorattribute_criterion.md +++ b/docs/search/criteria_reference/colorattribute_criterion.md @@ -16,6 +16,9 @@ The `ColorAttribute` Search Criterion searches for products by the value of thei ### PHP ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ColorAttribute('color', ['#FF0000']) diff --git a/docs/search/criteria_reference/contentid_criterion.md b/docs/search/criteria_reference/contentid_criterion.md index c468ad0fed..5b10d96682 100644 --- a/docs/search/criteria_reference/contentid_criterion.md +++ b/docs/search/criteria_reference/contentid_criterion.md @@ -15,6 +15,10 @@ The [`ContentId` Search Criterion](/api/php_api/php_api_reference/classes/Ibexa- ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\ContentId([62, 64]); ``` diff --git a/docs/search/criteria_reference/contentname_criterion.md b/docs/search/criteria_reference/contentname_criterion.md index 0c57bf7023..9280b29471 100644 --- a/docs/search/criteria_reference/contentname_criterion.md +++ b/docs/search/criteria_reference/contentname_criterion.md @@ -15,6 +15,10 @@ The [`ContentName` Search Criterion](https://github.com/ibexa/core/blob/5.0/src/ ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\ContentName('*phone'); ``` diff --git a/docs/search/criteria_reference/contenttypegroupid_criterion.md b/docs/search/criteria_reference/contenttypegroupid_criterion.md index e8395aac51..737e24cd1e 100644 --- a/docs/search/criteria_reference/contenttypegroupid_criterion.md +++ b/docs/search/criteria_reference/contenttypegroupid_criterion.md @@ -15,6 +15,10 @@ The [`ContentTypeGroupId` Search Criterion](/api/php_api/php_api_reference/class ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; + +$query = new Query(); $query->query = new Criterion\ContentTypeGroupId([1, 2]); ``` @@ -46,12 +50,17 @@ You can use the `ContentTypeGroupId` Criterion to query all Media content items (the default ID for the Media content type group is 3): ``` php hl_lines="1" - $query->query = new Criterion\ContentTypeGroupId([3]); - - $results = $this->searchService->findContent($query); - $media = []; - foreach ($results->searchHits as $searchHit) { - $media[] = $searchHit; - } - } +use Ibexa\Contracts\Core\Repository\SearchService; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; + +$query = new Query(); +$query->query = new Criterion\ContentTypeGroupId([3]); + +/** @var SearchService $searchService */ +$results = $searchService->findContent($query); +$media = []; +foreach ($results->searchHits as $searchHit) { + $media[] = $searchHit; +} ``` diff --git a/docs/search/criteria_reference/contenttypeid_criterion.md b/docs/search/criteria_reference/contenttypeid_criterion.md index 2c8301358d..77156c4a52 100644 --- a/docs/search/criteria_reference/contenttypeid_criterion.md +++ b/docs/search/criteria_reference/contenttypeid_criterion.md @@ -15,6 +15,10 @@ The [`ContentTypeId` Search Criterion](/api/php_api/php_api_reference/classes/Ib ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\ContentTypeId([44]); ``` diff --git a/docs/search/criteria_reference/contenttypeidentifier_criterion.md b/docs/search/criteria_reference/contenttypeidentifier_criterion.md index 8cb8995a9e..c7a8fafb38 100644 --- a/docs/search/criteria_reference/contenttypeidentifier_criterion.md +++ b/docs/search/criteria_reference/contenttypeidentifier_criterion.md @@ -15,6 +15,10 @@ The [`ContentTypeIdentifier` Search Criterion](/api/php_api/php_api_reference/cl ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\ContentTypeIdentifier(['article', 'blog_post']); ``` diff --git a/docs/search/criteria_reference/createdat_criterion.md b/docs/search/criteria_reference/createdat_criterion.md index 06ae3046b0..c90d0ffed0 100644 --- a/docs/search/criteria_reference/createdat_criterion.md +++ b/docs/search/criteria_reference/createdat_criterion.md @@ -16,6 +16,9 @@ The `CreatedAt` Search Criterion searches for products based on the date when th ### PHP ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + $criteria = new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\CreatedAt( new DateTime('2023-03-01'), \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\Operator::GTE, diff --git a/docs/search/criteria_reference/createdatrange_criterion.md b/docs/search/criteria_reference/createdatrange_criterion.md index fe6de80520..81023d7d97 100644 --- a/docs/search/criteria_reference/createdatrange_criterion.md +++ b/docs/search/criteria_reference/createdatrange_criterion.md @@ -16,6 +16,9 @@ The `CreatedAtRange` Search Criterion searches for products based on the date ra ### PHP ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + $criteria = new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\CreatedAtRange( new \DateTimeImmutable('2020-07-10T00:00:00+00:00'), new \DateTimeImmutable('2023-07-12T00:00:00+00:00') diff --git a/docs/search/criteria_reference/currencycode_criterion.md b/docs/search/criteria_reference/currencycode_criterion.md index c98073e693..7c6b98cbe5 100644 --- a/docs/search/criteria_reference/currencycode_criterion.md +++ b/docs/search/criteria_reference/currencycode_criterion.md @@ -19,5 +19,9 @@ The `CurrencyCodeCriterion` Criterion isn't available in Solr or Elasticsearch e ### PHP ``` php -$query->query = new \Ibexa\Contracts\ProductCatalog\Values\Currency\Query\Criterion\CurrencyCodeCriterion('EUR'); +use Ibexa\Contracts\ProductCatalog\Values\Currency\CurrencyQuery; + +$query = new CurrencyQuery( + new \Ibexa\Contracts\ProductCatalog\Values\Currency\Query\Criterion\CurrencyCodeCriterion('EUR') +); ``` diff --git a/docs/search/criteria_reference/customergroupid_criterion.md b/docs/search/criteria_reference/customergroupid_criterion.md index 4a27b612c6..14fea50f8f 100644 --- a/docs/search/criteria_reference/customergroupid_criterion.md +++ b/docs/search/criteria_reference/customergroupid_criterion.md @@ -15,5 +15,9 @@ The `CustomerGroupId` Search Criterion searches for content based on the ID of i ### PHP ``` php +use Ibexa\Contracts\ProductCatalog\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\CustomerGroupId(1); ``` diff --git a/docs/search/criteria_reference/customprice_criterion.md b/docs/search/criteria_reference/customprice_criterion.md index b4752cf374..5b70e3ebda 100644 --- a/docs/search/criteria_reference/customprice_criterion.md +++ b/docs/search/criteria_reference/customprice_criterion.md @@ -22,6 +22,10 @@ The `CustomPrice` Criterion isn't available in the Legacy Search engine. ### PHP ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + +/** @var \Ibexa\Contracts\ProductCatalog\Values\CustomerGroupInterface $customerGroup */ $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\CustomPrice( diff --git a/docs/search/criteria_reference/datemetadata_criterion.md b/docs/search/criteria_reference/datemetadata_criterion.md index 3c94a49b8a..1656acbfe9 100644 --- a/docs/search/criteria_reference/datemetadata_criterion.md +++ b/docs/search/criteria_reference/datemetadata_criterion.md @@ -17,6 +17,10 @@ The [`DateMetadata` Search Criterion](/api/php_api/php_api_reference/classes/Ibe ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\DateMetadata( Criterion\DateMetadata::CREATED, Criterion\Operator::BETWEEN, @@ -59,6 +63,10 @@ $query->query = new Criterion\DateMetadata( You can use the `DateMetadata` Criterion to search for blog posts that have been created within the last week: ``` php hl_lines="5" +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + $query = new LocationQuery; $date = strtotime("-1 week"); $query->query = new Criterion\LogicalAnd([ diff --git a/docs/search/criteria_reference/depth_criterion.md b/docs/search/criteria_reference/depth_criterion.md index 1389da5b42..69fd6c636f 100644 --- a/docs/search/criteria_reference/depth_criterion.md +++ b/docs/search/criteria_reference/depth_criterion.md @@ -24,5 +24,9 @@ The `value` argument requires: ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\Location\Depth(Criterion\Operator::LT, 3); ``` diff --git a/docs/search/criteria_reference/field_criterion.md b/docs/search/criteria_reference/field_criterion.md index e07057ebe3..a27b93cfd1 100644 --- a/docs/search/criteria_reference/field_criterion.md +++ b/docs/search/criteria_reference/field_criterion.md @@ -26,6 +26,10 @@ The `Field` Criterion isn't available in [Repository filtering](search_api.md#re ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\Field('name', Criterion\Operator::CONTAINS, 'Platform'); ``` @@ -66,6 +70,10 @@ $query->query = new Criterion\Field('name', Criterion\Operator::CONTAINS, 'Platf You can use the `Field` Criterion to search for articles that contain the word "featured": ``` php hl_lines="4" +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + $query = new LocationQuery(); $query->query = new Criterion\LogicalAnd([ new Criterion\ContentTypeIdentifier('article'), diff --git a/docs/search/criteria_reference/fieldrelation_criterion.md b/docs/search/criteria_reference/fieldrelation_criterion.md index cf2103597f..84a85342b3 100644 --- a/docs/search/criteria_reference/fieldrelation_criterion.md +++ b/docs/search/criteria_reference/fieldrelation_criterion.md @@ -23,5 +23,9 @@ The `FieldRelation` Criterion isn't available in [Repository filtering](search_a ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\FieldRelation('relations', Criterion\Operator::CONTAINS, [55, 63]); ``` diff --git a/docs/search/criteria_reference/floatattribute_criterion.md b/docs/search/criteria_reference/floatattribute_criterion.md index 37883cc172..b5f112ed9a 100644 --- a/docs/search/criteria_reference/floatattribute_criterion.md +++ b/docs/search/criteria_reference/floatattribute_criterion.md @@ -16,6 +16,9 @@ The `FloatAttribute` Search Criterion searches for products by the value of thei ### PHP ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\FloatAttribute( diff --git a/docs/search/criteria_reference/fulltext_criterion.md b/docs/search/criteria_reference/fulltext_criterion.md index 001d62c947..e5730d4fa4 100644 --- a/docs/search/criteria_reference/fulltext_criterion.md +++ b/docs/search/criteria_reference/fulltext_criterion.md @@ -40,18 +40,30 @@ The `FullText` Criterion isn't available in [Repository filtering](search_api.md ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\FullText('victory'); ``` Using double quotes to indicate a phrase: ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\FullText('"world cup"'); ``` Using the AND operator and parenthesis to search for both words at the same time: ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\FullText('baseball AND cup'); ``` @@ -82,6 +94,10 @@ $query->query = new Criterion\FullText('baseball AND cup'); Assume the following search query: ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\FullText('(cup AND ba*ball) "breaking news"'); ``` diff --git a/docs/search/criteria_reference/image_criterion.md b/docs/search/criteria_reference/image_criterion.md index 2df2a0a3f7..5158d561fa 100644 --- a/docs/search/criteria_reference/image_criterion.md +++ b/docs/search/criteria_reference/image_criterion.md @@ -16,6 +16,9 @@ The `Image` Search Criterion searches for image by specified image attributes. ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + $imageCriteriaData = [ 'mimeTypes' => [ 'image/png', @@ -36,6 +39,8 @@ $imageCriteriaData = [ 'max' => 2, // (default: null, optional) ], ]; + +$query = new Query(); $query->query = new Criterion\Image('image', $imageCriteriaData); ``` diff --git a/docs/search/criteria_reference/imagedimensions_criterion.md b/docs/search/criteria_reference/imagedimensions_criterion.md index 4281fe6fb3..af896951ae 100644 --- a/docs/search/criteria_reference/imagedimensions_criterion.md +++ b/docs/search/criteria_reference/imagedimensions_criterion.md @@ -16,6 +16,10 @@ The `Dimensions` Search Criterion searches for image with specified dimensions. ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $imageCriteriaData = [ 'width' => [ 'min' => 100, // (default: 0, optional) @@ -27,7 +31,7 @@ $imageCriteriaData = [ ], ]; -$query->query = new Criterion\Dimensions('image', $imageCriteriaData); +$query->query = new Criterion\Image\Dimensions('image', $imageCriteriaData); ``` ### REST API diff --git a/docs/search/criteria_reference/imagefilesize_criterion.md b/docs/search/criteria_reference/imagefilesize_criterion.md index 04b85a8024..eb25310bf8 100644 --- a/docs/search/criteria_reference/imagefilesize_criterion.md +++ b/docs/search/criteria_reference/imagefilesize_criterion.md @@ -17,7 +17,11 @@ The `FileSize` Search Criterion searches for image with specified size. ### PHP ``` php -$query->query = new Criterion\FileSize('image', 0, 1.5); +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); +$query->query = new Criterion\Image\FileSize('image', 0, 1.5); ``` ### REST API diff --git a/docs/search/criteria_reference/imageheight_criterion.md b/docs/search/criteria_reference/imageheight_criterion.md index 5f1ff96c79..b612f87637 100644 --- a/docs/search/criteria_reference/imageheight_criterion.md +++ b/docs/search/criteria_reference/imageheight_criterion.md @@ -17,5 +17,9 @@ The `Height` Search Criterion searches for image with specified height. ### PHP ``` php -$query->query = new Criterion\Height('image', 0, 1500); +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); +$query->query = new Criterion\Image\Height('image', 0, 1500); ``` diff --git a/docs/search/criteria_reference/imagemimetype_criterion.md b/docs/search/criteria_reference/imagemimetype_criterion.md index f494232d6c..44120a403f 100644 --- a/docs/search/criteria_reference/imagemimetype_criterion.md +++ b/docs/search/criteria_reference/imagemimetype_criterion.md @@ -16,18 +16,26 @@ The `MimeType` Search Criterion searches for image with specified mime type(s). ### PHP ``` php -$query->query = new Criterion\MimeType('image', 'image/jpeg'); +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); +$query->query = new Criterion\Image\MimeType('image', 'image/jpeg'); ``` or ```php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $mimeTypes = [ 'image/jpeg', 'image/png', ]; -$query->query = new Criterion\MimeType('image', $mimeTypes); +$query->query = new Criterion\Image\MimeType('image', $mimeTypes); ``` ### REST API diff --git a/docs/search/criteria_reference/imageorientation_criterion.md b/docs/search/criteria_reference/imageorientation_criterion.md index 1829d957a0..820b054e41 100644 --- a/docs/search/criteria_reference/imageorientation_criterion.md +++ b/docs/search/criteria_reference/imageorientation_criterion.md @@ -16,17 +16,29 @@ Supported orientation values: landscape, portrait and square. ### PHP +#### Single orientation value + ``` php -$query->query = new Criterion\Orientation('image', 'landscape'); +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Image\Orientation; + +$query = new Query(); +$query->query = new Orientation('image', 'landscape'); +``` -OR +#### Multiple orientation values +``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Image\Orientation; +$query = new Query(); $orientations = [ 'landscape', 'portrait', ]; -$query->query = new Criterion\Orientation('image', $orientations); +$query->query = new Orientation('image', $orientations); ``` ### REST API diff --git a/docs/search/criteria_reference/imagewidth_criterion.md b/docs/search/criteria_reference/imagewidth_criterion.md index 34ec3293c7..209a2e6164 100644 --- a/docs/search/criteria_reference/imagewidth_criterion.md +++ b/docs/search/criteria_reference/imagewidth_criterion.md @@ -17,5 +17,9 @@ The `Width` Search Criterion searches for image with specified width. ### PHP ``` php -$query->query = new Criterion\Width('image', 150, 1000); +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); +$query->query = new Criterion\Image\Width('image', 150, 1000); ``` diff --git a/docs/search/criteria_reference/integerattribute_criterion.md b/docs/search/criteria_reference/integerattribute_criterion.md index bb71bed820..f25dafffd8 100644 --- a/docs/search/criteria_reference/integerattribute_criterion.md +++ b/docs/search/criteria_reference/integerattribute_criterion.md @@ -16,6 +16,9 @@ The `IntegerAttribute` Search Criterion searches for products by the value of th ### PHP ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\IntegerAttribute( diff --git a/docs/search/criteria_reference/iscontainer_criterion.md b/docs/search/criteria_reference/iscontainer_criterion.md index b30f2d6313..1aac663f2b 100644 --- a/docs/search/criteria_reference/iscontainer_criterion.md +++ b/docs/search/criteria_reference/iscontainer_criterion.md @@ -16,6 +16,10 @@ The [`IsContainer` Search Criterion](/api/php_api/php_api_reference/classes/Ibex ### PHP ```php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\IsContainer(); // Finds containers $query->query = new Criterion\IsContainer(false); // Finds non-containers ``` diff --git a/docs/search/criteria_reference/iscurrencyenabled_criterion.md b/docs/search/criteria_reference/iscurrencyenabled_criterion.md index 1985d5f8e2..d470584211 100644 --- a/docs/search/criteria_reference/iscurrencyenabled_criterion.md +++ b/docs/search/criteria_reference/iscurrencyenabled_criterion.md @@ -20,5 +20,9 @@ The `IsCurrencyEnabledCriterion` Criterion isn't available in Solr or Elasticsea ### PHP ``` php -$query->query = new \Ibexa\Contracts\ProductCatalog\Values\Currency\Query\Criterion\IsCurrencyEnabledCriterion(); +use Ibexa\Contracts\ProductCatalog\Values\Currency\CurrencyQuery; + +$query = new CurrencyQuery( + new \Ibexa\Contracts\ProductCatalog\Values\Currency\Query\Criterion\IsCurrencyEnabledCriterion() +); ``` diff --git a/docs/search/criteria_reference/isfieldempty_criterion.md b/docs/search/criteria_reference/isfieldempty_criterion.md index f8598b0397..3706a2e600 100644 --- a/docs/search/criteria_reference/isfieldempty_criterion.md +++ b/docs/search/criteria_reference/isfieldempty_criterion.md @@ -26,6 +26,10 @@ For this use case, use [`TaxonomyNoEntries`](taxonomy_no_entries.md) instead. ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\IsFieldEmpty('title'); ``` @@ -34,6 +38,10 @@ $query->query = new Criterion\IsFieldEmpty('title'); You can use the `IsFieldEmpty` Criterion to search for articles that don't have an image: ``` php hl_lines="4" +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + $query = new LocationQuery; $query->query = new Criterion\LogicalAnd([ new Criterion\ContentTypeIdentifier('article'), diff --git a/docs/search/criteria_reference/ismainlocation_criterion.md b/docs/search/criteria_reference/ismainlocation_criterion.md index 8b0172d691..6508867d33 100644 --- a/docs/search/criteria_reference/ismainlocation_criterion.md +++ b/docs/search/criteria_reference/ismainlocation_criterion.md @@ -18,5 +18,10 @@ representing whether to search for a main or not main location ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Location\IsMainLocation; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\Location\IsMainLocation(IsMainLocation::MAIN); ``` diff --git a/docs/search/criteria_reference/isproductbased_criterion.md b/docs/search/criteria_reference/isproductbased_criterion.md index 077682c18f..fb1d4ae184 100644 --- a/docs/search/criteria_reference/isproductbased_criterion.md +++ b/docs/search/criteria_reference/isproductbased_criterion.md @@ -11,5 +11,9 @@ The `IsProductBased` Search Criterion searches for content that plays the role o ### PHP ``` php -$query->query = new Ibexa\Contracts\ProductCatalog\Values\Content\Query\Criterion\IsProductBased(); +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); +$query->query = new \Ibexa\Contracts\ProductCatalog\Values\Content\Query\Criterion\IsProductBased(); ``` diff --git a/docs/search/criteria_reference/isuserbased_criterion.md b/docs/search/criteria_reference/isuserbased_criterion.md index c3302d0db0..0b5c9c4e1e 100644 --- a/docs/search/criteria_reference/isuserbased_criterion.md +++ b/docs/search/criteria_reference/isuserbased_criterion.md @@ -25,6 +25,10 @@ The `IsUserBased` Criterion isn't available in Solr or Elasticsearch engines. ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\IsUserBased(); ``` diff --git a/docs/search/criteria_reference/isuserenabled_criterion.md b/docs/search/criteria_reference/isuserenabled_criterion.md index d95e3b29ad..4a93c6bc35 100644 --- a/docs/search/criteria_reference/isuserenabled_criterion.md +++ b/docs/search/criteria_reference/isuserenabled_criterion.md @@ -16,6 +16,10 @@ The [`IsUserEnabled` Search Criterion](/api/php_api/php_api_reference/classes/Ib ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\IsUserEnabled(); ``` diff --git a/docs/search/criteria_reference/isvirtual_criterion.md b/docs/search/criteria_reference/isvirtual_criterion.md index 26be439adb..7aef8f79cd 100644 --- a/docs/search/criteria_reference/isvirtual_criterion.md +++ b/docs/search/criteria_reference/isvirtual_criterion.md @@ -15,6 +15,9 @@ The `IsVirtual` Search Criterion searches for virtual or physical products. ### PHP ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\IsVirtual(true) diff --git a/docs/search/criteria_reference/languagecode_criterion.md b/docs/search/criteria_reference/languagecode_criterion.md index b4a977db2f..a7ec7a1632 100644 --- a/docs/search/criteria_reference/languagecode_criterion.md +++ b/docs/search/criteria_reference/languagecode_criterion.md @@ -16,6 +16,10 @@ The [`LanguageCode` Search Criterion](/api/php_api/php_api_reference/classes/Ibe ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\LanguageCode('ger-DE', false); ``` @@ -47,6 +51,10 @@ You can use the `LanguageCode` Criterion to search for articles that are lacking into a specific language: ``` php hl_lines="5" +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + $query = new LocationQuery; $query->query = new Criterion\LogicalAnd([ new Criterion\ContentTypeIdentifier('article'), @@ -56,13 +64,12 @@ $query->query = new Criterion\LogicalAnd([ ] ); -$results = $this->searchService->findContent($query); -$articles = []; +/** @var \Ibexa\Contracts\Core\Repository\SearchService $searchService */ +$results = $searchService->findContent($query); +$articlesToTranslate = []; foreach ($results->searchHits as $searchHit) { - $articles[] = $searchHit; + $articlesToTranslate[] = $searchHit; } -return $this->render('list/articles_to_translate.html.twig', [ - 'articles' => $articles, -]); +return $articlesToTranslate; ``` diff --git a/docs/search/criteria_reference/locationid_criterion.md b/docs/search/criteria_reference/locationid_criterion.md index 63169e9c71..b2892f9179 100644 --- a/docs/search/criteria_reference/locationid_criterion.md +++ b/docs/search/criteria_reference/locationid_criterion.md @@ -15,6 +15,10 @@ The [`LocationId` Search Criterion](/api/php_api/php_api_reference/classes/Ibexa ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\LocationId(62); ``` diff --git a/docs/search/criteria_reference/locationremoteid_criterion.md b/docs/search/criteria_reference/locationremoteid_criterion.md index d79bfd1aec..1c3380d6fe 100644 --- a/docs/search/criteria_reference/locationremoteid_criterion.md +++ b/docs/search/criteria_reference/locationremoteid_criterion.md @@ -15,6 +15,10 @@ The [`LocationRemoteId` Search Criterion](/api/php_api/php_api_reference/classes ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\LocationRemoteId(['4d1e5f216c0a7aaab7f005ffd4b6a8a8', 'b81ef3e62b514188bfddd2a80d447d34']); ``` diff --git a/docs/search/criteria_reference/logicaland_criterion.md b/docs/search/criteria_reference/logicaland_criterion.md index b4afdf3276..5545cbca5b 100644 --- a/docs/search/criteria_reference/logicaland_criterion.md +++ b/docs/search/criteria_reference/logicaland_criterion.md @@ -17,9 +17,13 @@ When querying for [products](product_api.md), use [LogicalAnd](/api/php_api/php_ ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; + +$query = new Query(); $query->query = new Criterion\LogicalAnd([ new Criterion\ContentTypeIdentifier('article'), - new Criterion\SectionIdentifier(['sports', 'news']); + new Criterion\SectionIdentifier(['sports', 'news']), ] ); ``` diff --git a/docs/search/criteria_reference/logicalnot_criterion.md b/docs/search/criteria_reference/logicalnot_criterion.md index 444c2702fb..6d469f98b3 100644 --- a/docs/search/criteria_reference/logicalnot_criterion.md +++ b/docs/search/criteria_reference/logicalnot_criterion.md @@ -15,8 +15,14 @@ It takes only one Criterion in the array parameter. ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$contentTypeIdentifier = 'article'; + +$query = new Query(); $query->filter = new Criterion\LogicalNot( - new Criterion\ContentTypeIdentifier($contentTypeId) + new Criterion\ContentTypeIdentifier($contentTypeIdentifier) ); ``` diff --git a/docs/search/criteria_reference/logicalor_criterion.md b/docs/search/criteria_reference/logicalor_criterion.md index 657f9c94ec..03e030422c 100644 --- a/docs/search/criteria_reference/logicalor_criterion.md +++ b/docs/search/criteria_reference/logicalor_criterion.md @@ -17,9 +17,13 @@ When querying for [products](product_api.md), use [LogicalOr](/api/php_api/php_a ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; + +$query = new Query(); $query->filter = new Criterion\LogicalOr([ new Criterion\ContentTypeIdentifier('article'), - new Criterion\SectionIdentifier(['sports', 'news']); + new Criterion\SectionIdentifier(['sports', 'news']) ] ); ``` diff --git a/docs/search/criteria_reference/maplocationdistance_criterion.md b/docs/search/criteria_reference/maplocationdistance_criterion.md index 6592008687..f949779d0e 100644 --- a/docs/search/criteria_reference/maplocationdistance_criterion.md +++ b/docs/search/criteria_reference/maplocationdistance_criterion.md @@ -28,5 +28,9 @@ The `MapLocationDistance` Criterion isn't available in [Repository filtering](se ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\MapLocationDistance('location', Criterion\Operator::LTE, 5, 51.395973, 22.531696); ``` diff --git a/docs/search/criteria_reference/objectstateid_criterion.md b/docs/search/criteria_reference/objectstateid_criterion.md index f080cbaae9..9ed385987d 100644 --- a/docs/search/criteria_reference/objectstateid_criterion.md +++ b/docs/search/criteria_reference/objectstateid_criterion.md @@ -15,6 +15,10 @@ The [`ObjectStateId` Search Criterion](/api/php_api/php_api_reference/classes/Ib ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\ObjectStateId([4, 5]); ``` diff --git a/docs/search/criteria_reference/objectstateidentifier_criterion.md b/docs/search/criteria_reference/objectstateidentifier_criterion.md index 75e7153828..edbaeeef8f 100644 --- a/docs/search/criteria_reference/objectstateidentifier_criterion.md +++ b/docs/search/criteria_reference/objectstateidentifier_criterion.md @@ -16,10 +16,18 @@ The [`ObjectStateIdentifier` Search Criterion](/api/php_api/php_api_reference/cl ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\ObjectStateIdentifier(['ready']); ``` ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\ObjectStateIdentifier(['not_locked'], 'ibexa_lock'); ``` diff --git a/docs/search/criteria_reference/order_company_associated_criterion.md b/docs/search/criteria_reference/order_company_associated_criterion.md index ee55c07a30..84e9529614 100644 --- a/docs/search/criteria_reference/order_company_associated_criterion.md +++ b/docs/search/criteria_reference/order_company_associated_criterion.md @@ -16,6 +16,9 @@ The `IsCompanyAssociatedCriterion` Search Criterion searches for orders based on ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\OrderManagement\Value\Order\OrderQuery; + $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\IsCompanyAssociatedCriterion(true) ); diff --git a/docs/search/criteria_reference/order_company_name_criterion.md b/docs/search/criteria_reference/order_company_name_criterion.md index 1f65ad8494..170fd0eaaa 100644 --- a/docs/search/criteria_reference/order_company_name_criterion.md +++ b/docs/search/criteria_reference/order_company_name_criterion.md @@ -16,6 +16,9 @@ The `CompanyNameCriterion` Search Criterion searches for orders based on the nam ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\OrderManagement\Value\Order\OrderQuery; + $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\CompanyNameCriterion('IBM') ); diff --git a/docs/search/criteria_reference/order_created_criterion.md b/docs/search/criteria_reference/order_created_criterion.md index aa59007fff..a263bb160c 100644 --- a/docs/search/criteria_reference/order_created_criterion.md +++ b/docs/search/criteria_reference/order_created_criterion.md @@ -17,6 +17,9 @@ The `CreatedAtCriterion` Search Criterion searches for orders based on the date ### PHP ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\OrderManagement\Value\Order\OrderQuery; + $criteria = new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\CreatedAtCriterion( new DateTime('2023-03-01'), 'GTE' diff --git a/docs/search/criteria_reference/order_currency_code_criterion.md b/docs/search/criteria_reference/order_currency_code_criterion.md index 9348a743a3..9f0b5f639c 100644 --- a/docs/search/criteria_reference/order_currency_code_criterion.md +++ b/docs/search/criteria_reference/order_currency_code_criterion.md @@ -16,6 +16,9 @@ The `CurrencyCodeCriterion` Search Criterion searches for orders based on the cu ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\OrderManagement\Value\Order\OrderQuery; + $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\CurrencyCodeCriterion('USD') ); diff --git a/docs/search/criteria_reference/order_customer_name_criterion.md b/docs/search/criteria_reference/order_customer_name_criterion.md index 80b0fc08d5..6f72425cc1 100644 --- a/docs/search/criteria_reference/order_customer_name_criterion.md +++ b/docs/search/criteria_reference/order_customer_name_criterion.md @@ -16,6 +16,9 @@ The `CustomerNameCriterion` Search Criterion searches for orders based on the na ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\OrderManagement\Value\Order\OrderQuery; + $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\CustomerNameCriterion('john') ); diff --git a/docs/search/criteria_reference/order_identifier_criterion.md b/docs/search/criteria_reference/order_identifier_criterion.md index 4da72e5ab1..107c4fa62d 100644 --- a/docs/search/criteria_reference/order_identifier_criterion.md +++ b/docs/search/criteria_reference/order_identifier_criterion.md @@ -16,6 +16,9 @@ The `IdentifierCriterion` Search Criterion searches for orders based on the orde ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\OrderManagement\Value\Order\OrderQuery; + $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\IdentifierCriterion('f7578972-e7f4-4cae-85dc-a7c74610204e') ); diff --git a/docs/search/criteria_reference/order_owner_criterion.md b/docs/search/criteria_reference/order_owner_criterion.md index 320071b135..4b977a1e09 100644 --- a/docs/search/criteria_reference/order_owner_criterion.md +++ b/docs/search/criteria_reference/order_owner_criterion.md @@ -9,14 +9,20 @@ The `OwnerCriterion` Criterion searches for orders based on the user reference. ## Arguments -- `UserReference` object - \Ibexa\Contracts\Core\Repository\Values\User\UserReference(int $userId) +- `UserReference` object - new \Ibexa\Core\Repository\Values\User\UserReference(int $userId) ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\OrderManagement\Value\Order\OrderQuery; + +/** @var \Ibexa\Contracts\Core\Repository\UserService $userService */ +$user = $userService->loadUserByLogin('user'); + $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\OwnerCriterion( - \Ibexa\Contracts\Core\Repository\Values\User\UserReference(14) + $user ) ); ``` @@ -24,12 +30,19 @@ $query = new OrderQuery( `OwnerCriterion` Criterion accepts also multiple values: ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\OrderManagement\Value\Order\OrderQuery; + +/** @var \Ibexa\Contracts\Core\Repository\UserService $userService */ +$user1 = $userService->loadUser(12345); +$user2 = $userService->loadUserByLogin('user'); + $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\OwnerCriterion( [ - \Ibexa\Contracts\Core\Repository\Values\User\UserReference(14), - \Ibexa\Contracts\Core\Repository\Values\User\UserReference(123), + $user1, + $user2, ] ) ); -``` \ No newline at end of file +``` diff --git a/docs/search/criteria_reference/order_price_criterion.md b/docs/search/criteria_reference/order_price_criterion.md index 745ca2a126..e72f32c77b 100644 --- a/docs/search/criteria_reference/order_price_criterion.md +++ b/docs/search/criteria_reference/order_price_criterion.md @@ -17,6 +17,9 @@ The `PriceCriterion` searches for orders by their total net value. ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\OrderManagement\Value\Order\OrderQuery; + $criteria = new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\PriceCriterion( 12900, 'GTE' diff --git a/docs/search/criteria_reference/order_source_criterion.md b/docs/search/criteria_reference/order_source_criterion.md index 53abd3a519..956fae1ec3 100644 --- a/docs/search/criteria_reference/order_source_criterion.md +++ b/docs/search/criteria_reference/order_source_criterion.md @@ -16,6 +16,9 @@ The `SourceCriterion` Search Criterion searches for orders based on the source o ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\OrderManagement\Value\Order\OrderQuery; + $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\SourceCriterion('local_shop') ); diff --git a/docs/search/criteria_reference/order_status_criterion.md b/docs/search/criteria_reference/order_status_criterion.md index e6f3f5cb48..237b202694 100644 --- a/docs/search/criteria_reference/order_status_criterion.md +++ b/docs/search/criteria_reference/order_status_criterion.md @@ -16,6 +16,9 @@ The `StatusCriterion` Search Criterion searches for orders based on order status ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\OrderManagement\Value\Order\OrderQuery; + $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\StatusCriterion('pending') ); diff --git a/docs/search/criteria_reference/parentlocationid_criterion.md b/docs/search/criteria_reference/parentlocationid_criterion.md index e30307eeb0..62a3d08661 100644 --- a/docs/search/criteria_reference/parentlocationid_criterion.md +++ b/docs/search/criteria_reference/parentlocationid_criterion.md @@ -16,6 +16,10 @@ searches for content based on the Location ID of its parent. ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\ParentLocationId([54, 58]); ``` @@ -46,6 +50,12 @@ $query->query = new Criterion\ParentLocationId([54, 58]); You can use the `ParentLocationId` Search Criterion to list blog posts contained in a blog: ``` php hl_lines="4" +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +/** @var int $locationId */ +/** @var object{searchService: \Ibexa\Contracts\Core\Repository\SearchService} $this */ $query = new LocationQuery(); $query->query = new Criterion\LogicalAnd([ new Criterion\Visibility(Criterion\Visibility::VISIBLE), @@ -58,6 +68,7 @@ foreach ($results->searchHits as $searchHit) { $posts[] = $searchHit; } +// @phpstan-ignore-next-line return $this->render('full/blog.html.twig', [ 'posts' => $posts, ]); diff --git a/docs/search/criteria_reference/payment_createdat_criterion.md b/docs/search/criteria_reference/payment_createdat_criterion.md index d43536e7e1..0588a4b115 100644 --- a/docs/search/criteria_reference/payment_createdat_criterion.md +++ b/docs/search/criteria_reference/payment_createdat_criterion.md @@ -17,6 +17,9 @@ The `CreatedAt` Search Criterion searches for payments based on the date when th ### PHP ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\Payment\Payment\PaymentQuery; + $criteria = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\CreatedAt( new DateTime('2023-03-01') ); diff --git a/docs/search/criteria_reference/payment_currency_criterion.md b/docs/search/criteria_reference/payment_currency_criterion.md index 524561faed..59829269d6 100644 --- a/docs/search/criteria_reference/payment_currency_criterion.md +++ b/docs/search/criteria_reference/payment_currency_criterion.md @@ -16,5 +16,9 @@ The `Currency` Search Criterion searches for payments based on the currency code ### PHP ``` php -$query->query = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\Currency('EUR'); +use Ibexa\Contracts\Payment\Payment\PaymentQuery; + +$query = new PaymentQuery( + new \Ibexa\Contracts\Payment\Payment\Query\Criterion\Currency('EUR') +); ``` diff --git a/docs/search/criteria_reference/payment_id_criterion.md b/docs/search/criteria_reference/payment_id_criterion.md index 3ccd16044d..6c1a9bfeb3 100644 --- a/docs/search/criteria_reference/payment_id_criterion.md +++ b/docs/search/criteria_reference/payment_id_criterion.md @@ -16,5 +16,9 @@ The `Id` Search Criterion searches for payments based on the payment ID. ### PHP ``` php -$query->query = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\Id(2); +use Ibexa\Contracts\Payment\Payment\PaymentQuery; + +$query = new PaymentQuery( + new \Ibexa\Contracts\Payment\Payment\Query\Criterion\Id(2) +); ``` diff --git a/docs/search/criteria_reference/payment_identifier_criterion.md b/docs/search/criteria_reference/payment_identifier_criterion.md index 0f6ca32dfc..7de17744f0 100644 --- a/docs/search/criteria_reference/payment_identifier_criterion.md +++ b/docs/search/criteria_reference/payment_identifier_criterion.md @@ -16,5 +16,9 @@ The `Identifier` Search Criterion searches for payments based on the payment ide ### PHP ``` php -$query->query = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\Identifier('f7578972-e7f4-4cae-85dc-a7c74610204e'); +use Ibexa\Contracts\Payment\Payment\PaymentQuery; + +$query = new PaymentQuery( + new \Ibexa\Contracts\Payment\Payment\Query\Criterion\Identifier('f7578972-e7f4-4cae-85dc-a7c74610204e') +); ``` diff --git a/docs/search/criteria_reference/payment_logicaland_criterion.md b/docs/search/criteria_reference/payment_logicaland_criterion.md index fc51f0ab28..1d947d8c0c 100644 --- a/docs/search/criteria_reference/payment_logicaland_criterion.md +++ b/docs/search/criteria_reference/payment_logicaland_criterion.md @@ -16,10 +16,14 @@ The `LogicalAnd` Search Criterion matches payments if all provided Criteria matc ### PHP ``` php -$query->query = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\LogicalAnd( - [ - new \Ibexa\Contracts\Payment\Payment\Query\Criterion\CreatedAt(new DateTime('2023-03-01')); - new \Ibexa\Contracts\Payment\Payment\Query\Criterion\Currency('USD'); - ] -); +use Ibexa\Contracts\Payment\Payment\PaymentQuery; +use Ibexa\Contracts\Payment\Payment\Query\Criterion\CreatedAt; +use Ibexa\Contracts\Payment\Payment\Query\Criterion\Currency; +use Ibexa\Contracts\Payment\Payment\Query\Criterion\LogicalAnd; + +$query = new PaymentQuery(); +$query->setQuery(new LogicalAnd( + new CreatedAt(new DateTime('2023-03-01')), + new Currency('USD'), +)); ``` diff --git a/docs/search/criteria_reference/payment_logicalor_criterion.md b/docs/search/criteria_reference/payment_logicalor_criterion.md index 0ab036ebc9..e20bc93559 100644 --- a/docs/search/criteria_reference/payment_logicalor_criterion.md +++ b/docs/search/criteria_reference/payment_logicalor_criterion.md @@ -16,10 +16,14 @@ The `LogicalOr` Search Criterion matches payments if at least one of the provide ### PHP ``` php -$query->query = new Criterion\LogicalOr( - [ - new \Ibexa\Contracts\Payment\Payment\Query\Criterion\CreatedAt(new DateTime('2023-03-01')); - new \Ibexa\Contracts\Payment\Payment\Query\Criterion\Currency('USD'); - ] -); +use Ibexa\Contracts\Payment\Payment\PaymentQuery; +use Ibexa\Contracts\Payment\Payment\Query\Criterion\CreatedAt; +use Ibexa\Contracts\Payment\Payment\Query\Criterion\Currency; +use Ibexa\Contracts\Payment\Payment\Query\Criterion\LogicalOr; + +$query = new PaymentQuery(); +$query->setQuery(new LogicalOr( + new CreatedAt(new DateTime('2023-03-01')), + new Currency('USD'), +)); ``` diff --git a/docs/search/criteria_reference/payment_method_createdat_criterion.md b/docs/search/criteria_reference/payment_method_createdat_criterion.md index eac4ce8ab2..7160d1e177 100644 --- a/docs/search/criteria_reference/payment_method_createdat_criterion.md +++ b/docs/search/criteria_reference/payment_method_createdat_criterion.md @@ -17,6 +17,9 @@ The `CreatedAt` Search Criterion searches for payment methods based on the date ### PHP ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\Payment\PaymentMethod\PaymentMethodQuery; + $criteria = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\CreatedAt( new DateTime('2023-03-01') ); diff --git a/docs/search/criteria_reference/payment_method_enabled_criterion.md b/docs/search/criteria_reference/payment_method_enabled_criterion.md index b9671b987d..2447da755f 100644 --- a/docs/search/criteria_reference/payment_method_enabled_criterion.md +++ b/docs/search/criteria_reference/payment_method_enabled_criterion.md @@ -16,5 +16,9 @@ The `Enabled` Search Criterion searches for payment methods based on whether the ### PHP ``` php -$query->query = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\Enabled(true); +use Ibexa\Contracts\Payment\PaymentMethod\PaymentMethodQuery; + +$query = new PaymentMethodQuery( + new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\Enabled(true) +); ``` diff --git a/docs/search/criteria_reference/payment_method_id_criterion.md b/docs/search/criteria_reference/payment_method_id_criterion.md index c1ca101653..2a2a7fb661 100644 --- a/docs/search/criteria_reference/payment_method_id_criterion.md +++ b/docs/search/criteria_reference/payment_method_id_criterion.md @@ -16,5 +16,9 @@ The `Id` Search Criterion searches for payment methods based on the payment meth ### PHP ``` php -$query->query = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\Id(2); +use Ibexa\Contracts\Payment\PaymentMethod\PaymentMethodQuery; + +$query = new PaymentMethodQuery( + new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\Id(2) +); ``` diff --git a/docs/search/criteria_reference/payment_method_identifier_criterion.md b/docs/search/criteria_reference/payment_method_identifier_criterion.md index 04fdcc21a0..809cf68adc 100644 --- a/docs/search/criteria_reference/payment_method_identifier_criterion.md +++ b/docs/search/criteria_reference/payment_method_identifier_criterion.md @@ -16,5 +16,9 @@ The `Identifier` Search Criterion searches for payment methods based on the paym ### PHP ``` php -$query->query = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\Identifier('f7578972-e7f4-4cae-85dc-a7c74610204e'); +use Ibexa\Contracts\Payment\PaymentMethod\PaymentMethodQuery; + +$query = new PaymentMethodQuery( + new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\Identifier('f7578972-e7f4-4cae-85dc-a7c74610204e') +); ``` diff --git a/docs/search/criteria_reference/payment_method_logicaland_criterion.md b/docs/search/criteria_reference/payment_method_logicaland_criterion.md index b903040e18..2ebc5e2ef5 100644 --- a/docs/search/criteria_reference/payment_method_logicaland_criterion.md +++ b/docs/search/criteria_reference/payment_method_logicaland_criterion.md @@ -16,10 +16,14 @@ The `LogicalAnd` Search Criterion matches payment methods if all provided Criter ### PHP ``` php -$query->query = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\LogicalAnd( - [ - new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\CreatedAt(new DateTime('2023-03-01')); - new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\Enabled(true); - ] -); +use Ibexa\Contracts\Payment\PaymentMethod\PaymentMethodQuery; +use Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\CreatedAt; +use Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\Enabled; +use Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\LogicalAnd; + +$query = new PaymentMethodQuery(); +$query->setQuery(new LogicalAnd( + new CreatedAt(new DateTime('2023-03-01')), + new Enabled(true), +)); ``` diff --git a/docs/search/criteria_reference/payment_method_logicalor_criterion.md b/docs/search/criteria_reference/payment_method_logicalor_criterion.md index 92b0992efe..3798f92745 100644 --- a/docs/search/criteria_reference/payment_method_logicalor_criterion.md +++ b/docs/search/criteria_reference/payment_method_logicalor_criterion.md @@ -16,10 +16,13 @@ The `LogicalOr` Search Criterion matches payment methods if at least one of the ### PHP ``` php -$query->query = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\LogicalOr( - [ - new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\CreatedAt(new DateTime('2023-03-01')); - new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\CreatedAt(new DateTime('2023-05-01')); - ] -); +use Ibexa\Contracts\Payment\PaymentMethod\PaymentMethodQuery; +use Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\CreatedAt; +use Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\LogicalOr; + +$query = new PaymentMethodQuery(); +$query->setQuery(new LogicalOr( + new CreatedAt(new DateTime('2023-03-01')), + new CreatedAt(new DateTime('2023-05-01')), +)); ``` diff --git a/docs/search/criteria_reference/payment_method_name_criterion.md b/docs/search/criteria_reference/payment_method_name_criterion.md index 0131233c5c..95499b72c6 100644 --- a/docs/search/criteria_reference/payment_method_name_criterion.md +++ b/docs/search/criteria_reference/payment_method_name_criterion.md @@ -16,5 +16,9 @@ The `Name` Search Criterion searches for payment methods based on the existing p ### PHP ``` php -$query->query = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\Name('Credit Card'); +use Ibexa\Contracts\Payment\PaymentMethod\PaymentMethodQuery; + +$query = new PaymentMethodQuery( + new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\Name('Credit Card') +); ``` diff --git a/docs/search/criteria_reference/payment_method_type_criterion.md b/docs/search/criteria_reference/payment_method_type_criterion.md index db7e4be3c9..72524ab962 100644 --- a/docs/search/criteria_reference/payment_method_type_criterion.md +++ b/docs/search/criteria_reference/payment_method_type_criterion.md @@ -16,5 +16,12 @@ The `Type` Search Criterion searches for payment methods based on payment method ### PHP ``` php -$query->query = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\Type('offline'); +use Ibexa\Contracts\Payment\PaymentMethod\PaymentMethodQuery; + +/** @var \Ibexa\Contracts\Payment\PaymentMethod\Type\TypeRegistryInterface $paymentMethodTypeRegistry */ +$paymentMethodType = $paymentMethodTypeRegistry->getPaymentMethodType('offline'); + +$query = new PaymentMethodQuery( + new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\Type($paymentMethodType) +); ``` diff --git a/docs/search/criteria_reference/payment_method_updatedat_criterion.md b/docs/search/criteria_reference/payment_method_updatedat_criterion.md index be34b4d8d6..13a04438f6 100644 --- a/docs/search/criteria_reference/payment_method_updatedat_criterion.md +++ b/docs/search/criteria_reference/payment_method_updatedat_criterion.md @@ -17,6 +17,9 @@ The `UpdatedAt` Search Criterion searches for payment methods based on the date ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Payment\PaymentMethod\PaymentMethodQuery; + $criteria = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\UpdatedAt( new DateTime('2023-03-01') ); diff --git a/docs/search/criteria_reference/payment_order_criterion.md b/docs/search/criteria_reference/payment_order_criterion.md index 05b8eacc1a..3eaf004566 100644 --- a/docs/search/criteria_reference/payment_order_criterion.md +++ b/docs/search/criteria_reference/payment_order_criterion.md @@ -16,5 +16,12 @@ The `Order` Search Criterion searches for payments based on an ID of an associat ### PHP ``` php -$query->query = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\Order(4); +use Ibexa\Contracts\Payment\Payment\PaymentQuery; + +/** @var \Ibexa\Contracts\OrderManagement\OrderServiceInterface $orderService */ +$order = $orderService->getOrder(4); + +$query = new PaymentQuery( + new \Ibexa\Contracts\Payment\Payment\Query\Criterion\Order($order) +); ``` diff --git a/docs/search/criteria_reference/payment_payment_method_criterion.md b/docs/search/criteria_reference/payment_payment_method_criterion.md index 1b9bba10b2..98d7d033c3 100644 --- a/docs/search/criteria_reference/payment_payment_method_criterion.md +++ b/docs/search/criteria_reference/payment_payment_method_criterion.md @@ -16,5 +16,12 @@ The `PaymentMethod` Search Criterion searches for payments based on a payment me ### PHP ``` php -$query->query = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\PaymentMethod(2); +use Ibexa\Contracts\Payment\Payment\PaymentQuery; + +/** @var \Ibexa\Contracts\Payment\PaymentMethodServiceInterface $paymentMethodService */ +$paymentMethod = $paymentMethodService->getPaymentMethod(2); + +$query = new PaymentQuery( + new \Ibexa\Contracts\Payment\Payment\Query\Criterion\PaymentMethod($paymentMethod) +); ``` diff --git a/docs/search/criteria_reference/payment_status_criterion.md b/docs/search/criteria_reference/payment_status_criterion.md index c0a037e994..deb1d6d8f2 100644 --- a/docs/search/criteria_reference/payment_status_criterion.md +++ b/docs/search/criteria_reference/payment_status_criterion.md @@ -16,5 +16,9 @@ The `Status` Search Criterion searches for payments based on payment status. ### PHP ``` php -$query->query = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\Status('failed'); +use Ibexa\Contracts\Payment\Payment\PaymentQuery; + +$query = new PaymentQuery( + new \Ibexa\Contracts\Payment\Payment\Query\Criterion\Status('failed') +); ``` diff --git a/docs/search/criteria_reference/payment_updatedat_criterion.md b/docs/search/criteria_reference/payment_updatedat_criterion.md index ec947465a8..8257b614ac 100644 --- a/docs/search/criteria_reference/payment_updatedat_criterion.md +++ b/docs/search/criteria_reference/payment_updatedat_criterion.md @@ -17,6 +17,9 @@ The `UpdatedAt` Search Criterion searches for payments based on the date when th ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Payment\Payment\PaymentQuery; + $criteria = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\UpdatedAt( new DateTime('2023-03-01') ); diff --git a/docs/search/criteria_reference/price_currency_criterion.md b/docs/search/criteria_reference/price_currency_criterion.md index 8d3dd0a10b..c96105d174 100644 --- a/docs/search/criteria_reference/price_currency_criterion.md +++ b/docs/search/criteria_reference/price_currency_criterion.md @@ -15,7 +15,11 @@ The `Currency` Search Criterion searches for prices based on the given currency. ### PHP ``` php -$currency = $priceService->getPriceById('EUR'); +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Price\PriceQuery; + +/** @var \Ibexa\Contracts\ProductCatalog\CurrencyServiceInterface $currencyService */ +$currency = $currencyService->getCurrencyByCode('EUR'); $query = new PriceQuery( new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\Currency($currency) diff --git a/docs/search/criteria_reference/price_customergroup_criterion.md b/docs/search/criteria_reference/price_customergroup_criterion.md index a23aa07446..2c33e1bd64 100644 --- a/docs/search/criteria_reference/price_customergroup_criterion.md +++ b/docs/search/criteria_reference/price_customergroup_criterion.md @@ -15,6 +15,10 @@ The `CustomerGroup` Search Criterion searches for prices based on the customer g ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Price\PriceQuery; + +/** @var \Ibexa\Contracts\ProductCatalog\CustomerGroupServiceInterface $customerGroupService */ $customerGroup = $customerGroupService->getCustomerGroup(123); $query = new PriceQuery( diff --git a/docs/search/criteria_reference/price_isbaseprice_criterion.md b/docs/search/criteria_reference/price_isbaseprice_criterion.md index 28e8cd2478..5c46728084 100644 --- a/docs/search/criteria_reference/price_isbaseprice_criterion.md +++ b/docs/search/criteria_reference/price_isbaseprice_criterion.md @@ -19,6 +19,9 @@ The `IsBasePrice` Criterion isn't available in Solr or Elasticsearch engines. ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Price\PriceQuery; + $query = new PriceQuery( new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\IsBasePrice() ); diff --git a/docs/search/criteria_reference/price_iscustomprice_criterion.md b/docs/search/criteria_reference/price_iscustomprice_criterion.md index 9793e76b44..c407f1bec0 100644 --- a/docs/search/criteria_reference/price_iscustomprice_criterion.md +++ b/docs/search/criteria_reference/price_iscustomprice_criterion.md @@ -19,6 +19,9 @@ The `IsCustomPrice` Criterion isn't available in Solr or Elasticsearch engines. ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Price\PriceQuery; + $query = new PriceQuery( new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\IsCustomPrice() ); diff --git a/docs/search/criteria_reference/price_logicaland_criterion.md b/docs/search/criteria_reference/price_logicaland_criterion.md index ee9ab7c48b..7693f7a8e5 100644 --- a/docs/search/criteria_reference/price_logicaland_criterion.md +++ b/docs/search/criteria_reference/price_logicaland_criterion.md @@ -16,10 +16,13 @@ The `LogicalAnd` Search Criterion matches prices if all provided Criteria match. ### PHP ``` php -$query->query = new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\LogicalAnd( - [ - new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\Currency('USD'), +use Ibexa\Contracts\ProductCatalog\Values\Price\PriceQuery; + +/** @var \Ibexa\Contracts\ProductCatalog\Values\CurrencyInterface $currencyUSD */ +$query = new PriceQuery( + new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\LogicalAnd( + new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\Currency($currencyUSD), new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\IsCustomPrice() - ] + ) ); ``` diff --git a/docs/search/criteria_reference/price_logicalor_criterion.md b/docs/search/criteria_reference/price_logicalor_criterion.md index d3e93a6dc9..5151e271d4 100644 --- a/docs/search/criteria_reference/price_logicalor_criterion.md +++ b/docs/search/criteria_reference/price_logicalor_criterion.md @@ -16,10 +16,14 @@ The `LogicalOr` Search Criterion matches prices if at least one of the provided ### PHP ``` php -$query->query = new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\LogicalOr( - [ - new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\Currency('USD'), - new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\Currency('EUR') - ] +use Ibexa\Contracts\ProductCatalog\Values\Price\PriceQuery; + +/** @var \Ibexa\Contracts\ProductCatalog\Values\CurrencyInterface $currencyUSD */ +/** @var \Ibexa\Contracts\ProductCatalog\Values\CurrencyInterface $currencyEUR */ +$query = new PriceQuery( + new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\LogicalOr( + new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\Currency($currencyUSD), + new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\Currency($currencyEUR) + ) ); ``` diff --git a/docs/search/criteria_reference/price_product_criterion.md b/docs/search/criteria_reference/price_product_criterion.md index 6aaf93a57d..ff213b6a05 100644 --- a/docs/search/criteria_reference/price_product_criterion.md +++ b/docs/search/criteria_reference/price_product_criterion.md @@ -15,6 +15,9 @@ The `Product` Search Criterion searches for prices based on product codes. ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Price\PriceQuery; + $query = new PriceQuery( new \Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\Product('ergo_desk') ); diff --git a/docs/search/criteria_reference/priority_criterion.md b/docs/search/criteria_reference/priority_criterion.md index 34975939d0..2eb275fefd 100644 --- a/docs/search/criteria_reference/priority_criterion.md +++ b/docs/search/criteria_reference/priority_criterion.md @@ -23,5 +23,9 @@ The `value` argument requires: ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\Location\Priority(Criterion\Operator::GTE, 50); ``` diff --git a/docs/search/criteria_reference/productavailability_criterion.md b/docs/search/criteria_reference/productavailability_criterion.md index 21d0455641..50b9e010c4 100644 --- a/docs/search/criteria_reference/productavailability_criterion.md +++ b/docs/search/criteria_reference/productavailability_criterion.md @@ -15,6 +15,9 @@ The `ProductAvailability` Search Criterion searches for products by their availa ### PHP ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductAvailability(true) diff --git a/docs/search/criteria_reference/productcategory_criterion.md b/docs/search/criteria_reference/productcategory_criterion.md index 76d5fa0002..ebf36ff1fe 100644 --- a/docs/search/criteria_reference/productcategory_criterion.md +++ b/docs/search/criteria_reference/productcategory_criterion.md @@ -15,6 +15,9 @@ The `ProductCategory` Search Criterion searches for products by the category the ### PHP ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductCategory([2, 3]) diff --git a/docs/search/criteria_reference/productcode_criterion.md b/docs/search/criteria_reference/productcode_criterion.md index 78655b834d..4e1735921a 100644 --- a/docs/search/criteria_reference/productcode_criterion.md +++ b/docs/search/criteria_reference/productcode_criterion.md @@ -15,6 +15,9 @@ The `ProductCode` Search Criterion searches for products by their codes. ### PHP ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductCode(['ergo_desk', 'alter_desk']) diff --git a/docs/search/criteria_reference/productname_criterion.md b/docs/search/criteria_reference/productname_criterion.md index b19a270ae8..d99b499ae7 100644 --- a/docs/search/criteria_reference/productname_criterion.md +++ b/docs/search/criteria_reference/productname_criterion.md @@ -15,6 +15,9 @@ The `ProductName` Search Criterion searches for products by their names. ### PHP ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductName('sofa*') diff --git a/docs/search/criteria_reference/productstock_criterion.md b/docs/search/criteria_reference/productstock_criterion.md index ed88bc178c..34e3d1a45f 100644 --- a/docs/search/criteria_reference/productstock_criterion.md +++ b/docs/search/criteria_reference/productstock_criterion.md @@ -16,6 +16,9 @@ The `ProductStock` Search Criterion searches for products by their numerical sto ### PHP ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + $productQuery = new ProductQuery( null, new Criterion\ProductStock(10) @@ -23,6 +26,9 @@ $productQuery = new ProductQuery( ``` ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + $productQuery = new ProductQuery( null, new Criterion\ProductStock(50, '>=') diff --git a/docs/search/criteria_reference/productstockrange_criterion.md b/docs/search/criteria_reference/productstockrange_criterion.md index f71c7f5adc..040d0cf677 100644 --- a/docs/search/criteria_reference/productstockrange_criterion.md +++ b/docs/search/criteria_reference/productstockrange_criterion.md @@ -16,6 +16,9 @@ The `ProductStockRange` Search Criterion searches for products by their numerica ### PHP ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + $productQuery = new ProductQuery( null, new Criterion\ProductStockRange(10, 120) diff --git a/docs/search/criteria_reference/producttype_criterion.md b/docs/search/criteria_reference/producttype_criterion.md index aab290dcc7..e59678c751 100644 --- a/docs/search/criteria_reference/producttype_criterion.md +++ b/docs/search/criteria_reference/producttype_criterion.md @@ -15,6 +15,9 @@ The `ProductType` Search Criterion searches for products by their codes. ### PHP ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductType(['dress']) diff --git a/docs/search/criteria_reference/rangemeasurementattributemaximum_criterion.md b/docs/search/criteria_reference/rangemeasurementattributemaximum_criterion.md index c28be6ffd8..be24a6545d 100644 --- a/docs/search/criteria_reference/rangemeasurementattributemaximum_criterion.md +++ b/docs/search/criteria_reference/rangemeasurementattributemaximum_criterion.md @@ -16,11 +16,15 @@ The `RangeMeasurementAttributeMaximum` Search Criterion searches for products by ### PHP ``` php -$value = $this->measurementService->buildSimpleValue('length', 150, 'centimeter'); +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + +/** @var \Ibexa\Contracts\Measurement\MeasurementServiceInterface $measurementService */ +$value = $measurementService->buildSimpleValue('length', 150, 'centimeter'); $query = new ProductQuery( null, - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\RangeMeasurementAttributeMaximum( + new \Ibexa\Contracts\Measurement\Product\Query\Criterion\RangeMeasurementAttributeMaximum( 'length', $value ) diff --git a/docs/search/criteria_reference/rangemeasurementattributeminimum_criterion.md b/docs/search/criteria_reference/rangemeasurementattributeminimum_criterion.md index fb5d54dbad..a352936e24 100644 --- a/docs/search/criteria_reference/rangemeasurementattributeminimum_criterion.md +++ b/docs/search/criteria_reference/rangemeasurementattributeminimum_criterion.md @@ -16,11 +16,15 @@ The `RangeMeasurementAttributeMinimum` Search Criterion searches for products by ### PHP ``` php -$value = $this->measurementService->buildSimpleValue('length', 100, 'centimeter'); +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + +/** @var \Ibexa\Contracts\Measurement\MeasurementServiceInterface $measurementService */ +$value = $measurementService->buildSimpleValue('length', 100, 'centimeter'); $query = new ProductQuery( null, - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\RangeMeasurementAttributeMinimum( + new \Ibexa\Contracts\Measurement\Product\Query\Criterion\RangeMeasurementAttributeMinimum( 'length', $value ) diff --git a/docs/search/criteria_reference/remoteid_criterion.md b/docs/search/criteria_reference/remoteid_criterion.md index 6677715cda..f87e91a919 100644 --- a/docs/search/criteria_reference/remoteid_criterion.md +++ b/docs/search/criteria_reference/remoteid_criterion.md @@ -16,6 +16,10 @@ searches for content based on its remote content ID. ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\RemoteId('abab615dcf26699a4291657152da4337'); ``` diff --git a/docs/search/criteria_reference/sectionid_criterion.md b/docs/search/criteria_reference/sectionid_criterion.md index cfdc257ccb..b7faf8bf2d 100644 --- a/docs/search/criteria_reference/sectionid_criterion.md +++ b/docs/search/criteria_reference/sectionid_criterion.md @@ -15,6 +15,10 @@ The [`SectionId` Search Criterion](/api/php_api/php_api_reference/classes/Ibexa- ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\SectionId(3); ``` diff --git a/docs/search/criteria_reference/sectionidentifier_criterion.md b/docs/search/criteria_reference/sectionidentifier_criterion.md index dea856b606..61ed688c17 100644 --- a/docs/search/criteria_reference/sectionidentifier_criterion.md +++ b/docs/search/criteria_reference/sectionidentifier_criterion.md @@ -15,6 +15,10 @@ The [`SectionIdentifier` Search Criterion](/api/php_api/php_api_reference/classe ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\SectionIdentifier(['sports', 'news']); ``` diff --git a/docs/search/criteria_reference/selectionattribute_criterion.md b/docs/search/criteria_reference/selectionattribute_criterion.md index f8eeeed167..bd9c9bb956 100644 --- a/docs/search/criteria_reference/selectionattribute_criterion.md +++ b/docs/search/criteria_reference/selectionattribute_criterion.md @@ -16,6 +16,9 @@ The `SelectionAttribute` Search Criterion searches for products by the value of ### PHP ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\SelectionAttribute( diff --git a/docs/search/criteria_reference/shipment_createdat_criterion.md b/docs/search/criteria_reference/shipment_createdat_criterion.md index be1ed48ff6..e0574ebb9a 100644 --- a/docs/search/criteria_reference/shipment_createdat_criterion.md +++ b/docs/search/criteria_reference/shipment_createdat_criterion.md @@ -17,6 +17,9 @@ The `CreatedAt` Search Criterion searches for shipments based on the date when t ### PHP ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\Shipping\Shipment\ShipmentQuery; + $criteria = new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\CreatedAt( new DateTime('2023-03-01 14:07:02'), 'GTE' diff --git a/docs/search/criteria_reference/shipment_currency_criterion.md b/docs/search/criteria_reference/shipment_currency_criterion.md index eeb2e7e9b2..3081565e85 100644 --- a/docs/search/criteria_reference/shipment_currency_criterion.md +++ b/docs/search/criteria_reference/shipment_currency_criterion.md @@ -16,7 +16,10 @@ The `Currency` Search Criterion searches for shipments based on the currency cod ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Shipping\Shipment\ShipmentQuery; + $query = new ShipmentQuery( - new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\Currency('USD', 'CZK') + new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\Currency(['USD', 'CZK']) ); ``` diff --git a/docs/search/criteria_reference/shipment_id_criterion.md b/docs/search/criteria_reference/shipment_id_criterion.md index 782150cccd..36a7fb0479 100644 --- a/docs/search/criteria_reference/shipment_id_criterion.md +++ b/docs/search/criteria_reference/shipment_id_criterion.md @@ -16,6 +16,9 @@ The `Id` Search Criterion searches for shipments based on the shipment ID. ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Shipping\Shipment\ShipmentQuery; + $query = new ShipmentQuery( new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\Id(2) ); diff --git a/docs/search/criteria_reference/shipment_identifier_criterion.md b/docs/search/criteria_reference/shipment_identifier_criterion.md index df67826223..db55e3c658 100644 --- a/docs/search/criteria_reference/shipment_identifier_criterion.md +++ b/docs/search/criteria_reference/shipment_identifier_criterion.md @@ -16,6 +16,9 @@ The `Identifier` Search Criterion searches for shipments based on the shipment i ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Shipping\Shipment\ShipmentQuery; + $query = new ShipmentQuery( new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\Identifier('f1t7z-3rb3rt') ); diff --git a/docs/search/criteria_reference/shipment_logicaland_criterion.md b/docs/search/criteria_reference/shipment_logicaland_criterion.md index c77c345282..387e4c3bcf 100644 --- a/docs/search/criteria_reference/shipment_logicaland_criterion.md +++ b/docs/search/criteria_reference/shipment_logicaland_criterion.md @@ -16,10 +16,13 @@ The `LogicalAnd` Search Criterion matches shipments if all provided Criteria mat ### PHP ``` php -$query->query = new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\LogicalAnd( - [ +use Ibexa\Contracts\Shipping\Shipment\ShipmentQuery; + +/** @var \Ibexa\Contracts\Shipping\Value\ShippingMethod\ShippingMethodInterface $shippingMethod */ +$query = new ShipmentQuery( + new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\LogicalAnd( new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\CreatedAt(new DateTime('2023-03-01')), new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\ShippingMethod($shippingMethod) - ] + ) ); ``` diff --git a/docs/search/criteria_reference/shipment_logicalor_criterion.md b/docs/search/criteria_reference/shipment_logicalor_criterion.md index 2903abb758..16a07037ff 100644 --- a/docs/search/criteria_reference/shipment_logicalor_criterion.md +++ b/docs/search/criteria_reference/shipment_logicalor_criterion.md @@ -16,10 +16,13 @@ The `LogicalOr` Search Criterion matches shipments if at least one of the provid ### PHP ``` php -$query->query = new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\LogicalOr( - [ +use Ibexa\Contracts\Shipping\Shipment\ShipmentQuery; + +/** @var \Ibexa\Contracts\Shipping\Value\ShippingMethod\ShippingMethodInterface $shippingMethod */ +$query = new ShipmentQuery( + new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\LogicalOr( new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\CreatedAt(new DateTime('2023-03-01')), new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\ShippingMethod($shippingMethod) - ] + ) ); ``` diff --git a/docs/search/criteria_reference/shipment_owner_criterion.md b/docs/search/criteria_reference/shipment_owner_criterion.md index 79c9e81c3c..d836ff406d 100644 --- a/docs/search/criteria_reference/shipment_owner_criterion.md +++ b/docs/search/criteria_reference/shipment_owner_criterion.md @@ -9,14 +9,17 @@ The `Owner` Criterion searches for shipments based on the user reference. ## Arguments -- `UserReference` object - \Ibexa\Contracts\Core\Repository\Values\User\UserReference(int $userId) +- `UserReference` object - new \Ibexa\Core\Repository\Values\User\UserReference(int $userId) ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Shipping\Shipment\ShipmentQuery; + $query = new ShipmentQuery( new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\Owner( - \Ibexa\Contracts\Core\Repository\Values\User\UserReference(14) + new \Ibexa\Core\Repository\Values\User\UserReference(14) ) ); ``` @@ -24,12 +27,19 @@ $query = new ShipmentQuery( `Owner` Criterion accepts also multiple values: ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Shipping\Shipment\ShipmentQuery; + +/** @var \Ibexa\Contracts\Core\Repository\UserService $userService */ +$user1 = $userService->loadUser(12345); +$user2 = $userService->loadUserByLogin('user'); + $query = new ShipmentQuery( new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\Owner( [ - \Ibexa\Contracts\Core\Repository\Values\User\UserReference(14), - \Ibexa\Contracts\Core\Repository\Values\User\UserReference(123), + $user1, + $user2, ] ) ); -``` \ No newline at end of file +``` diff --git a/docs/search/criteria_reference/shipment_shipping_method_criterion.md b/docs/search/criteria_reference/shipment_shipping_method_criterion.md index 2a503ead43..447b71602b 100644 --- a/docs/search/criteria_reference/shipment_shipping_method_criterion.md +++ b/docs/search/criteria_reference/shipment_shipping_method_criterion.md @@ -16,6 +16,10 @@ The `ShippingMethod` Search Criterion searches for shipments based on a shipping ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Shipping\Shipment\ShipmentQuery; + +/** @var \Ibexa\Contracts\Shipping\Value\ShippingMethod\ShippingMethodInterface $shippingMethod */ $query = new ShipmentQuery( new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\ShippingMethod($shippingMethod) ); diff --git a/docs/search/criteria_reference/shipment_status_criterion.md b/docs/search/criteria_reference/shipment_status_criterion.md index 3e2c0d40bc..05b0ec1a51 100644 --- a/docs/search/criteria_reference/shipment_status_criterion.md +++ b/docs/search/criteria_reference/shipment_status_criterion.md @@ -16,6 +16,9 @@ The `Status` Search Criterion searches for shipments based on shipment status. ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Shipping\Shipment\ShipmentQuery; + $query = new ShipmentQuery( new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\Status('pending') ); diff --git a/docs/search/criteria_reference/shipment_updatedat_criterion.md b/docs/search/criteria_reference/shipment_updatedat_criterion.md index e7e84e13b7..72763c3c48 100644 --- a/docs/search/criteria_reference/shipment_updatedat_criterion.md +++ b/docs/search/criteria_reference/shipment_updatedat_criterion.md @@ -17,6 +17,9 @@ The `UpdatedAt` Search Criterion searches for shipments based on the date when t ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Shipping\Shipment\ShipmentQuery; + $criteria = new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\UpdatedAt( new DateTime('2023-03-01'), 'GTE' diff --git a/docs/search/criteria_reference/sibling_criterion.md b/docs/search/criteria_reference/sibling_criterion.md index 0a3780c3c7..8907c56e15 100644 --- a/docs/search/criteria_reference/sibling_criterion.md +++ b/docs/search/criteria_reference/sibling_criterion.md @@ -16,12 +16,21 @@ The [`Sibling` Search Criterion](/api/php_api/php_api_reference/classes/Ibexa-Co ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\Sibling(59, 2); ``` You can also use the named constructor `Criterion\Sibling::fromLocation` and provide it with the location object: ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); +/** @var \Ibexa\Contracts\Core\Repository\LocationService $locationService */ $location = $locationService->loadLocation(59); $query->query = Criterion\Sibling::fromLocation($location); ``` diff --git a/docs/search/criteria_reference/simplemeasurementattribute_criterion.md b/docs/search/criteria_reference/simplemeasurementattribute_criterion.md index 034a221ed7..cd2f3096ad 100644 --- a/docs/search/criteria_reference/simplemeasurementattribute_criterion.md +++ b/docs/search/criteria_reference/simplemeasurementattribute_criterion.md @@ -16,11 +16,15 @@ The `SimpleMeasurementAttribute` Search Criterion searches for products by the v ### PHP ``` php -$value = $this->measurementService->buildSimpleValue('length', 120, 'centimeter'); +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + +/** @var \Ibexa\Contracts\Measurement\MeasurementServiceInterface $measurementService */ +$value = $measurementService->buildSimpleValue('length', 120, 'centimeter'); $query = new ProductQuery( null, - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\SimpleMeasurementAttribute( + new \Ibexa\Contracts\Measurement\Product\Query\Criterion\SimpleMeasurementAttribute( 'width', $value ) diff --git a/docs/search/criteria_reference/subtree_criterion.md b/docs/search/criteria_reference/subtree_criterion.md index a814f314fa..27ae7ff341 100644 --- a/docs/search/criteria_reference/subtree_criterion.md +++ b/docs/search/criteria_reference/subtree_criterion.md @@ -16,6 +16,10 @@ It returns the content item and all the content items below it in the subtree. ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\Subtree('/1/2/71/72/'); ``` diff --git a/docs/search/criteria_reference/taxonomy_entry_id.md b/docs/search/criteria_reference/taxonomy_entry_id.md index 1cceaeccc2..0bff4de06a 100644 --- a/docs/search/criteria_reference/taxonomy_entry_id.md +++ b/docs/search/criteria_reference/taxonomy_entry_id.md @@ -15,11 +15,19 @@ The [`TaxonomyEntryId` Search Criterion](/api/php_api/php_api_reference/classes/ ### PHP ``` php +use Ibexa\Contracts\Taxonomy\Search\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\TaxonomyEntryId(1); ``` Add an array of ID's to find Content tagged with at least one of the tags (OR). ```php +use Ibexa\Contracts\Taxonomy\Search\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\TaxonomyEntryId([1, 2, 3]); ``` diff --git a/docs/search/criteria_reference/useremail_criterion.md b/docs/search/criteria_reference/useremail_criterion.md index 7cc730e21f..0b16415ffe 100644 --- a/docs/search/criteria_reference/useremail_criterion.md +++ b/docs/search/criteria_reference/useremail_criterion.md @@ -20,10 +20,18 @@ Solr search engine and Elasticsearch support IN and EQ operators only. ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\UserEmail(['johndoe']); ``` ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\UserEmail('nospam*', Criterion\Operator::LIKE); ``` diff --git a/docs/search/criteria_reference/userid_criterion.md b/docs/search/criteria_reference/userid_criterion.md index 0468cffdbc..4dde3ff553 100644 --- a/docs/search/criteria_reference/userid_criterion.md +++ b/docs/search/criteria_reference/userid_criterion.md @@ -15,6 +15,10 @@ The [`UserId` Search Criterion](/api/php_api/php_api_reference/classes/Ibexa-Con ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\UserId([14]); ``` diff --git a/docs/search/criteria_reference/userlogin_criterion.md b/docs/search/criteria_reference/userlogin_criterion.md index a3c6f048b4..98fef8660b 100644 --- a/docs/search/criteria_reference/userlogin_criterion.md +++ b/docs/search/criteria_reference/userlogin_criterion.md @@ -20,10 +20,18 @@ Solr search engine and Elasticsearch support IN and EQ operators only. ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\UserLogin(['johndoe']); ``` ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\UserLogin('adm*', Criterion\Operator::LIKE); ``` diff --git a/docs/search/criteria_reference/usermetadata_criterion.md b/docs/search/criteria_reference/usermetadata_criterion.md index 54a9d0725b..944307742a 100644 --- a/docs/search/criteria_reference/usermetadata_criterion.md +++ b/docs/search/criteria_reference/usermetadata_criterion.md @@ -17,6 +17,10 @@ The [`UserMetadata` Search Criterion](/api/php_api/php_api_reference/classes/Ibe ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\UserMetadata(Criterion\UserMetadata::GROUP, Criterion\Operator::EQ, 12); ``` @@ -58,6 +62,10 @@ You can use the `UserMetadata` Criterion to search for blog posts created by the ``` php hl_lines="7" // ID of your custom Contributor User Group +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + $contributorGroupId = 32; $query = new LocationQuery; diff --git a/docs/search/criteria_reference/visibility_criterion.md b/docs/search/criteria_reference/visibility_criterion.md index 50ba1f4c47..cb0eb92ef7 100644 --- a/docs/search/criteria_reference/visibility_criterion.md +++ b/docs/search/criteria_reference/visibility_criterion.md @@ -21,6 +21,10 @@ Use Location Search to avoid this. ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; + +$query = new Query(); $query->query = new Criterion\Visibility(Criterion\Visibility::HIDDEN); ``` diff --git a/docs/search/search_api.md b/docs/search/search_api.md index e14213a1af..a0c1c5bd64 100644 --- a/docs/search/search_api.md +++ b/docs/search/search_api.md @@ -43,9 +43,18 @@ You can also use [`SearchService::findContent`](/api/php_api/php_api_reference/c To query for a single result, for example by providing a Content ID, use the [`SearchService::findSingle`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SearchService.html#method_findSingle) method: ``` php +use Ibexa\Contracts\Core\Repository\SearchService; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Symfony\Component\Console\Output\OutputInterface; + +$contentId = 12345; $criterion = new Criterion\ContentId($contentId); -$result = $this->searchService->findSingle($criterion); -$output->writeln($result->getName()); + +/** @var SearchService $searchService */ +$result = $searchService->findSingle($criterion); + +/** @var OutputInterface $output */ +$output->writeln($result->getName() ?? ''); ``` !!! tip @@ -58,6 +67,9 @@ $output->writeln($result->getName()); You can change it by setting a different limit to the query: ``` php + use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; + + $query = new LocationQuery(); $query->limit = 100; ``` @@ -94,11 +106,19 @@ This enables iterating over results that are too large to handle due to memory c `BatchIterator` takes one of the available adapters ([`\Ibexa\Contracts\Core\Repository\Iterator\BatchIteratorAdapter`](/api/php_api/php_api_reference/namespaces/ibexa-contracts-core-repository-iterator-batchiteratoradapter.html)) and optional batch size. For example: ``` php +use Ibexa\Contracts\Core\Repository\Iterator\BatchIterator; +use Ibexa\Contracts\Core\Repository\Iterator\BatchIteratorAdapter; +use Ibexa\Contracts\Core\Repository\SearchService; +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Symfony\Component\Console\Output\OutputInterface; + $query = new LocationQuery(); -$iterator = new BatchIterator(new BatchIteratorAdapter\LocationSearchAdapter($this->searchService, $query)); +/** @var SearchService $searchService */ +$iterator = new BatchIterator(new BatchIteratorAdapter\LocationSearchAdapter($searchService, $query)); foreach ($iterator as $result) { + /** @var OutputInterface $output */ $output->writeln($result->valueObject->getContentInfo()->name); } ``` @@ -173,6 +193,11 @@ You can use the following methods of the Filter: The following example filters for Folder content items under the parent location 2, sorts them by publication date and returns 10 results, starting from the third one: ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; +use Ibexa\Contracts\Core\Repository\Values\Filter\Filter; + $filter = new Filter(); $filter ->withCriterion(new Criterion\ContentTypeIdentifier('folder')) @@ -291,6 +316,13 @@ For example, a content item has two locations: visible location A and hidden loc You perform the following query: ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\LocationId; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Visibility; + +$query = new LocationQuery(); +$bLocationId = 12345; $query->filter = new Criterion\LogicalAnd([ new LocationId($bLocationId), new Visibility(Visibility::VISIBLE), @@ -366,12 +398,18 @@ The following example limits the number of terms returned to 5 and only consider To use a range aggregation, you must provide a `ranges` array containing a set of `Range` objects that define the borders of the specific range sets. ``` php -$query->aggregations[] = new IntegerRangeAggregation('range', 'person', 'age', -[ - new Query\Aggregation\Range(1,30), - new Query\Aggregation\Range(30,60), - new Query\Aggregation\Range(60,null), -]); +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Field\IntegerRangeAggregation; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; + +$ranges = [ + Range::ofInt(1, 30), + Range::ofInt(30, 60), + Range::ofInt(60, null), +]; + +$query = new LocationQuery(); +$query->aggregations[] = new IntegerRangeAggregation('range', 'person', 'age', $ranges); ``` !!! note diff --git a/docs/search/search_engines/solr_search_engine/configure_solr.md b/docs/search/search_engines/solr_search_engine/configure_solr.md index e38c5c5db9..74040d9b86 100644 --- a/docs/search/search_engines/solr_search_engine/configure_solr.md +++ b/docs/search/search_engines/solr_search_engine/configure_solr.md @@ -72,7 +72,7 @@ The configuration above results in the following boosting (content type / Field) The second step requires you to use `\Novactive\EzSolrSearchExtra\Query\Content\Criterion\MultipleFieldsFullText` instead of default `\Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\FullText`. The following example shows custom query which benefits from the custom fields created in the previous example. - ```php + ```php skip-validation sortClauses = [new SortClause\ContentId()]; ``` diff --git a/docs/search/sort_clause_reference/contentname_sort_clause.md b/docs/search/sort_clause_reference/contentname_sort_clause.md index 9f1106a4b5..9aa6664be3 100644 --- a/docs/search/sort_clause_reference/contentname_sort_clause.md +++ b/docs/search/sort_clause_reference/contentname_sort_clause.md @@ -13,6 +13,10 @@ The [`ContentName` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-Con ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; + + $query = new LocationQuery(); $query->sortClauses = [new SortClause\ContentName()]; ``` diff --git a/docs/search/sort_clause_reference/contenttranslatedname_sort_clause.md b/docs/search/sort_clause_reference/contenttranslatedname_sort_clause.md index 957cc93109..964205d882 100644 --- a/docs/search/sort_clause_reference/contenttranslatedname_sort_clause.md +++ b/docs/search/sort_clause_reference/contenttranslatedname_sort_clause.md @@ -17,6 +17,10 @@ The `ContentTranslatedName` Sort Clause isn't available in [Repository filtering ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; + + $query = new LocationQuery(); $query->sortClauses = [new SortClause\ContentTranslatedName()]; ``` diff --git a/docs/search/sort_clause_reference/contenttypename_sort_clause.md b/docs/search/sort_clause_reference/contenttypename_sort_clause.md index fc4c516ae2..da0cf84919 100644 --- a/docs/search/sort_clause_reference/contenttypename_sort_clause.md +++ b/docs/search/sort_clause_reference/contenttypename_sort_clause.md @@ -13,6 +13,10 @@ The [`ContentTypeName` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; + + $query = new Query(); $query->sortClauses = [new SortClause\Trash\ContentTypeName()]; ``` diff --git a/docs/search/sort_clause_reference/createdat_sort_clause.md b/docs/search/sort_clause_reference/createdat_sort_clause.md index 2ef171dc82..8e1f8e7b77 100644 --- a/docs/search/sort_clause_reference/createdat_sort_clause.md +++ b/docs/search/sort_clause_reference/createdat_sort_clause.md @@ -13,6 +13,9 @@ The `CreatedAt` Sort Clause sorts search results by the date and time of the cre ## Example ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + + $productQuery = new ProductQuery( null, null, diff --git a/docs/search/sort_clause_reference/customfield_sort_clause.md b/docs/search/sort_clause_reference/customfield_sort_clause.md index 7770198082..7e78824330 100644 --- a/docs/search/sort_clause_reference/customfield_sort_clause.md +++ b/docs/search/sort_clause_reference/customfield_sort_clause.md @@ -23,6 +23,10 @@ The `CustomField` Sort Clause isn't available in [Repository filtering](search_a ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; + + $query = new LocationQuery(); $query->sortClauses = [new SortClause\CustomField('my_custom_field_s')]; ``` diff --git a/docs/search/sort_clause_reference/customprice_sort_clause.md b/docs/search/sort_clause_reference/customprice_sort_clause.md index e042a16adb..68d22f625b 100644 --- a/docs/search/sort_clause_reference/customprice_sort_clause.md +++ b/docs/search/sort_clause_reference/customprice_sort_clause.md @@ -20,6 +20,12 @@ The `CustomPrice` Sort Clause isn't available in the Legacy Search engine. ## Example ``` php +use Ibexa\Contracts\ProductCatalog\Values\CurrencyInterface; +use Ibexa\Contracts\ProductCatalog\Values\CustomerGroupInterface; +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + +/** @var CurrencyInterface $currency */ +/** @var CustomerGroupInterface $customerGroup */ $sortClauses = [ new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\CustomPrice( $currency, diff --git a/docs/search/sort_clause_reference/datemodified_sort_clause.md b/docs/search/sort_clause_reference/datemodified_sort_clause.md index a26a1f3749..a65ee456b2 100644 --- a/docs/search/sort_clause_reference/datemodified_sort_clause.md +++ b/docs/search/sort_clause_reference/datemodified_sort_clause.md @@ -13,6 +13,10 @@ The [`DateModified` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-Co ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; + + $query = new LocationQuery(); $query->sortClauses = [new SortClause\DateModified()]; ``` diff --git a/docs/search/sort_clause_reference/datepublished_sort_clause.md b/docs/search/sort_clause_reference/datepublished_sort_clause.md index 39c6bc4f1c..5061595390 100644 --- a/docs/search/sort_clause_reference/datepublished_sort_clause.md +++ b/docs/search/sort_clause_reference/datepublished_sort_clause.md @@ -13,6 +13,10 @@ The [`DatePublished` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-C ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; + + $query = new LocationQuery(); $query->sortClauses = [new SortClause\DatePublished()]; ``` diff --git a/docs/search/sort_clause_reference/datetrashed_sort_clause.md b/docs/search/sort_clause_reference/datetrashed_sort_clause.md index e82baf72c4..f43d867f6d 100644 --- a/docs/search/sort_clause_reference/datetrashed_sort_clause.md +++ b/docs/search/sort_clause_reference/datetrashed_sort_clause.md @@ -13,6 +13,10 @@ The [`DateTrashed` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-Con ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; + + $query = new Query(); $query->sortClauses = [new SortClause\Trash\DateTrashed()]; ``` diff --git a/docs/search/sort_clause_reference/depth_sort_clause.md b/docs/search/sort_clause_reference/depth_sort_clause.md index 78a0e8f45a..fabdb17a8e 100644 --- a/docs/search/sort_clause_reference/depth_sort_clause.md +++ b/docs/search/sort_clause_reference/depth_sort_clause.md @@ -13,6 +13,9 @@ The [`Location\Depth` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa- ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; + $query = new LocationQuery(); -$query->sortClauses = [new SortClause\Depth()]; +$query->sortClauses = [new SortClause\Location\Depth()]; ``` diff --git a/docs/search/sort_clause_reference/field_sort_clause.md b/docs/search/sort_clause_reference/field_sort_clause.md index 5db7bf10c5..a636bff689 100644 --- a/docs/search/sort_clause_reference/field_sort_clause.md +++ b/docs/search/sort_clause_reference/field_sort_clause.md @@ -21,6 +21,10 @@ The `Field` Sort Clause isn't available in [Repository filtering](search_api.md# ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; + + $query = new LocationQuery(); $query->sortClauses = [new SortClause\Field('article', 'title')]; ``` diff --git a/docs/search/sort_clause_reference/id_sort_clause.md b/docs/search/sort_clause_reference/id_sort_clause.md index 1e869ae5a3..2132a64d37 100644 --- a/docs/search/sort_clause_reference/id_sort_clause.md +++ b/docs/search/sort_clause_reference/id_sort_clause.md @@ -13,6 +13,9 @@ The [`Location\Id` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-Con ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; + $query = new LocationQuery(); $query->sortClauses = [new SortClause\Location\Id()]; ``` diff --git a/docs/search/sort_clause_reference/ismainlocation_sort_clause.md b/docs/search/sort_clause_reference/ismainlocation_sort_clause.md index ef8f5bed55..b1c763e6b8 100644 --- a/docs/search/sort_clause_reference/ismainlocation_sort_clause.md +++ b/docs/search/sort_clause_reference/ismainlocation_sort_clause.md @@ -19,6 +19,9 @@ The `Location\IsMainLocation` Sort Clause isn't available in [Repository filteri ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; + $query = new LocationQuery(); -$query->sortClauses = [new SortClause\Location\InMainLocation()]; +$query->sortClauses = [new SortClause\Location\IsMainLocation()]; ``` diff --git a/docs/search/sort_clause_reference/maplocationdistance_sort_clause.md b/docs/search/sort_clause_reference/maplocationdistance_sort_clause.md index c13e240bb1..8ffa84335a 100644 --- a/docs/search/sort_clause_reference/maplocationdistance_sort_clause.md +++ b/docs/search/sort_clause_reference/maplocationdistance_sort_clause.md @@ -20,6 +20,10 @@ The `MapLocationDistance` Sort Clause isn't available in [Repository filtering]( ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; + + $query = new LocationQuery(); $query->sortClauses = [new SortClause\MapLocationDistance('place', 'location', 49.542889, 20.111349)]; ``` diff --git a/docs/search/sort_clause_reference/order_created_sort_clause.md b/docs/search/sort_clause_reference/order_created_sort_clause.md index c11efc7e38..c3a8f435b9 100644 --- a/docs/search/sort_clause_reference/order_created_sort_clause.md +++ b/docs/search/sort_clause_reference/order_created_sort_clause.md @@ -14,6 +14,10 @@ The `Created` Sort Clause sorts search results by the date and time when the ord ## Example ``` php +use Ibexa\Contracts\OrderManagement\Value\Order\OrderQuery; + +$criteria = null; + $orderQuery = new OrderQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/order_id_sort_clause.md b/docs/search/sort_clause_reference/order_id_sort_clause.md index 2df732073d..a6e23651e1 100644 --- a/docs/search/sort_clause_reference/order_id_sort_clause.md +++ b/docs/search/sort_clause_reference/order_id_sort_clause.md @@ -14,6 +14,10 @@ The `Id` Sort Clause sorts search results by order Id. ## Example ``` php +use Ibexa\Contracts\OrderManagement\Value\Order\OrderQuery; + +$criteria = null; + $orderQuery = new OrderQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/order_status_sort_clause.md b/docs/search/sort_clause_reference/order_status_sort_clause.md index e9711c752e..3187c4deb8 100644 --- a/docs/search/sort_clause_reference/order_status_sort_clause.md +++ b/docs/search/sort_clause_reference/order_status_sort_clause.md @@ -14,6 +14,10 @@ The `Status` Sort Clause sorts search results by order status. ## Example ``` php +use Ibexa\Contracts\OrderManagement\Value\Order\OrderQuery; + +$criteria = null; + $orderQuery = new OrderQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/order_updated_sort_clause.md b/docs/search/sort_clause_reference/order_updated_sort_clause.md index 9a17f8f2b3..f83d526852 100644 --- a/docs/search/sort_clause_reference/order_updated_sort_clause.md +++ b/docs/search/sort_clause_reference/order_updated_sort_clause.md @@ -14,6 +14,10 @@ The `Updated` Sort Clause sorts search results by the date and time when order s ## Example ``` php +use Ibexa\Contracts\OrderManagement\Value\Order\OrderQuery; + +$criteria = null; + $orderQuery = new OrderQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/path_sort_clause.md b/docs/search/sort_clause_reference/path_sort_clause.md index 26937e643f..bd1c1d509e 100644 --- a/docs/search/sort_clause_reference/path_sort_clause.md +++ b/docs/search/sort_clause_reference/path_sort_clause.md @@ -17,6 +17,10 @@ The [`Location\Path` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-C ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; + + $query = new LocationQuery(); $query->sortClauses = [new SortClause\Location\Path()]; ``` diff --git a/docs/search/sort_clause_reference/payment_createdat_sort_clause.md b/docs/search/sort_clause_reference/payment_createdat_sort_clause.md index c8c82ffec6..f1ba6e0f9f 100644 --- a/docs/search/sort_clause_reference/payment_createdat_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_createdat_sort_clause.md @@ -14,6 +14,10 @@ The `CreatedAt` Sort Clause sorts search results by the date and time when the p ## Example ``` php +use Ibexa\Contracts\Payment\Payment\PaymentQuery; + +$criteria = null; + $paymentQuery = new PaymentQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/payment_id_sort_clause.md b/docs/search/sort_clause_reference/payment_id_sort_clause.md index 441cbd2edb..56b3c572c9 100644 --- a/docs/search/sort_clause_reference/payment_id_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_id_sort_clause.md @@ -14,6 +14,10 @@ The `Id` Sort Clause sorts search results by payment ID. ## Example ``` php +use Ibexa\Contracts\Payment\Payment\PaymentQuery; + +$criteria = null; + $paymentQuery = new PaymentQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/payment_identifier_sort_clause.md b/docs/search/sort_clause_reference/payment_identifier_sort_clause.md index c8969c7f5e..37dba9f724 100644 --- a/docs/search/sort_clause_reference/payment_identifier_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_identifier_sort_clause.md @@ -14,6 +14,10 @@ The `Identifier` Sort Clause sorts search results by payment identifier. ## Example ``` php +use Ibexa\Contracts\Payment\Payment\PaymentQuery; + +$criteria = null; + $paymentQuery = new PaymentQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/payment_method_createdat_sort_clause.md b/docs/search/sort_clause_reference/payment_method_createdat_sort_clause.md index f89ad0c7d6..1767f22202 100644 --- a/docs/search/sort_clause_reference/payment_method_createdat_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_method_createdat_sort_clause.md @@ -14,6 +14,10 @@ The `CreatedAt` Sort Clause sorts search results by the date and time when the p ## Example ``` php +use Ibexa\Contracts\Payment\PaymentMethod\PaymentMethodQuery; + +$criteria = null; + $paymentMethodQuery = new PaymentMethodQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/payment_method_enabled_sort_clause.md b/docs/search/sort_clause_reference/payment_method_enabled_sort_clause.md index 5c3a20df97..aee9bbdf92 100644 --- a/docs/search/sort_clause_reference/payment_method_enabled_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_method_enabled_sort_clause.md @@ -14,6 +14,10 @@ The `Enabled` Sort Clause sorts search results by payment method status. ## Example ``` php +use Ibexa\Contracts\Payment\PaymentMethod\PaymentMethodQuery; + +$criteria = null; + $paymentMethodQuery = new PaymentMethodQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/payment_method_id_sort_clause.md b/docs/search/sort_clause_reference/payment_method_id_sort_clause.md index bd7bc8e50a..fe3e7b7a7b 100644 --- a/docs/search/sort_clause_reference/payment_method_id_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_method_id_sort_clause.md @@ -14,6 +14,10 @@ The `Id` Sort Clause sorts search results by payment method ID. ## Example ``` php +use Ibexa\Contracts\Payment\PaymentMethod\PaymentMethodQuery; + +$criteria = null; + $paymentMethodQuery = new PaymentMethodQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/payment_method_identifier_sort_clause.md b/docs/search/sort_clause_reference/payment_method_identifier_sort_clause.md index 02fa6e64d6..998bd403af 100644 --- a/docs/search/sort_clause_reference/payment_method_identifier_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_method_identifier_sort_clause.md @@ -14,6 +14,10 @@ The `Identifier` Sort Clause sorts search results by payment method identifier. ## Example ``` php +use Ibexa\Contracts\Payment\PaymentMethod\PaymentMethodQuery; + +$criteria = null; + $paymentMethodQuery = new PaymentMethodQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/payment_method_updatedat_sort_clause.md b/docs/search/sort_clause_reference/payment_method_updatedat_sort_clause.md index 4c20548949..57f8698de2 100644 --- a/docs/search/sort_clause_reference/payment_method_updatedat_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_method_updatedat_sort_clause.md @@ -14,6 +14,10 @@ The `UpdatedAt` Sort Clause sorts search results by the date and time when payme ## Example ``` php +use Ibexa\Contracts\Payment\PaymentMethod\PaymentMethodQuery; + +$criteria = null; + $paymentMethodQuery = new PaymentMethodQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/payment_status_sort_clause.md b/docs/search/sort_clause_reference/payment_status_sort_clause.md index ea4afc15bf..f8547efaf5 100644 --- a/docs/search/sort_clause_reference/payment_status_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_status_sort_clause.md @@ -14,6 +14,10 @@ The `Status` Sort Clause sorts search results by payment status. ## Example ``` php +use Ibexa\Contracts\Payment\Payment\PaymentQuery; + +$criteria = null; + $paymentQuery = new PaymentQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/payment_updatedat_sort_clause.md b/docs/search/sort_clause_reference/payment_updatedat_sort_clause.md index 82a65ab0a9..542c231222 100644 --- a/docs/search/sort_clause_reference/payment_updatedat_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_updatedat_sort_clause.md @@ -14,6 +14,10 @@ The `UpdatedAt` Sort Clause sorts search results by the date and time when payme ## Example ``` php +use Ibexa\Contracts\Payment\Payment\PaymentQuery; + +$criteria = null; + $paymentQuery = new PaymentQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/priority_sort_clause.md b/docs/search/sort_clause_reference/priority_sort_clause.md index 874bb8f919..4f87576024 100644 --- a/docs/search/sort_clause_reference/priority_sort_clause.md +++ b/docs/search/sort_clause_reference/priority_sort_clause.md @@ -13,6 +13,10 @@ The [`Location\Priority` Sort Clause](/api/php_api/php_api_reference/classes/Ibe ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; + + $query = new LocationQuery(); $query->sortClauses = [new SortClause\Location\Priority()]; ``` diff --git a/docs/search/sort_clause_reference/productavailability_sort_clause.md b/docs/search/sort_clause_reference/productavailability_sort_clause.md index 4129785d5a..037fbf6e6d 100644 --- a/docs/search/sort_clause_reference/productavailability_sort_clause.md +++ b/docs/search/sort_clause_reference/productavailability_sort_clause.md @@ -13,6 +13,9 @@ The `ProductAvailability` Sort Clause sorts search results by whether they have ## Example ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + + $query = new ProductQuery( null, null, diff --git a/docs/search/sort_clause_reference/productcode_sort_clause.md b/docs/search/sort_clause_reference/productcode_sort_clause.md index 4eed6ce992..7fa840812c 100644 --- a/docs/search/sort_clause_reference/productcode_sort_clause.md +++ b/docs/search/sort_clause_reference/productcode_sort_clause.md @@ -13,6 +13,9 @@ The `ProductCode` Sort Clause sorts search results by the product code. ## Example ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + + $query = new ProductQuery( null, null, diff --git a/docs/search/sort_clause_reference/productname_sort_clause.md b/docs/search/sort_clause_reference/productname_sort_clause.md index 4321cff756..99ff71ee2a 100644 --- a/docs/search/sort_clause_reference/productname_sort_clause.md +++ b/docs/search/sort_clause_reference/productname_sort_clause.md @@ -13,6 +13,9 @@ The `ProductName` Sort Clause sorts search results by the Product code. ## Example ``` php +use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; + + $query = new ProductQuery( null, null, diff --git a/docs/search/sort_clause_reference/random_sort_clause.md b/docs/search/sort_clause_reference/random_sort_clause.md index 2c83038981..4e8eaf038d 100644 --- a/docs/search/sort_clause_reference/random_sort_clause.md +++ b/docs/search/sort_clause_reference/random_sort_clause.md @@ -19,6 +19,10 @@ In Elasticsearch engine, you cannot combine the `Random` Sort Clause with any ot ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; + + $query = new LocationQuery(); $query->sortClauses = [new SortClause\Random()]; ``` diff --git a/docs/search/sort_clause_reference/score_sort_clause.md b/docs/search/sort_clause_reference/score_sort_clause.md index 87bb7f49c7..99a24fbbe0 100644 --- a/docs/search/sort_clause_reference/score_sort_clause.md +++ b/docs/search/sort_clause_reference/score_sort_clause.md @@ -17,6 +17,10 @@ The `Score` Sort Clause isn't available in [Repository filtering](search_api.md# ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; + + $query = new LocationQuery(); $query->sortClauses = [new SortClause\Score()]; ``` diff --git a/docs/search/sort_clause_reference/sectionidentifier_sort_clause.md b/docs/search/sort_clause_reference/sectionidentifier_sort_clause.md index 5999554176..9fd1018f5e 100644 --- a/docs/search/sort_clause_reference/sectionidentifier_sort_clause.md +++ b/docs/search/sort_clause_reference/sectionidentifier_sort_clause.md @@ -17,6 +17,10 @@ The [`SectionIdentifier` Sort Clause](/api/php_api/php_api_reference/classes/Ibe ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; + + $query = new LocationQuery(); $query->sortClauses = [new SortClause\SectionIdentifier()]; ``` diff --git a/docs/search/sort_clause_reference/sectionname_sort_clause.md b/docs/search/sort_clause_reference/sectionname_sort_clause.md index 950df555e2..f7e15b3294 100644 --- a/docs/search/sort_clause_reference/sectionname_sort_clause.md +++ b/docs/search/sort_clause_reference/sectionname_sort_clause.md @@ -13,6 +13,10 @@ The [`SectionName` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-Con ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; + + $query = new LocationQuery(); $query->sortClauses = [new SortClause\SectionName()]; ``` diff --git a/docs/search/sort_clause_reference/shipment_createdat_sort_clause.md b/docs/search/sort_clause_reference/shipment_createdat_sort_clause.md index 373aeb5d9e..5124711d19 100644 --- a/docs/search/sort_clause_reference/shipment_createdat_sort_clause.md +++ b/docs/search/sort_clause_reference/shipment_createdat_sort_clause.md @@ -14,6 +14,9 @@ The `CreatedAt` Sort Clause sorts search results by the date and time when the s ## Example ``` php +use Ibexa\Contracts\Shipping\Shipment\ShipmentQuery; + +/** @var \Ibexa\Contracts\Shipping\Shipment\Query\CriterionInterface $criteria */ $shipmentQuery = new ShipmentQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/shipment_id_sort_clause.md b/docs/search/sort_clause_reference/shipment_id_sort_clause.md index fa405de54e..8e826e1609 100644 --- a/docs/search/sort_clause_reference/shipment_id_sort_clause.md +++ b/docs/search/sort_clause_reference/shipment_id_sort_clause.md @@ -14,6 +14,9 @@ The `Id` Sort Clause sorts search results by shipment Id. ## Example ``` php +use Ibexa\Contracts\Shipping\Shipment\ShipmentQuery; + +/** @var \Ibexa\Contracts\Shipping\Shipment\Query\CriterionInterface $criteria */ $shipmentQuery = new ShipmentQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/shipment_identifier_sort_clause.md b/docs/search/sort_clause_reference/shipment_identifier_sort_clause.md index 1bc1a60bf3..a25501de18 100644 --- a/docs/search/sort_clause_reference/shipment_identifier_sort_clause.md +++ b/docs/search/sort_clause_reference/shipment_identifier_sort_clause.md @@ -14,6 +14,9 @@ The `Identifier` Sort Clause sorts search results by shipment identifier. ## Example ``` php +use Ibexa\Contracts\Shipping\Shipment\ShipmentQuery; + +/** @var \Ibexa\Contracts\Shipping\Shipment\Query\CriterionInterface $criteria */ $shipmentQuery = new ShipmentQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/shipment_status_sort_clause.md b/docs/search/sort_clause_reference/shipment_status_sort_clause.md index 5a0cacf07b..1478eef4d1 100644 --- a/docs/search/sort_clause_reference/shipment_status_sort_clause.md +++ b/docs/search/sort_clause_reference/shipment_status_sort_clause.md @@ -14,6 +14,9 @@ The `Status` Sort Clause sorts search results by shipment status. ## Example ``` php +use Ibexa\Contracts\Shipping\Shipment\ShipmentQuery; + +/** @var \Ibexa\Contracts\Shipping\Shipment\Query\CriterionInterface $criteria */ $shipmentQuery = new ShipmentQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/shipment_updatedat_sort_clause.md b/docs/search/sort_clause_reference/shipment_updatedat_sort_clause.md index 0b6260a8ed..4c54a15034 100644 --- a/docs/search/sort_clause_reference/shipment_updatedat_sort_clause.md +++ b/docs/search/sort_clause_reference/shipment_updatedat_sort_clause.md @@ -14,6 +14,9 @@ The `UpdatedAt` Sort Clause sorts search results by the date and time when shipm ## Example ``` php +use Ibexa\Contracts\Shipping\Shipment\ShipmentQuery; + +/** @var \Ibexa\Contracts\Shipping\Shipment\Query\CriterionInterface $criteria */ $shipmentQuery = new ShipmentQuery( $criteria, [ diff --git a/docs/search/sort_clause_reference/userlogin_sort_clause.md b/docs/search/sort_clause_reference/userlogin_sort_clause.md index f234780543..2297368c57 100644 --- a/docs/search/sort_clause_reference/userlogin_sort_clause.md +++ b/docs/search/sort_clause_reference/userlogin_sort_clause.md @@ -13,6 +13,10 @@ The [`UserLogin` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-Contr ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; + + $query = new Query(); $query->sortClauses = [new SortClause\Trash\UserLogin()]; ``` diff --git a/docs/search/sort_clause_reference/visibility_sort_clause.md b/docs/search/sort_clause_reference/visibility_sort_clause.md index 258ee5fb72..210fc9f071 100644 --- a/docs/search/sort_clause_reference/visibility_sort_clause.md +++ b/docs/search/sort_clause_reference/visibility_sort_clause.md @@ -15,6 +15,10 @@ Locations that aren't visible are ranked as higher values (for example, with asc ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; + + $query = new LocationQuery(); $query->sortClauses = [new SortClause\Location\Visibility()]; ``` diff --git a/docs/search/url_search_reference/logicaland_url_criterion.md b/docs/search/url_search_reference/logicaland_url_criterion.md index f7b77a1649..096d0b2b7c 100644 --- a/docs/search/url_search_reference/logicaland_url_criterion.md +++ b/docs/search/url_search_reference/logicaland_url_criterion.md @@ -13,6 +13,10 @@ The [`LogicalAnd` URL Criterion](/api/php_api/php_api_reference/classes/Ibexa-Co ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\URL\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; + +$query = new URLQuery(); $query->filter = new Criterion\LogicalAnd( [ new Criterion\Validity(true), diff --git a/docs/search/url_search_reference/logicalnot_url_criterion.md b/docs/search/url_search_reference/logicalnot_url_criterion.md index 6222fad435..c2c8886f84 100644 --- a/docs/search/url_search_reference/logicalnot_url_criterion.md +++ b/docs/search/url_search_reference/logicalnot_url_criterion.md @@ -15,6 +15,10 @@ It takes only one Criterion in the array parameter. ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\URL\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; + +$query = new URLQuery(); $query->filter = new Criterion\LogicalNot( new Criterion\Pattern('ibexa.co') ); diff --git a/docs/search/url_search_reference/logicalor_url_criterion.md b/docs/search/url_search_reference/logicalor_url_criterion.md index 7e79da7f1f..763f38d145 100644 --- a/docs/search/url_search_reference/logicalor_url_criterion.md +++ b/docs/search/url_search_reference/logicalor_url_criterion.md @@ -13,6 +13,10 @@ The [`LogicalOr` URL Criterion](/api/php_api/php_api_reference/classes/Ibexa-Con ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\URL\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; + +$query = new URLQuery(); $query->filter = new Criterion\LogicalOr( [ new Criterion\SectionIdentifier(['sports', 'news']), diff --git a/docs/search/url_search_reference/pattern_url_criterion.md b/docs/search/url_search_reference/pattern_url_criterion.md index 34ed0afb67..822ebac541 100644 --- a/docs/search/url_search_reference/pattern_url_criterion.md +++ b/docs/search/url_search_reference/pattern_url_criterion.md @@ -13,5 +13,9 @@ The [`Pattern` URL Criterion](/api/php_api/php_api_reference/classes/Ibexa-Contr ## Example ``` php +use Ibexa\Contracts\Core\Repository\Values\URL\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; + +$query = new URLQuery(); $query->filter = new Criterion\Pattern('ibexa.co'); ``` diff --git a/docs/search/url_search_reference/sectionid_url_criterion.md b/docs/search/url_search_reference/sectionid_url_criterion.md index 8c0a67f03b..5de5f9b9ea 100644 --- a/docs/search/url_search_reference/sectionid_url_criterion.md +++ b/docs/search/url_search_reference/sectionid_url_criterion.md @@ -13,5 +13,9 @@ The [`SectionId` URL Criterion](/api/php_api/php_api_reference/classes/Ibexa-Con ## Example ``` php -$query->filter = new Criterion\SectionId(['1', '3']); +use Ibexa\Contracts\Core\Repository\Values\URL\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; + +$query = new URLQuery(); +$query->filter = new Criterion\SectionId([1, 3]); ``` diff --git a/docs/search/url_search_reference/sectionidentifier_url_criterion.md b/docs/search/url_search_reference/sectionidentifier_url_criterion.md index e0069e6287..196ce69568 100644 --- a/docs/search/url_search_reference/sectionidentifier_url_criterion.md +++ b/docs/search/url_search_reference/sectionidentifier_url_criterion.md @@ -13,5 +13,9 @@ The [SectionIdentifier URL Criterion](/api/php_api/php_api_reference/classes/Ibe ## Example ```php +use Ibexa\Contracts\Core\Repository\Values\URL\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; + +$query = new URLQuery(); $query->filter = new Criterion\SectionIdentifier(['standard', 'media']); ``` diff --git a/docs/search/url_search_reference/validity_url_criterion.md b/docs/search/url_search_reference/validity_url_criterion.md index 89b637d604..b36118f0ca 100644 --- a/docs/search/url_search_reference/validity_url_criterion.md +++ b/docs/search/url_search_reference/validity_url_criterion.md @@ -13,5 +13,9 @@ The [Validity URL Criterion](/api/php_api/php_api_reference/classes/Ibexa-Contra ## Example ```php +use Ibexa\Contracts\Core\Repository\Values\URL\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; + +$query = new URLQuery(); $query->filter = new Criterion\Validity(true); ``` diff --git a/docs/snippets/search_term_aggregation_settings.md b/docs/snippets/search_term_aggregation_settings.md index e67da0f71d..873c062308 100644 --- a/docs/snippets/search_term_aggregation_settings.md +++ b/docs/snippets/search_term_aggregation_settings.md @@ -3,7 +3,7 @@ You can define additional limits to the results using the `setLimit()` and `setMinCount()` methods. The following example limits the number of terms returned to 5 and only considers terms that have 10 or more results: -``` php +``` php skip-validation $aggregation = new //... $aggregation->setLimit(5); $aggregation->setMinCount(10); diff --git a/docs/templating/urls_and_routes/custom_breadcrumbs.md b/docs/templating/urls_and_routes/custom_breadcrumbs.md index 3da8df6e42..690d60df47 100644 --- a/docs/templating/urls_and_routes/custom_breadcrumbs.md +++ b/docs/templating/urls_and_routes/custom_breadcrumbs.md @@ -47,7 +47,11 @@ custom_blog_index: To see the correct breadcrumb, you have to check the method in the controller itself: ``` php - if ($request->getMethod() != REQUEST::METHOD_POST) { + use Symfony\Component\HttpFoundation\Request; + use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; + + /** @var \Symfony\Component\HttpFoundation\Request $request */ + if ($request->getMethod() != Request::METHOD_POST) { throw new NotFoundHttpException(); } ``` diff --git a/docs/tutorials/beginner_tutorial/5_display_a_list_of_content_items.md b/docs/tutorials/beginner_tutorial/5_display_a_list_of_content_items.md index 6ddef06e21..6df4be0fdb 100644 --- a/docs/tutorials/beginner_tutorial/5_display_a_list_of_content_items.md +++ b/docs/tutorials/beginner_tutorial/5_display_a_list_of_content_items.md @@ -68,12 +68,13 @@ use Ibexa\Core\QueryType\QueryType; class RideQueryType implements QueryType { - public static function getName() + public static function getName(): string { return 'Ride'; } - public function getQuery(array $parameters = []) + /** @param array $parameters */ + public function getQuery(array $parameters = []): \Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery { return new LocationQuery([ 'filter' => new Criterion\LogicalAnd( @@ -85,8 +86,9 @@ class RideQueryType implements QueryType ]); } - public function getSupportedParameters() + public function getSupportedParameters(): array { + return []; } } ``` diff --git a/docs/tutorials/beginner_tutorial/7_embed_content.md b/docs/tutorials/beginner_tutorial/7_embed_content.md index 6443e95eee..2912636c24 100644 --- a/docs/tutorials/beginner_tutorial/7_embed_content.md +++ b/docs/tutorials/beginner_tutorial/7_embed_content.md @@ -134,14 +134,14 @@ use Ibexa\Contracts\Core\Repository\ContentService; class RideController extends Controller { - private $contentService; + private ContentService $contentService; public function __construct(ContentService $contentService) { $this->contentService = $contentService; } - public function viewRideWithLandmarksAction(ContentView $view) + public function viewRideWithLandmarksAction(ContentView $view): ContentView { $currentContent = $view->getContent(); $landmarksListId = $currentContent->getFieldValue('landmarks'); diff --git a/docs/update_and_migration/from_1.x_2.x/update_db_to_2.5.md b/docs/update_and_migration/from_1.x_2.x/update_db_to_2.5.md index d4009bacf0..6767fbee13 100644 --- a/docs/update_and_migration/from_1.x_2.x/update_db_to_2.5.md +++ b/docs/update_and_migration/from_1.x_2.x/update_db_to_2.5.md @@ -146,7 +146,7 @@ defined in the [Enterprise Beginner tutorial](page_and_form_tutorial.md) `app/Resources/views/layouts/sidebar.html.twig`: - ```php + ```html+twig
{% if zones[0].blocks %} @@ -197,7 +197,7 @@ defined in the [Enterprise Beginner tutorial](page_and_form_tutorial.md) `src/AppBundle/Block/RandomBlock.php`: - ``` php + ``` php skip-validation
{% if zones[0].blocks %} @@ -456,7 +456,7 @@ defined in the [Enterprise Beginner tutorial](page_and_form_tutorial.md) `src/AppBundle/Block/Event/Listener/RandomBlockListener.php` in place of `src/AppBundle/Block/RandomBlock.php`: - ``` php + ``` php skip-validation 'onCreateBookmark', - ] + ]; } public function onCreateBookmark(CreateBookmarkEvent $event): void @@ -27,13 +27,13 @@ public function onCreateBookmark(CreateBookmarkEvent $event): void **instead of:** -``` php +``` php skip-validation public function receive(Signal $signal) { if (!($signal instanceof CreateBookmarkSignal)) { return; } -} -// your code + // your code +} ``` diff --git a/docs/update_and_migration/from_2.5/update_code/8_update_rest.md b/docs/update_and_migration/from_2.5/update_code/8_update_rest.md index a35a5d0e12..0366979d91 100644 --- a/docs/update_and_migration/from_2.5/update_code/8_update_rest.md +++ b/docs/update_and_migration/from_2.5/update_code/8_update_rest.md @@ -21,7 +21,7 @@ you need to switch to Core Installer. **Use:** -``` php +``` yaml services: Acme\App\Installer\MyCustomInstaller: parent: EzSystems\PlatformInstallerBundle\Installer\CoreInstaller @@ -29,7 +29,7 @@ services: **instead of**: -``` php +``` yaml services: Acme\App\Installer\MyCustomInstaller: parent: ezplatform.installer.clean_installer @@ -42,7 +42,7 @@ Custom schema can be installed defining Symfony Event Subscriber subscribing to **Use:** -``` php +``` yaml services: Acme\App\Installer\MyCustomInstaller: parent: EzSystems\PlatformInstallerBundle\Installer\DbBasedInstaller @@ -50,7 +50,7 @@ services: **instead of:** -``` php +``` yaml services: Acme\App\Installer\MyCustomInstaller: parent: ezplatform.installer.db_based_installer diff --git a/docs/update_and_migration/from_4.3/update_from_4.3_new_commerce.md b/docs/update_and_migration/from_4.3/update_from_4.3_new_commerce.md index 0ff9511bb9..35571127d7 100644 --- a/docs/update_and_migration/from_4.3/update_from_4.3_new_commerce.md +++ b/docs/update_and_migration/from_4.3/update_from_4.3_new_commerce.md @@ -150,7 +150,7 @@ You don't have to remove third-party bundles (`FOS\` to `JMS\`) if they're used === "[[= product_name_content =]]" - ``` php + ``` text FOS\CommentBundle\FOSCommentBundle Tedivm\StashBundle\TedivmStashBundle WhiteOctober\BreadcrumbsBundle\WhiteOctoberBreadcrumbsBundle @@ -177,7 +177,7 @@ You don't have to remove third-party bundles (`FOS\` to `JMS\`) if they're used === "[[= product_name_exp =]]" - ``` php + ``` text FOS\CommentBundle\FOSCommentBundle Tedivm\StashBundle\TedivmStashBundle WhiteOctober\BreadcrumbsBundle\WhiteOctoberBreadcrumbsBundle @@ -204,7 +204,7 @@ You don't have to remove third-party bundles (`FOS\` to `JMS\`) if they're used === "[[= product_name_com =]]" - ``` php + ``` text FOS\CommentBundle\FOSCommentBundle Tedivm\StashBundle\TedivmStashBundle WhiteOctober\BreadcrumbsBundle\WhiteOctoberBreadcrumbsBundle diff --git a/docs/update_and_migration/from_4.3/update_from_4.3_old_commerce.md b/docs/update_and_migration/from_4.3/update_from_4.3_old_commerce.md index b3e5d5a6d8..6283d2f6a2 100644 --- a/docs/update_and_migration/from_4.3/update_from_4.3_old_commerce.md +++ b/docs/update_and_migration/from_4.3/update_from_4.3_old_commerce.md @@ -156,7 +156,7 @@ Add the following dependencies in the `require` section in `composer.json`: Next, remove the entries with new packages alongside with routing and configuration in `config/routes/ibexa_cart.yaml`, `config/routes/ibexa_checkout.yaml` and `config/routes/ibexa_storefront.yaml`: -```php +```php skip-validation Ibexa\Bundle\Cart\IbexaCartBundle::class => ['all' => true], Ibexa\Bundle\Checkout\IbexaCheckoutBundle::class => ['all' => true], Ibexa\Bundle\Storefront\IbexaStorefrontBundle::class => ['all' => true], diff --git a/docs/update_and_migration/from_4.6/update_from_4.6.md b/docs/update_and_migration/from_4.6/update_from_4.6.md index 1aadddff0c..a54487ab5a 100644 --- a/docs/update_and_migration/from_4.6/update_from_4.6.md +++ b/docs/update_and_migration/from_4.6/update_from_4.6.md @@ -162,7 +162,10 @@ merge with your custom settings if needed, and commit them to Git. If the new bundle `ibexa/core-search` has not been added by the recipes, enable it by adding the following line in `config/bundles.php`: ```php +return [ + // ... Ibexa\Bundle\CoreSearch\IbexaCoreSearchBundle::class => ['all' => true], +]; ``` ## v4.6.13 diff --git a/docs/update_and_migration/from_4.6/update_to_5.0.md b/docs/update_and_migration/from_4.6/update_to_5.0.md index 0b9c561ce6..b319fdc243 100644 --- a/docs/update_and_migration/from_4.6/update_to_5.0.md +++ b/docs/update_and_migration/from_4.6/update_to_5.0.md @@ -51,6 +51,9 @@ It's recommended to activate one rule set at a time and preview the output by ru Your configuration could look like the following example: ```php +use Rector\Config\RectorConfig; +use Ibexa\Contracts\Rector\Sets\IbexaSetList; + return RectorConfig::configure() ->withPaths( [ @@ -463,9 +466,12 @@ As this update spans across a broad range of versions, multiple rules can be con ```php //… +use Ibexa\Contracts\Rector\Sets\IbexaSetList; +use Rector\Config\RectorConfig; use Rector\Symfony\Set\SymfonySetList; use Rector\Symfony\Set\SensiolabsSetList; -//… +return RectorConfig::configure() + // ... ->withSets( [ IbexaSetList::IBEXA_50->value, diff --git a/docs/update_and_migration/migrate_to_ibexa_dxp/migrating_from_ez_publish_platform.md b/docs/update_and_migration/migrate_to_ibexa_dxp/migrating_from_ez_publish_platform.md index c90101af41..a489352eae 100644 --- a/docs/update_and_migration/migrate_to_ibexa_dxp/migrating_from_ez_publish_platform.md +++ b/docs/update_and_migration/migrate_to_ibexa_dxp/migrating_from_ez_publish_platform.md @@ -582,7 +582,7 @@ To use the script, do the following: **2.** Add `ezflow-migration-toolkit` to `AppKernel.php`. -``` php +``` php skip-validation // AppKernel.php new EzSystems\EzFlowMigrationToolkitBundle\EzSystemsEzFlowMigrationToolkitBundle() ``` @@ -618,7 +618,7 @@ You can see a report summarizing the results of the migration. **6.** Add `MigrationBundle` to `AppKernel.php`. -``` php +``` php skip-validation // AppKernel.php new MigrationBundle\MigrationBundle() ``` diff --git a/docs/users/segment_api.md b/docs/users/segment_api.md index 2a49d8833e..8c4d8b8168 100644 --- a/docs/users/segment_api.md +++ b/docs/users/segment_api.md @@ -65,5 +65,5 @@ To update a segment or a segment group, use `SegmentationService::updateSegment( To delete a segment or a segment group, use `SegmentationService::removeSegment()` or `SegmentationService::removeSegmentGroup()`: ``` php -$this->segmentationService->removeSegmentGroup($group); +[[= include_code('code_samples/api/public_php_api/src/Command/SegmentCommand.php', 67, 67, remove_indent=True) =]] ``` diff --git a/docs/users/user_authentication.md b/docs/users/user_authentication.md index 9ec9e79c5d..ebbc2ec73b 100644 --- a/docs/users/user_authentication.md +++ b/docs/users/user_authentication.md @@ -106,5 +106,5 @@ class InteractiveLoginListener implements EventSubscriberInterface // You may want to create Users here, or even load predefined Users depending on your own rules. $event->setApiUser($this->userService->loadUserByLogin( 'lolautruche' )); } -}  +} ``` diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 0dad648276..6cc2fc3804 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,5 +1,131 @@ parameters: ignoreErrors: + - + message: '#^Offset ''acme'' does not exist on array\{alias\: string, storage\: array\{engine\: string, connection\: string, config\?\: array\\}, search\: array\{engine\: string, connection\: string\}, fields_groups\: array\{default\: string, list\: array\\}, options\: array\\}\.$#' + identifier: offsetAccess.notFound + count: 1 + path: code_samples/_inline_php/administration/configuration/repository_configuration/line_349.php + + - + message: '#^Dead catch \- Ibexa\\Contracts\\Core\\Repository\\Exceptions\\NotFoundException is never thrown in the try block\.$#' + identifier: catch.neverThrown + count: 1 + path: code_samples/_inline_php/api/php_api/php_api/line_154.php + + - + message: '#^Dead catch \- Ibexa\\Contracts\\Core\\Repository\\Exceptions\\UnauthorizedException is never thrown in the try block\.$#' + identifier: catch.neverThrown + count: 1 + path: code_samples/_inline_php/api/php_api/php_api/line_154.php + + - + message: '#^Instantiated class MyValue not found\.$#' + identifier: class.notFound + count: 1 + path: code_samples/_inline_php/api/rest_api/extending_rest_api/creating_new_rest_resource/line_72.php + + - + message: '#^Variable \$args might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: code_samples/_inline_php/api/rest_api/extending_rest_api/creating_new_rest_resource/line_72.php + + - + message: '#^Call to an undefined method Symfony\\Component\\Notifier\\Recipient\\RecipientInterface\:\:getUser\(\)\.$#' + identifier: method.notFound + count: 1 + path: code_samples/_inline_php/commerce/transactional_emails/extend_transactional_emails/line_83.php + + - + message: '#^Property Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Content\:\:\$fields is not writable\.$#' + identifier: assign.propertyReadOnly + count: 1 + path: code_samples/_inline_php/content_management/field_types/field_type_reference/countryfield/line_53.php + + - + message: '#^Expression "\[''isISBN13'' \=\> \\true\]" on a separate line does not do anything\.$#' + identifier: expr.resultUnused + count: 1 + path: code_samples/_inline_php/content_management/field_types/field_type_reference/isbnfield/line_36.php + + - + message: '#^Expression "\[''StringLengthValidator'' \=\> \[''maxStringLength'' \=\> 60, ''minStringLength'' \=\> 1\]\]" on a separate line does not do anything\.$#' + identifier: expr.resultUnused + count: 1 + path: code_samples/_inline_php/content_management/field_types/field_type_reference/textlinefield/line_39.php + + - + message: '#^Expression "\[''stringLength'' \=\> \[''minStringLength'' \=\> \[''type'' \=\> ''int'', ''default'' \=\> 0\], ''maxStringLength'' \=\> \[''type'' \=\> ''int'', ''default'' \=\> \\null\]\]\]" on a separate line does not do anything\.$#' + identifier: expr.resultUnused + count: 1 + path: code_samples/_inline_php/content_management/field_types/field_type_validation/line_21.php + + - + message: '#^Expression "\[''backupData'' \=\> \[''type'' \=\> ''bool'', ''default'' \=\> \\false\], ''defaultValue'' \=\> \[''type'' \=\> ''string'', ''default'' \=\> ''Default Value''\]\]" on a separate line does not do anything\.$#' + identifier: expr.resultUnused + count: 1 + path: code_samples/_inline_php/content_management/field_types/type_and_value/line_172.php + + - + message: '#^Call to an undefined method object\:\:loadObject\(\)\.$#' + identifier: method.notFound + count: 1 + path: code_samples/_inline_php/infrastructure_and_maintenance/cache/persistence_cache/line_267.php + + - + message: '#^Property App\\MyService\:\:\$contentService is never read, only written\.$#' + identifier: property.onlyWritten + count: 1 + path: code_samples/_inline_php/multisite/siteaccess/injecting_siteaccess/line_20.php + + - + message: '#^Property App\\MyService\:\:\$siteAccessService is never read, only written\.$#' + identifier: property.onlyWritten + count: 1 + path: code_samples/_inline_php/multisite/siteaccess/injecting_siteaccess/line_20.php + + - + message: '#^Method App\\QueryType\\RideQueryType\:\:getSupportedParameters\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: code_samples/_inline_php/tutorials/beginner_tutorial/5_display_a_list_of_content_items/line_61.php + + - + message: '#^Cannot access property \$destinationContentIds on Ibexa\\Contracts\\Core\\FieldType\\Value\|null\.$#' + identifier: property.nonObject + count: 1 + path: code_samples/_inline_php/tutorials/beginner_tutorial/7_embed_content/line_127.php + + - + message: '#^Access to constant ANNOTATIONS_TO_ATTRIBUTES on an unknown class Rector\\Symfony\\Set\\SensiolabsSetList\.$#' + identifier: class.notFound + count: 1 + path: code_samples/_inline_php/update_and_migration/from_4.6/update_to_5.0/line_468.php + + - + message: '#^Access to undefined constant Ibexa\\Core\\MVC\\Symfony\\MVCEvents\:\:INTERACTIVE_LOGIN\.$#' + identifier: classConstant.notFound + count: 1 + path: code_samples/_inline_php/users/user_authentication/line_75.php + + - + message: '#^Call to method setApiUser\(\) on an unknown class eIbexa\\Core\\MVC\\Symfony\\Event\\InteractiveLoginEvent\.$#' + identifier: class.notFound + count: 1 + path: code_samples/_inline_php/users/user_authentication/line_75.php + + - + message: '#^Method App\\EventListener\\InteractiveLoginListener\:\:onInteractiveLogin\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: code_samples/_inline_php/users/user_authentication/line_75.php + + - + message: '#^Parameter \$event of method App\\EventListener\\InteractiveLoginListener\:\:onInteractiveLogin\(\) has invalid type eIbexa\\Core\\MVC\\Symfony\\Event\\InteractiveLoginEvent\.$#' + identifier: class.notFound + count: 1 + path: code_samples/_inline_php/users/user_authentication/line_75.php + - message: '#^Class App\\Form\\Type\\TextToTextOptionsType extends generic class Symfony\\Component\\Form\\AbstractType but does not specify its types\: TData$#' identifier: missingType.generics From 16b249003962e24f849df27eca3ff52e4de54246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Sun, 17 May 2026 14:17:02 +0200 Subject: [PATCH 04/18] Run PHP-CS-Fixer --- .../extending_thumbnails.md | 2 +- .../back_office/browser/browser.md | 14 ++++---- .../back_office/customize_calendar.md | 7 ++-- .../configuration/configuration.md | 2 +- docs/api/php_api/php_api.md | 2 +- .../creating_new_rest_resource.md | 2 +- .../shopping_list/install_shopping_list.md | 2 +- .../extend_transactional_emails.md | 9 ++---- .../content_api/browsing_content.md | 3 +- .../field_type_reference/authorfield.md | 6 ++-- .../field_type_reference/checkboxfield.md | 2 +- .../field_type_reference/countryfield.md | 28 ++++++++-------- .../field_type_reference/dateandtimefield.md | 10 +++--- .../field_type_reference/datefield.md | 6 ++-- .../field_type_reference/emailaddressfield.md | 4 +-- .../field_type_reference/floatfield.md | 12 +++---- .../field_type_reference/imageassetfield.md | 4 +-- .../field_type_reference/imagefield.md | 18 ++++++----- .../field_type_reference/integerfield.md | 6 ++-- .../field_type_reference/keywordfield.md | 6 ++-- .../field_type_reference/maplocationfield.md | 2 +- .../field_type_reference/measurementfield.md | 6 ++-- .../field_type_reference/mediafield.md | 12 +++---- .../field_type_reference/relationfield.md | 8 ++--- .../field_type_reference/relationlistfield.md | 16 +++++----- .../field_type_reference/richtextfield.md | 4 +-- .../field_type_reference/selectionfield.md | 10 +++--- .../taxonomyentryfield.md | 2 +- .../field_type_reference/textlinefield.md | 4 +-- .../field_type_reference/timefield.md | 2 +- .../field_type_reference/urlfield.md | 10 +++--- .../field_types/field_type_search.md | 2 +- .../field_types/field_type_validation.md | 6 ++-- .../field_types/form_and_template.md | 9 +++--- .../field_types/type_and_value.md | 6 ++-- .../url_management/url_management.md | 2 +- .../workflow/add_custom_workflow_action.md | 2 +- .../languages/back_office_translations.md | 3 +- .../siteaccess/injecting_siteaccess.md | 4 ++- docs/permissions/custom_policies.md | 32 +++++++++++-------- .../datemetadatarange_aggregation.md | 7 ++-- .../daterange_aggregation.md | 10 ++++-- .../datetimerange_aggregation.md | 10 ++++-- .../floatrange_aggregation.md | 10 ++++-- .../integerrange_aggregation.md | 10 ++++-- .../timerange_aggregation.md | 10 ++++-- .../criteria_reference/ancestor_criterion.md | 5 ++- .../criteria_reference/baseprice_criterion.md | 2 +- .../checkboxattribute_criterion.md | 2 +- .../colorattribute_criterion.md | 2 +- .../criteria_reference/contentid_criterion.md | 2 +- .../contentname_criterion.md | 2 +- .../contenttypeid_criterion.md | 2 +- .../contenttypeidentifier_criterion.md | 2 +- .../criteria_reference/createdat_criterion.md | 2 +- .../createdatrange_criterion.md | 2 +- .../customergroupid_criterion.md | 2 +- .../customprice_criterion.md | 5 +-- .../datemetadata_criterion.md | 12 +++---- .../criteria_reference/depth_criterion.md | 2 +- .../criteria_reference/field_criterion.md | 10 +++--- .../fieldrelation_criterion.md | 2 +- .../floatattribute_criterion.md | 2 +- .../criteria_reference/fulltext_criterion.md | 8 ++--- .../criteria_reference/image_criterion.md | 2 +- .../imagedimensions_criterion.md | 2 +- .../imagefilesize_criterion.md | 2 +- .../imageheight_criterion.md | 2 +- .../imagemimetype_criterion.md | 4 +-- .../imagewidth_criterion.md | 2 +- .../integerattribute_criterion.md | 2 +- .../iscontainer_criterion.md | 2 +- .../isfieldempty_criterion.md | 10 +++--- .../ismainlocation_criterion.md | 2 +- .../isproductbased_criterion.md | 2 +- .../isuserbased_criterion.md | 2 +- .../isuserenabled_criterion.md | 2 +- .../criteria_reference/isvirtual_criterion.md | 2 +- .../languagecode_criterion.md | 14 ++++---- .../locationid_criterion.md | 2 +- .../locationremoteid_criterion.md | 2 +- .../logicaland_criterion.md | 3 +- .../logicalnot_criterion.md | 2 +- .../criteria_reference/logicalor_criterion.md | 5 +-- .../maplocationdistance_criterion.md | 2 +- .../objectstateid_criterion.md | 2 +- .../objectstateidentifier_criterion.md | 4 +-- .../order_created_criterion.md | 2 +- .../parentlocationid_criterion.md | 5 ++- .../payment_createdat_criterion.md | 2 +- .../payment_method_createdat_criterion.md | 2 +- .../criteria_reference/priority_criterion.md | 2 +- .../productavailability_criterion.md | 2 +- .../productcategory_criterion.md | 2 +- .../productcode_criterion.md | 2 +- .../productname_criterion.md | 2 +- .../productstock_criterion.md | 4 +-- .../productstockrange_criterion.md | 2 +- .../producttype_criterion.md | 2 +- ...gemeasurementattributemaximum_criterion.md | 2 +- ...gemeasurementattributeminimum_criterion.md | 2 +- .../criteria_reference/remoteid_criterion.md | 2 +- .../criteria_reference/sectionid_criterion.md | 2 +- .../sectionidentifier_criterion.md | 2 +- .../selectionattribute_criterion.md | 2 +- .../criteria_reference/sibling_criterion.md | 4 +-- .../simplemeasurementattribute_criterion.md | 2 +- .../criteria_reference/subtree_criterion.md | 2 +- .../criteria_reference/taxonomy_entry_id.md | 4 +-- .../criteria_reference/useremail_criterion.md | 4 +-- .../criteria_reference/userid_criterion.md | 2 +- .../criteria_reference/userlogin_criterion.md | 4 +-- .../usermetadata_criterion.md | 14 ++++---- .../visibility_criterion.md | 2 +- .../baseprice_sort_clause.md | 2 +- .../contentid_sort_clause.md | 1 - .../contentname_sort_clause.md | 1 - .../contenttranslatedname_sort_clause.md | 1 - .../contenttypename_sort_clause.md | 1 - .../createdat_sort_clause.md | 4 +-- .../customfield_sort_clause.md | 1 - .../customprice_sort_clause.md | 5 +-- .../datemodified_sort_clause.md | 1 - .../datepublished_sort_clause.md | 1 - .../datetrashed_sort_clause.md | 1 - .../field_sort_clause.md | 1 - .../maplocationdistance_sort_clause.md | 1 - .../order_created_sort_clause.md | 3 +- .../order_id_sort_clause.md | 3 +- .../order_status_sort_clause.md | 3 +- .../order_updated_sort_clause.md | 3 +- .../sort_clause_reference/path_sort_clause.md | 1 - .../payment_createdat_sort_clause.md | 3 +- .../payment_id_sort_clause.md | 3 +- .../payment_identifier_sort_clause.md | 3 +- .../payment_method_createdat_sort_clause.md | 3 +- .../payment_method_enabled_sort_clause.md | 3 +- .../payment_method_id_sort_clause.md | 3 +- .../payment_method_identifier_sort_clause.md | 3 +- .../payment_method_updatedat_sort_clause.md | 3 +- .../payment_status_sort_clause.md | 3 +- .../payment_updatedat_sort_clause.md | 3 +- .../priority_sort_clause.md | 1 - .../productavailability_sort_clause.md | 3 +- .../productcode_sort_clause.md | 3 +- .../productname_sort_clause.md | 3 +- .../random_sort_clause.md | 1 - .../score_sort_clause.md | 1 - .../sectionidentifier_sort_clause.md | 1 - .../sectionname_sort_clause.md | 1 - .../shipment_createdat_sort_clause.md | 3 +- .../shipment_id_sort_clause.md | 3 +- .../shipment_identifier_sort_clause.md | 3 +- .../shipment_status_sort_clause.md | 3 +- .../shipment_updatedat_sort_clause.md | 3 +- .../userlogin_sort_clause.md | 1 - .../visibility_sort_clause.md | 1 - .../id_url_sort_clause.md | 2 +- .../logicaland_url_criterion.md | 2 +- .../logicalnot_url_criterion.md | 2 +- .../logicalor_url_criterion.md | 2 +- .../url_url_sort_clause.md | 2 +- docs/templating/layout/add_login_form.md | 4 +-- .../5_display_a_list_of_content_items.md | 2 +- .../beginner_tutorial/7_embed_content.md | 2 +- .../from_4.6/update_to_5.0.md | 13 ++++---- docs/users/user_authentication.md | 6 ++-- 167 files changed, 362 insertions(+), 333 deletions(-) diff --git a/docs/administration/back_office/back_office_elements/extending_thumbnails.md b/docs/administration/back_office/back_office_elements/extending_thumbnails.md index 48ace7411f..89e839e25d 100644 --- a/docs/administration/back_office/back_office_elements/extending_thumbnails.md +++ b/docs/administration/back_office/back_office_elements/extending_thumbnails.md @@ -82,9 +82,9 @@ declare(strict_types=1); namespace App\Thumbnails; +use Ibexa\Contracts\Core\Repository\Strategy\ContentThumbnail\Field\FieldTypeBasedThumbnailStrategy; use Ibexa\Contracts\Core\Repository\Values\Content\Field; use Ibexa\Contracts\Core\Repository\Values\Content\Thumbnail; -use Ibexa\Contracts\Core\Repository\Strategy\ContentThumbnail\Field\FieldTypeBasedThumbnailStrategy; use Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo; class FieldValueUrl implements FieldTypeBasedThumbnailStrategy diff --git a/docs/administration/back_office/browser/browser.md b/docs/administration/back_office/browser/browser.md index 6d3f8cd1a8..18fdcdb611 100644 --- a/docs/administration/back_office/browser/browser.md +++ b/docs/administration/back_office/browser/browser.md @@ -171,17 +171,17 @@ class JohnDoeCanSelectMore implements EventSubscriberInterface public function onUdwConfigResolve(ConfigResolveEvent $event): void { if ($event->getConfigName() !== self::CONFIGURATION_NAME) { - return; - } + return; + } $config = $event->getConfig(); - $context = $event->getContext(); + $context = $event->getContext(); if (isset($context['some_contextual_parameter'])) { - if ($context['some_contextual_parameter'] === 'johndoe') { - $config['multiple'] = true; - } - } + if ($context['some_contextual_parameter'] === 'johndoe') { + $config['multiple'] = true; + } + } $event->setConfig($config); } diff --git a/docs/administration/back_office/customize_calendar.md b/docs/administration/back_office/customize_calendar.md index 5c8d8f75d3..877917bf6e 100644 --- a/docs/administration/back_office/customize_calendar.md +++ b/docs/administration/back_office/customize_calendar.md @@ -81,14 +81,13 @@ To add an in-memory collection as an event source, create `src/Calendar/Holidays For example: ``` php - use Ibexa\Contracts\Calendar\EventCollection; - use Ibexa\Contracts\Calendar\EventInterface; use App\Calendar\Holidays\Event; + use Ibexa\Contracts\Calendar\EventCollection; /** @var \App\Calendar\Holidays\EventType $eventType */ $collection = new EventCollection([ - new Event("Event 1", new DateTime("2024-01-01"), $eventType), - new Event("Event 2", new DateTime("2024-01-02"), $eventType), + new Event('Event 1', new DateTime('2024-01-01'), $eventType), + new Event('Event 2', new DateTime('2024-01-02'), $eventType), // ... ]); ``` diff --git a/docs/administration/configuration/configuration.md b/docs/administration/configuration/configuration.md index 871f4c5f19..bb0a9b7887 100644 --- a/docs/administration/configuration/configuration.md +++ b/docs/administration/configuration/configuration.md @@ -75,7 +75,7 @@ parameters: ``` php // Usage inside a controller /** @var \Symfony\Component\DependencyInjection\ContainerInterface $container */ -$myParameter = $container->getParameter( 'myapp.parameter.name' ); +$myParameter = $container->getParameter('myapp.parameter.name'); ``` ## Configuration settings diff --git a/docs/api/php_api/php_api.md b/docs/api/php_api/php_api.md index 8f66fb3090..cf9c759b20 100644 --- a/docs/api/php_api/php_api.md +++ b/docs/api/php_api/php_api.md @@ -116,7 +116,7 @@ use Ibexa\Contracts\Core\Repository\Values\Content\Location; /** @var Repository $repository */ /** @var Location $location */ -$hiddenLocation = $repository->sudo(function (Repository $repository) use ($location): Location { +$hiddenLocation = $repository->sudo(static function (Repository $repository) use ($location): Location { return $repository->getLocationService()->hideLocation($location); }); ``` diff --git a/docs/api/rest_api/extending_rest_api/creating_new_rest_resource.md b/docs/api/rest_api/extending_rest_api/creating_new_rest_resource.md index 603de807a3..d106190f94 100644 --- a/docs/api/rest_api/extending_rest_api/creating_new_rest_resource.md +++ b/docs/api/rest_api/extending_rest_api/creating_new_rest_resource.md @@ -75,7 +75,7 @@ $locationId = 12345; return new CachedValue( new MyValue($args), - ['locationId'=> $locationId] + ['locationId' => $locationId] ); ``` diff --git a/docs/commerce/shopping_list/install_shopping_list.md b/docs/commerce/shopping_list/install_shopping_list.md index 7b59a7d8c4..1d79dd515a 100644 --- a/docs/commerce/shopping_list/install_shopping_list.md +++ b/docs/commerce/shopping_list/install_shopping_list.md @@ -21,7 +21,7 @@ Check that the following line has been added by the recipe to `config/bundles.ph return [ // ... Ibexa\Bundle\ShoppingList\IbexaShoppingListBundle::class => ['all' => true], -]; +]; ``` And that you have a `config/routes/ibexa_shopping_list.yaml` file configuring the following routes: diff --git a/docs/commerce/transactional_emails/extend_transactional_emails.md b/docs/commerce/transactional_emails/extend_transactional_emails.md index 8157931ee4..6db322b5e0 100644 --- a/docs/commerce/transactional_emails/extend_transactional_emails.md +++ b/docs/commerce/transactional_emails/extend_transactional_emails.md @@ -37,9 +37,6 @@ namespace App\EventSubscriber; use Ibexa\Contracts\ConnectorActito\Client\TransactionalMail\SimpleParameter; use Ibexa\Contracts\ConnectorActito\Event\TransactionalMailRequest\ParametersFactoryEvent; -use Ibexa\Contracts\OrderManagement\Notification\OrderAwareNotificationInterface; -use Ibexa\Contracts\Payment\Notification\PaymentAwareNotificationInterface; -use Ibexa\Contracts\Payment\PaymentMethodServiceInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; final class TransactionalMailFactoryEventSubscriber implements EventSubscriberInterface @@ -102,9 +99,9 @@ final class TransactionalMailFactoryEventSubscriber implements EventSubscriberIn { $recipient = $event->getRecipient(); $profile = $event->getProfile(); - $user = $recipient->getUser(); - - // Provide additional data if your profile has more attributes: + $user = $recipient->getUser(); + + // Provide additional data if your profile has more attributes: $attributes = $profile->getAttributes(); $attributes[] = new Attribute('name', $user->getName()); $profile->setAttributes($attributes); diff --git a/docs/content_management/content_api/browsing_content.md b/docs/content_management/content_api/browsing_content.md index c93f02c8c0..2a17ace87b 100644 --- a/docs/content_management/content_api/browsing_content.md +++ b/docs/content_management/content_api/browsing_content.md @@ -215,9 +215,8 @@ Next, use the `getParentLocation` method of the location object to access the pa $mainLocation = $contentInfo->getMainLocation(); $parentLocation = $mainLocation?->getParentLocation(); if ($parentLocation !== null) { - $message = "Parent Location: " . $parentLocation->pathString; + $message = 'Parent Location: ' . $parentLocation->pathString; } - ``` ## Getting content from a location diff --git a/docs/content_management/field_types/field_type_reference/authorfield.md b/docs/content_management/field_types/field_type_reference/authorfield.md index 9446817f4f..edcec8fb81 100644 --- a/docs/content_management/field_types/field_type_reference/authorfield.md +++ b/docs/content_management/field_types/field_type_reference/authorfield.md @@ -25,12 +25,12 @@ $authorList = new Author\Value([ new Author\Author([ 'id' => 1, 'name' => 'Boba Fett', - 'email' => 'boba.fett@example.com' + 'email' => 'boba.fett@example.com', ]), new Author\Author([ 'id' => 2, 'name' => 'Darth Vader', - 'email' => 'darth.vader@example.com' + 'email' => 'darth.vader@example.com', ]), ]); ``` @@ -87,6 +87,6 @@ Following `defaultAuthor` default value options are available as constants in use Ibexa\Core\FieldType\Author\Type; $settings = [ - "defaultAuthor" => Type::DEFAULT_VALUE_EMPTY, + 'defaultAuthor' => Type::DEFAULT_VALUE_EMPTY, ]; ``` diff --git a/docs/content_management/field_types/field_type_reference/checkboxfield.md b/docs/content_management/field_types/field_type_reference/checkboxfield.md index de54b2bdb4..c49740cc34 100644 --- a/docs/content_management/field_types/field_type_reference/checkboxfield.md +++ b/docs/content_management/field_types/field_type_reference/checkboxfield.md @@ -41,7 +41,7 @@ The `Checkbox\Value` constructor accepts a boolean value: use Ibexa\Core\FieldType\Checkbox\Value; // Instantiates a checkbox value with a checked state -$checkboxValue = new Value( true ); +$checkboxValue = new Value(true); ``` ##### String representation diff --git a/docs/content_management/field_types/field_type_reference/countryfield.md b/docs/content_management/field_types/field_type_reference/countryfield.md index 3d5502ecf9..ec13082512 100644 --- a/docs/content_management/field_types/field_type_reference/countryfield.md +++ b/docs/content_management/field_types/field_type_reference/countryfield.md @@ -40,7 +40,7 @@ The field definition of this field type can be configured with one option: ``` php // Country FieldType example settings $settings = [ - "isMultiple" => true + 'isMultiple' => true, ]; ``` @@ -52,7 +52,7 @@ It's also available when setting value on the content field, by setting the valu ``` php // Value object content example /** @var \Ibexa\Contracts\Core\Repository\Values\Content\Content $content */ -$content->fields["countries"] = [ "JP", "NO" ]; +$content->fields['countries'] = ['JP', 'NO']; ``` The format used by the toHash method is the Alpha2 value, however the input is capable of accepting either Name, Alpha2, or Alpha3 value as shown below in the value object section. @@ -71,12 +71,12 @@ The Value class of this field type contains the following properties: // Value object content example /** @var \Ibexa\Core\FieldType\Country\Value $value */ $value->countries = [ - "JP" => [ - "Name" => "Japan", - "Alpha2" => "JP", - "Alpha3" => "JPN", - "IDC" => 81 - ] + 'JP' => [ + 'Name' => 'Japan', + 'Alpha2' => 'JP', + 'Alpha3' => 'JPN', + 'IDC' => 81, + ], ]; ``` @@ -92,12 +92,12 @@ use Ibexa\Core\FieldType\Country as Country; // Instantiates a Country Value object $countryValue = new Country\Value( [ - "JP" => [ - "Name" => "Japan", - "Alpha2" => "JP", - "Alpha3" => "JPN", - "IDC" => 81 - ] + 'JP' => [ + 'Name' => 'Japan', + 'Alpha2' => 'JP', + 'Alpha3' => 'JPN', + 'IDC' => 81, + ], ] ); ``` diff --git a/docs/content_management/field_types/field_type_reference/dateandtimefield.md b/docs/content_management/field_types/field_type_reference/dateandtimefield.md index 94cec9a836..d6e38aa794 100644 --- a/docs/content_management/field_types/field_type_reference/dateandtimefield.md +++ b/docs/content_management/field_types/field_type_reference/dateandtimefield.md @@ -61,8 +61,8 @@ Hash value of this field type is an array with two keys: ``` php $hash = [ - "timestamp" => 1400856992, - "rfc850" => "Friday, 23-May-14 14:56:14 GMT+0000" + 'timestamp' => 1400856992, + 'rfc850' => 'Friday, 23-May-14 14:56:14 GMT+0000', ]; ``` @@ -94,9 +94,9 @@ Following `defaultType` default value options are available as constants in the use Ibexa\Core\FieldType\DateAndTime\Type; $settings = [ - "useSeconds" => false, - "defaultType" => Type::DEFAULT_EMPTY, - "dateInterval" => null + 'useSeconds' => false, + 'defaultType' => Type::DEFAULT_EMPTY, + 'dateInterval' => null, ]; ``` diff --git a/docs/content_management/field_types/field_type_reference/datefield.md b/docs/content_management/field_types/field_type_reference/datefield.md index 415f9153c4..8fc3a0d154 100644 --- a/docs/content_management/field_types/field_type_reference/datefield.md +++ b/docs/content_management/field_types/field_type_reference/datefield.md @@ -64,8 +64,8 @@ Hash value of this field type is an array with two keys: ``` php // Example of the hash value in PHP $hash = [ - "timestamp" => 1400856992, - "rfc850" => "Friday, 23-May-14 14:56:14 GMT+0000" + 'timestamp' => 1400856992, + 'rfc850' => 'Friday, 23-May-14 14:56:14 GMT+0000', ]; ``` @@ -94,7 +94,7 @@ Following `defaultType` default value options are available as constants in the use Ibexa\Core\FieldType\Date\Type; $settings = [ - "defaultType" => Type::DEFAULT_EMPTY + 'defaultType' => Type::DEFAULT_EMPTY, ]; ``` diff --git a/docs/content_management/field_types/field_type_reference/emailaddressfield.md b/docs/content_management/field_types/field_type_reference/emailaddressfield.md index ee1c1b6b92..1dec6b6bc6 100644 --- a/docs/content_management/field_types/field_type_reference/emailaddressfield.md +++ b/docs/content_management/field_types/field_type_reference/emailaddressfield.md @@ -27,7 +27,7 @@ use Ibexa\Core\FieldType\EmailAddress\Value; $emailaddressValue = new Value(); // Email definition -$emailaddressValue->email = "someuser@example.com"; +$emailaddressValue->email = 'someuser@example.com'; ``` ##### Constructor @@ -41,7 +41,7 @@ It accepts a string as input. use Ibexa\Core\FieldType\EmailAddress\Value; // Instantiates an EmailAddress Value object -$emailaddressValue = new Value( "someuser@example.com" ); +$emailaddressValue = new Value('someuser@example.com'); ``` ##### String representation diff --git a/docs/content_management/field_types/field_type_reference/floatfield.md b/docs/content_management/field_types/field_type_reference/floatfield.md index b0e6a72122..c71ec337fc 100644 --- a/docs/content_management/field_types/field_type_reference/floatfield.md +++ b/docs/content_management/field_types/field_type_reference/floatfield.md @@ -49,7 +49,7 @@ It expects a numeric value with or without decimals. use Ibexa\Core\FieldType\Float\Value as FloatValue; // Instantiates a Float Value object -$floatValue = new FloatValue( 284.773 ); +$floatValue = new FloatValue(284.773); ``` ### Validation @@ -66,14 +66,14 @@ This field type supports `FloatValueValidator`, defining maximum and minimum flo /** @var \Ibexa\Contracts\Core\Repository\Repository $repository */ $contentTypeService = $repository->getContentTypeService(); -$floatFieldCreateStruct = $contentTypeService->newFieldDefinitionCreateStruct( "float", "ibexa_float" ); +$floatFieldCreateStruct = $contentTypeService->newFieldDefinitionCreateStruct('float', 'ibexa_float'); // Accept only numbers between 0.1 and 203.99 $floatFieldCreateStruct->validatorConfiguration = [ - "FileSizeValidator" => [ - "minFloatValue" => 0.1, - "maxFloatValue" => 203.99 - ] + 'FileSizeValidator' => [ + 'minFloatValue' => 0.1, + 'maxFloatValue' => 203.99, + ], ]; ``` diff --git a/docs/content_management/field_types/field_type_reference/imageassetfield.md b/docs/content_management/field_types/field_type_reference/imageassetfield.md index 4bac72c2a2..92450852c7 100644 --- a/docs/content_management/field_types/field_type_reference/imageassetfield.md +++ b/docs/content_management/field_types/field_type_reference/imageassetfield.md @@ -35,7 +35,7 @@ Value object of `ibexa_image_asset` contains the following properties: /** @var \Ibexa\Core\FieldType\ImageAsset\Value $imageAssetValue */ /** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo */ $imageAssetValue->destinationContentId = $contentInfo->id; -$imageAssetValue->alternativeText = "Picture of an apple."; +$imageAssetValue->alternativeText = 'Picture of an apple.'; ``` ##### Constructor @@ -50,7 +50,7 @@ use Ibexa\Core\FieldType\ImageAsset as ImageAsset; /** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo */ // Instantiates a ImageAsset Value object -$imageAssetValue = new ImageAsset\Value($contentInfo->id, "Picture of an apple."); +$imageAssetValue = new ImageAsset\Value($contentInfo->id, 'Picture of an apple.'); ``` ### Validation diff --git a/docs/content_management/field_types/field_type_reference/imagefield.md b/docs/content_management/field_types/field_type_reference/imagefield.md index 40377a8d0c..4fe05b1fa3 100644 --- a/docs/content_management/field_types/field_type_reference/imagefield.md +++ b/docs/content_management/field_types/field_type_reference/imagefield.md @@ -154,7 +154,9 @@ It expects a VersionInfo, the Image field, and the variation name as a string (` /** @var \Ibexa\Contracts\Core\Repository\Values\Content\Field $imageField */ /** @var \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo $versionInfo */ $variation = $imageVariationHandler->getVariation( - $imageField, $versionInfo, 'large' + $imageField, + $versionInfo, + 'large' ); echo $variation->uri; @@ -171,11 +173,11 @@ For an Image, the quickest is to call `setField()` on the ContentStruct: /** @var \Ibexa\Contracts\Core\Repository\ContentService $contentService */ /** @var \Ibexa\Contracts\Core\Repository\ContentTypeService $contentTypeService */ $createStruct = $contentService->newContentCreateStruct( - $contentTypeService->loadContentTypeByIdentifier( 'image' ), + $contentTypeService->loadContentTypeByIdentifier('image'), 'eng-GB' ); -$createStruct->setField( 'image', '/tmp/image.png' ); +$createStruct->setField('image', '/tmp/image.png'); ``` To customize the Image's alternative texts, you must first get an `Image\Value` object, and set this property. @@ -185,13 +187,13 @@ For that, you can use the `Image\Value::fromString()` method that accepts the pa /** @var \Ibexa\Contracts\Core\Repository\ContentService $contentService */ /** @var \Ibexa\Contracts\Core\Repository\ContentTypeService $contentTypeService */ $createStruct = $contentService->newContentCreateStruct( - $contentTypeService->loadContentTypeByIdentifier( 'image' ), + $contentTypeService->loadContentTypeByIdentifier('image'), 'eng-GB' ); -$imageField = \Ibexa\Core\FieldType\Image\Value::fromString( '/tmp/image.png' ); +$imageField = \Ibexa\Core\FieldType\Image\Value::fromString('/tmp/image.png'); $imageField->alternativeText = 'My alternative text'; -$createStruct->setField( 'image', $imageField ); +$createStruct->setField('image', $imageField); ``` You can also provide a hash of `Image\Value` properties, either to `setField()`, or to the constructor: @@ -203,11 +205,11 @@ $imageValue = new \Ibexa\Core\FieldType\Image\Value( 'id' => '/tmp/image.png', 'fileSize' => 37931, 'fileName' => 'image.png', - 'alternativeText' => 'My alternative text' + 'alternativeText' => 'My alternative text', ] ); -$createStruct->setField( 'image', $imageValue ); +$createStruct->setField('image', $imageValue); ``` ### From REST diff --git a/docs/content_management/field_types/field_type_reference/integerfield.md b/docs/content_management/field_types/field_type_reference/integerfield.md index 17da940854..d9215f82ed 100644 --- a/docs/content_management/field_types/field_type_reference/integerfield.md +++ b/docs/content_management/field_types/field_type_reference/integerfield.md @@ -40,7 +40,7 @@ It expects a numeric, integer value. use Ibexa\Core\FieldType\Integer; // Instantiates a Integer Value object -$integerValue = new Integer\Value( 8 ); +$integerValue = new Integer\Value(8); ``` ### Hash format @@ -67,8 +67,8 @@ This field type supports `IntegerValueValidator`, defining maximum and minimum f ``` php // Example of validator configuration in PHP $validatorConfiguration = [ - "minIntegerValue" => 1, - "maxIntegerValue" => 24 + 'minIntegerValue' => 1, + 'maxIntegerValue' => 24, ]; ``` diff --git a/docs/content_management/field_types/field_type_reference/keywordfield.md b/docs/content_management/field_types/field_type_reference/keywordfield.md index 12a370792b..c827833fef 100644 --- a/docs/content_management/field_types/field_type_reference/keywordfield.md +++ b/docs/content_management/field_types/field_type_reference/keywordfield.md @@ -34,7 +34,7 @@ use Ibexa\Core\FieldType\Keyword\Value; $keywordValue = new Value(); // Sets an array of keywords as a value -$keywordValue->values = [ "php", "css3", "html5", "Ibexa Platform" ]; +$keywordValue->values = ['php', 'css3', 'html5', 'Ibexa Platform']; ``` #### Constructor @@ -48,9 +48,9 @@ It expects a list of keywords, either comma-separated in a string or as an array use Ibexa\Core\FieldType\Keyword\Value; // Instantiates a Value object with an array of keywords -$keywordValue = new Value( [ "php5", "css3", "html5" ] ); +$keywordValue = new Value(['php5', 'css3', 'html5']); // Instantiates a Value object with a list of keywords in a string // This is equivalent to the example above -$keywordValue = new Value( "php5,css3,html5" ); +$keywordValue = new Value('php5,css3,html5'); ``` diff --git a/docs/content_management/field_types/field_type_reference/maplocationfield.md b/docs/content_management/field_types/field_type_reference/maplocationfield.md index e0f64d78b4..071c6f5f39 100644 --- a/docs/content_management/field_types/field_type_reference/maplocationfield.md +++ b/docs/content_management/field_types/field_type_reference/maplocationfield.md @@ -45,7 +45,7 @@ $MapLocationValue = new MapLocation\Value( [ 'latitude' => 59.928732, 'longitude' => 10.777888, - 'address' => "Ibexa Nordics" + 'address' => 'Ibexa Nordics', ] ); ``` diff --git a/docs/content_management/field_types/field_type_reference/measurementfield.md b/docs/content_management/field_types/field_type_reference/measurementfield.md index 1d68944c67..8f25a11d31 100644 --- a/docs/content_management/field_types/field_type_reference/measurementfield.md +++ b/docs/content_management/field_types/field_type_reference/measurementfield.md @@ -52,9 +52,9 @@ use Ibexa\Measurement\FieldType\MeasurementValue; // Instantiates a Measurement Value object $measurementValue = new MeasurementValue( $measurementService->buildSimpleValue( - 'length', - 13.5, - 'centimeter' + 'length', + 13.5, + 'centimeter' ) ); ``` diff --git a/docs/content_management/field_types/field_type_reference/mediafield.md b/docs/content_management/field_types/field_type_reference/mediafield.md index a1d49b6a45..92688c1e3b 100644 --- a/docs/content_management/field_types/field_type_reference/mediafield.md +++ b/docs/content_management/field_types/field_type_reference/mediafield.md @@ -78,13 +78,13 @@ use Ibexa\Core\FieldType\Media\Type; /** @var \Ibexa\Contracts\Core\Repository\Repository $repository */ $contentTypeService = $repository->getContentTypeService(); -$mediaFieldCreateStruct = $contentTypeService->newFieldDefinitionCreateStruct( "media", "ibexa_media" ); +$mediaFieldCreateStruct = $contentTypeService->newFieldDefinitionCreateStruct('media', 'ibexa_media'); // Setting maximum file size to 5 megabytes $mediaFieldCreateStruct->validatorConfiguration = [ - "FileSizeValidator" => [ - "maxFileSize" => 5 * 1024 * 1024 - ] + 'FileSizeValidator' => [ + 'maxFileSize' => 5 * 1024 * 1024, + ], ]; ``` @@ -115,10 +115,10 @@ use Ibexa\Core\FieldType\Media\Type; /** @var \Ibexa\Contracts\Core\Repository\Repository $repository */ $contentTypeService = $repository->getContentTypeService(); -$mediaFieldCreateStruct = $contentTypeService->newFieldDefinitionCreateStruct( "media", "ibexa_media" ); +$mediaFieldCreateStruct = $contentTypeService->newFieldDefinitionCreateStruct('media', 'ibexa_media'); // Setting Adobe Flash as the media type $mediaFieldCreateStruct->fieldSettings = [ - "mediaType" => Type::TYPE_FLASH, + 'mediaType' => Type::TYPE_FLASH, ]; ``` diff --git a/docs/content_management/field_types/field_type_reference/relationfield.md b/docs/content_management/field_types/field_type_reference/relationfield.md index 08d02a58c3..ff01f27a61 100644 --- a/docs/content_management/field_types/field_type_reference/relationfield.md +++ b/docs/content_management/field_types/field_type_reference/relationfield.md @@ -43,7 +43,7 @@ use Ibexa\Core\FieldType\Relation as Relation; /** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo */ // Instantiates a Relation Value object -$relationValue = new Relation\Value( $contentInfo->id ); +$relationValue = new Relation\Value($contentInfo->id); ``` ### Validation @@ -66,8 +66,8 @@ The field definition of this field type can be configured with three options: use Ibexa\Core\FieldType\Relation\Type; $settings = [ - "selectionMethod" => 1, - "selectionRoot" => null, - "selectionContentTypes" => [] + 'selectionMethod' => 1, + 'selectionRoot' => null, + 'selectionContentTypes' => [], ]; ``` diff --git a/docs/content_management/field_types/field_type_reference/relationlistfield.md b/docs/content_management/field_types/field_type_reference/relationlistfield.md index 45813c490e..dc7d06eda2 100644 --- a/docs/content_management/field_types/field_type_reference/relationlistfield.md +++ b/docs/content_management/field_types/field_type_reference/relationlistfield.md @@ -35,7 +35,7 @@ This field type makes it possible to store and retrieve values of a relation to $relationList->destinationContentIds = [ $contentInfo1->id, $contentInfo2->id, - 170 + 170, ]; ``` @@ -55,7 +55,7 @@ $relationListValue = new RelationList\Value( [ $contentInfo1->id, $contentInfo2->id, - 170 + 170, ] ); ``` @@ -102,15 +102,15 @@ Following selection methods are available: use Ibexa\Core\FieldType\RelationList\Type; $fieldSettings = [ - "selectionMethod" => Type::SELECTION_BROWSE, - "selectionDefaultLocation" => null, - "selectionContentTypes" => [] + 'selectionMethod' => Type::SELECTION_BROWSE, + 'selectionDefaultLocation' => null, + 'selectionContentTypes' => [], ]; $validators = [ - "RelationListValueValidator" => [ - "selectionLimit" => 0, - ] + 'RelationListValueValidator' => [ + 'selectionLimit' => 0, + ], ]; ``` diff --git a/docs/content_management/field_types/field_type_reference/richtextfield.md b/docs/content_management/field_types/field_type_reference/richtextfield.md index b4f9871ec3..aa8c590434 100644 --- a/docs/content_management/field_types/field_type_reference/richtextfield.md +++ b/docs/content_management/field_types/field_type_reference/richtextfield.md @@ -73,7 +73,7 @@ The following example shows how to pass DocBook content to a [create struct](cre ``` php /** @var \Ibexa\Contracts\Core\Repository\ContentService $contentService */ /** @var \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType $contentType */ -$contentCreateStruct = $contentService->newContentCreateStruct( $contentType, "eng-GB" ); +$contentCreateStruct = $contentService->newContentCreateStruct($contentType, 'eng-GB'); $inputString = << @@ -87,7 +87,7 @@ $inputString = << DOCBOOK; -$contentCreateStruct->setField( "description", $inputString ); +$contentCreateStruct->setField('description', $inputString); ``` When creating RichText content with the REST API, use the `xml` key of the `fieldValue` tag: diff --git a/docs/content_management/field_types/field_type_reference/selectionfield.md b/docs/content_management/field_types/field_type_reference/selectionfield.md index ba540c4f78..2ab295f33b 100644 --- a/docs/content_management/field_types/field_type_reference/selectionfield.md +++ b/docs/content_management/field_types/field_type_reference/selectionfield.md @@ -32,7 +32,7 @@ The Value class of this field type contains the following properties: $value->selection = [1]; // Multiple selection -$value->selection = [ 1, 4, 5 ]; +$value->selection = [1, 4, 5]; ``` ##### Constructor @@ -44,7 +44,7 @@ The `Selection\Value` constructor accepts an array of selected element identifie use Ibexa\Core\FieldType\Selection as Selection; // Instanciates a selection value with items #1 and #2 selected -$selectionValue = new Selection\Value( [ 1, 2 ] ); +$selectionValue = new Selection\Value([1, 2]); ``` ##### String representation @@ -60,7 +60,7 @@ Hash format of this field type is the same as value object's `selection` propert ``` php // Example of value in hash format -$hash = [ 1, 2 ]; +$hash = [1, 2]; ``` ### Validation @@ -82,7 +82,7 @@ When option validation fails, a list with the invalid options is also presented. use Ibexa\Core\FieldType\Selection\Type; $settings = [ - "isMultiple" => true, - "options" => [1 => 'One', 2 => 'Two', 3 => 'Three'] + 'isMultiple' => true, + 'options' => [1 => 'One', 2 => 'Two', 3 => 'Three'], ]; ``` diff --git a/docs/content_management/field_types/field_type_reference/taxonomyentryfield.md b/docs/content_management/field_types/field_type_reference/taxonomyentryfield.md index d37fd40fdb..d746d6f1eb 100644 --- a/docs/content_management/field_types/field_type_reference/taxonomyentryfield.md +++ b/docs/content_management/field_types/field_type_reference/taxonomyentryfield.md @@ -53,7 +53,7 @@ use Ibexa\Taxonomy\FieldType\TaxonomyEntry; // Fetches TaxonomyEntry from TaxonomyService /** @var TaxonomyServiceInterface $taxonomyService */ -$taxonomyEntry = $taxonomyService->loadEntryByIdentifier('example_entry', 'tags'); +$taxonomyEntry = $taxonomyService->loadEntryByIdentifier('example_entry', 'tags'); // Instantiates a taxonomy entry value $taxonomyEntryFieldTypeValue = new TaxonomyEntry\Value($taxonomyEntry); diff --git a/docs/content_management/field_types/field_type_reference/textlinefield.md b/docs/content_management/field_types/field_type_reference/textlinefield.md index 04ed186ff0..7fa19359e0 100644 --- a/docs/content_management/field_types/field_type_reference/textlinefield.md +++ b/docs/content_management/field_types/field_type_reference/textlinefield.md @@ -39,7 +39,7 @@ To set the validation properties, the `validateValidatorConfiguration()` method [ 'StringLengthValidator' => [ 'maxStringLength' => 60, - 'minStringLength' => 1 - ] + 'minStringLength' => 1, + ], ]; ``` diff --git a/docs/content_management/field_types/field_type_reference/timefield.md b/docs/content_management/field_types/field_type_reference/timefield.md index 71e6448425..56fa0d0aac 100644 --- a/docs/content_management/field_types/field_type_reference/timefield.md +++ b/docs/content_management/field_types/field_type_reference/timefield.md @@ -75,7 +75,7 @@ The Field definition of this field type can be configured with several options: use Ibexa\Core\FieldType\Time\Type; $settings = [ - "defaultType" => Type::DEFAULT_EMPTY + 'defaultType' => Type::DEFAULT_EMPTY, ]; ``` diff --git a/docs/content_management/field_types/field_type_reference/urlfield.md b/docs/content_management/field_types/field_type_reference/urlfield.md index 1caac1b7e0..c7a35e3a3d 100644 --- a/docs/content_management/field_types/field_type_reference/urlfield.md +++ b/docs/content_management/field_types/field_type_reference/urlfield.md @@ -31,8 +31,8 @@ The Value class of this field type contains the following properties: // Value object content example /** @var \Ibexa\Core\FieldType\Url\Value $url */ -$url->link = "https://www.ibexa.co"; -$url->text = "Ibexa"; +$url->link = 'https://www.ibexa.co'; +$url->text = 'Ibexa'; ``` ##### Constructor @@ -45,7 +45,7 @@ It expects two comma-separated strings, corresponding to the link and text. use Ibexa\Core\FieldType\Url as Url; // Instantiates an Url Value object -$UrlValue = new Url\Value( "https://www.ibexa.co/", "Ibexa" ); +$UrlValue = new Url\Value('https://www.ibexa.co/', 'Ibexa'); ``` ### Hash format @@ -57,8 +57,8 @@ $UrlValue = new Url\Value( "https://www.ibexa.co/", "Ibexa" ); ```php // Example of the hash value in PHP $hash = [ - "link" => "https://www.ibexa.co/", - "text" => "Ibexa" + 'link' => 'https://www.ibexa.co/', + 'text' => 'Ibexa', ]; ``` diff --git a/docs/content_management/field_types/field_type_search.md b/docs/content_management/field_types/field_type_search.md index 01cd2cc862..cbf04b45ac 100644 --- a/docs/content_management/field_types/field_type_search.md +++ b/docs/content_management/field_types/field_type_search.md @@ -25,7 +25,7 @@ To be able to query data properly an indexable field type also is required to re use Ibexa\Contracts\Core\Search; return [ - 'url' => new Search\FieldType\StringField(), + 'url' => new Search\FieldType\StringField(), 'text' => new Search\FieldType\StringField(), ]; ``` diff --git a/docs/content_management/field_types/field_type_validation.md b/docs/content_management/field_types/field_type_validation.md index 23352400d9..35229d2e11 100644 --- a/docs/content_management/field_types/field_type_validation.md +++ b/docs/content_management/field_types/field_type_validation.md @@ -21,13 +21,13 @@ For example, for the `ibexa_string` type, the validator schema could be: [ 'stringLength' => [ 'minStringLength' => [ - 'type' => 'int', + 'type' => 'int', 'default' => 0, ], 'maxStringLength' => [ - 'type' => 'int', + 'type' => 'int', 'default' => null, - ] + ], ], ]; ``` diff --git a/docs/content_management/field_types/form_and_template.md b/docs/content_management/field_types/form_and_template.md index 1843372219..f45b3f85c0 100644 --- a/docs/content_management/field_types/form_and_template.md +++ b/docs/content_management/field_types/form_and_template.md @@ -24,9 +24,9 @@ The `FieldValueFormMapperInterface::mapFieldValueForm` method accepts two argume You have to add your form type to the content editing form. The example shows how `ibexa_boolean` injects the form: ``` php +use Ibexa\ContentForms\Form\Type\FieldType\CheckboxFieldType; use Ibexa\Contracts\ContentForms\Data\Content\FieldData; use Ibexa\Contracts\ContentForms\FieldType\FieldValueFormMapperInterface; -use Ibexa\ContentForms\Form\Type\FieldType\CheckboxFieldType; use Symfony\Component\Form\FormInterface; class MyMapper implements FieldValueFormMapperInterface @@ -75,7 +75,6 @@ use Ibexa\ContentForms\Form\Type\FieldType\CountryFieldType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\FormInterface; - class MyMapper implements FieldDefinitionFormMapperInterface { /** @param FormInterface $fieldDefinitionForm */ @@ -84,7 +83,8 @@ class MyMapper implements FieldDefinitionFormMapperInterface $fieldDefinitionForm ->add( 'isMultiple', - CheckboxType::class, [ + CheckboxType::class, + [ 'required' => false, 'property_path' => 'fieldSettings[isMultiple]', 'label' => 'field_definition.ibexa_country.is_multiple', @@ -94,7 +94,8 @@ class MyMapper implements FieldDefinitionFormMapperInterface $fieldDefinitionForm->getConfig()->getFormFactory()->createBuilder() ->create( 'defaultValue', - CountryFieldType::class, [ + CountryFieldType::class, + [ 'choices_as_values' => true, 'multiple' => true, 'expanded' => false, diff --git a/docs/content_management/field_types/type_and_value.md b/docs/content_management/field_types/type_and_value.md index fb55abd5b2..0f5de79a1f 100644 --- a/docs/content_management/field_types/type_and_value.md +++ b/docs/content_management/field_types/type_and_value.md @@ -172,12 +172,12 @@ An example schema could look like this: [ 'backupData' => [ 'type' => 'bool', - 'default' => false + 'default' => false, ], 'defaultValue' => [ 'type' => 'string', - 'default' => 'Default Value' - ] + 'default' => 'Default Value', + ], ]; ``` diff --git a/docs/content_management/url_management/url_management.md b/docs/content_management/url_management/url_management.md index ccf5b183cc..13ecba94a8 100644 --- a/docs/content_management/url_management/url_management.md +++ b/docs/content_management/url_management/url_management.md @@ -255,7 +255,7 @@ $destination = 'media/images/{1}/{2}'; $redirect = true; $urlWildcardService = $repository->getURLWildcardService(); -$repository->sudo(function ($repository) use ($urlWildcardService, $source, $destination, $redirect): void { +$repository->sudo(static function ($repository) use ($urlWildcardService, $source, $destination, $redirect): void { $urlWildcardService->create($source, $destination, $redirect); }); ``` diff --git a/docs/content_management/workflow/add_custom_workflow_action.md b/docs/content_management/workflow/add_custom_workflow_action.md index 77df1169d2..a805f9d16c 100644 --- a/docs/content_management/workflow/add_custom_workflow_action.md +++ b/docs/content_management/workflow/add_custom_workflow_action.md @@ -84,6 +84,6 @@ For example, you can override the message typed by the user: /** @var array $context */ /** @var \Symfony\Component\Workflow\Event\TransitionEvent $event */ $new_context = $context; -$new_context['message'] = "This article went through proofreading"; +$new_context['message'] = 'This article went through proofreading'; $event->setContext($new_context); ``` diff --git a/docs/multisite/languages/back_office_translations.md b/docs/multisite/languages/back_office_translations.md index cfec823433..2838c5386e 100644 --- a/docs/multisite/languages/back_office_translations.md +++ b/docs/multisite/languages/back_office_translations.md @@ -61,7 +61,8 @@ Here's an example: ``` php hl_lines="14-16" use Symfony\Contracts\Translation\TranslatorInterface; -final class MyService { +final class MyService +{ private TranslatorInterface $translator; public function __construct(TranslatorInterface $translator) diff --git a/docs/multisite/siteaccess/injecting_siteaccess.md b/docs/multisite/siteaccess/injecting_siteaccess.md index 43d52d38ab..2b60d58ab1 100644 --- a/docs/multisite/siteaccess/injecting_siteaccess.md +++ b/docs/multisite/siteaccess/injecting_siteaccess.md @@ -18,7 +18,7 @@ services: ``` php declare(strict_types=1); - + namespace App; use Ibexa\Contracts\Core\Repository\ContentService; @@ -27,7 +27,9 @@ use Ibexa\Core\MVC\Symfony\SiteAccess\SiteAccessServiceInterface; class MyService { private ContentService $contentService; + private SiteAccessServiceInterface $siteAccessService; + public function __construct( SiteAccessServiceInterface $siteAccessService, ContentService $contentService diff --git a/docs/permissions/custom_policies.md b/docs/permissions/custom_policies.md index 4d8268adef..ec1b272809 100644 --- a/docs/permissions/custom_policies.md +++ b/docs/permissions/custom_policies.md @@ -22,13 +22,13 @@ If no limitation is provided, value can be `null` or an empty array. ``` php $config = [ - "content" => [ - "read" => ["Class", "ParentClass", "Node", "Language"], - "edit" => ["Class", "ParentClass", "Language"] + 'content' => [ + 'read' => ['Class', 'ParentClass', 'Node', 'Language'], + 'edit' => ['Class', 'ParentClass', 'Language'], ], - "custom_module" => [ - "custom_function_1" => null, - "custom_function_2" => ["CustomLimitation"] + 'custom_module' => [ + 'custom_function_1' => null, + 'custom_function_2' => ['CustomLimitation'], ], ]; ``` @@ -39,7 +39,9 @@ Name provided in the hash for each limitation is the same value set in the `alia For example: ``` php -addConfig([ - "custom_module" => [ - "custom_function_1" => null, - "custom_function_2" => ["CustomLimitation"], + 'custom_module' => [ + 'custom_function_1' => null, + 'custom_function_2' => ['CustomLimitation'], ], ]); } @@ -96,7 +98,9 @@ For example, `translations/forms.en.yaml`: You can also implement `TranslationContainerInterface` to provide those translations in your policy provider class: ``` php -addConfig([ - "custom_module" => [ - "custom_function_1" => null, - "custom_function_2" => ["CustomLimitation"], + 'custom_module' => [ + 'custom_function_1' => null, + 'custom_function_2' => ['CustomLimitation'], ], ]); } diff --git a/docs/search/aggregation_reference/datemetadatarange_aggregation.md b/docs/search/aggregation_reference/datemetadatarange_aggregation.md index d47dcbd4ef..5b766dc53f 100644 --- a/docs/search/aggregation_reference/datemetadatarange_aggregation.md +++ b/docs/search/aggregation_reference/datemetadatarange_aggregation.md @@ -20,10 +20,13 @@ use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; $query = new Query(); -$query->aggregations[] = new Aggregation\DateMetadataRangeAggregation('date_metadata', Aggregation\DateMetadataRangeAggregation::PUBLISHED, +$query->aggregations[] = new Aggregation\DateMetadataRangeAggregation( + 'date_metadata', + Aggregation\DateMetadataRangeAggregation::PUBLISHED, [ Range::ofDateTime(null, new DateTime('2020-06-01')), Range::ofDateTime(new DateTime('2020-06-01'), new DateTime('2020-12-31')), Range::ofDateTime(new DateTime('2020-12-31'), null), - ]); + ] +); ``` diff --git a/docs/search/aggregation_reference/daterange_aggregation.md b/docs/search/aggregation_reference/daterange_aggregation.md index b8e1ac1823..117c8a1e03 100644 --- a/docs/search/aggregation_reference/daterange_aggregation.md +++ b/docs/search/aggregation_reference/daterange_aggregation.md @@ -19,10 +19,14 @@ use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; $query = new Query(); -$query->aggregations[] = new Aggregation\Field\DateRangeAggregation('date', 'event', 'event_date', -[ +$query->aggregations[] = new Aggregation\Field\DateRangeAggregation( + 'date', + 'event', + 'event_date', + [ Range::ofDateTime(null, new DateTime('2020-06-01')), Range::ofDateTime(new DateTime('2020-06-01'), new DateTime('2020-12-31')), Range::ofDateTime(new DateTime('2020-12-31'), null), -]); +] +); ``` diff --git a/docs/search/aggregation_reference/datetimerange_aggregation.md b/docs/search/aggregation_reference/datetimerange_aggregation.md index 17e8d14e0c..d5c4aa2b17 100644 --- a/docs/search/aggregation_reference/datetimerange_aggregation.md +++ b/docs/search/aggregation_reference/datetimerange_aggregation.md @@ -19,10 +19,14 @@ use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; $query = new Query(); -$query->aggregations[] = new Aggregation\Field\DateTimeRangeAggregation('date', 'event', 'event_date', -[ +$query->aggregations[] = new Aggregation\Field\DateTimeRangeAggregation( + 'date', + 'event', + 'event_date', + [ Range::ofDateTime(null, new DateTime('2020-06-01')), Range::ofDateTime(new DateTime('2020-06-01'), new DateTime('2020-12-31')), Range::ofDateTime(new DateTime('2020-12-31'), null), -]); +] +); ``` diff --git a/docs/search/aggregation_reference/floatrange_aggregation.md b/docs/search/aggregation_reference/floatrange_aggregation.md index 8bcb0eb15c..b8ef132ece 100644 --- a/docs/search/aggregation_reference/floatrange_aggregation.md +++ b/docs/search/aggregation_reference/floatrange_aggregation.md @@ -19,10 +19,14 @@ use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; $query = new Query(); -$query->aggregations[] = new Aggregation\Field\FloatRangeAggregation('float', 'product', 'weight', -[ +$query->aggregations[] = new Aggregation\Field\FloatRangeAggregation( + 'float', + 'product', + 'weight', + [ Range::ofFloat(null, 0.25), Range::ofFloat(0.25, 0.75), Range::ofFloat(0.75, null), -]); +] +); ``` diff --git a/docs/search/aggregation_reference/integerrange_aggregation.md b/docs/search/aggregation_reference/integerrange_aggregation.md index 0a422a87d5..1693b588fb 100644 --- a/docs/search/aggregation_reference/integerrange_aggregation.md +++ b/docs/search/aggregation_reference/integerrange_aggregation.md @@ -19,10 +19,14 @@ use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range; $query = new Query(); -$query->aggregations[] = new Aggregation\Field\IntegerRangeAggregation('integer', 'product', 'amount', -[ +$query->aggregations[] = new Aggregation\Field\IntegerRangeAggregation( + 'integer', + 'product', + 'amount', + [ Range::ofInt(null, 12), Range::ofInt(12, 24), Range::ofInt(24, null), -]); +] +); ``` diff --git a/docs/search/aggregation_reference/timerange_aggregation.md b/docs/search/aggregation_reference/timerange_aggregation.md index 0e34cd1d4a..5c5135599d 100644 --- a/docs/search/aggregation_reference/timerange_aggregation.md +++ b/docs/search/aggregation_reference/timerange_aggregation.md @@ -24,9 +24,13 @@ if ($timestamp === false) { } $query = new Query(); -$query->aggregations[] = new Aggregation\Field\TimeRangeAggregation('date', 'event', 'event_time', -[ +$query->aggregations[] = new Aggregation\Field\TimeRangeAggregation( + 'date', + 'event', + 'event_time', + [ Range::ofInt(null, $timestamp), Range::ofInt($timestamp, null), -]); +] +); ``` diff --git a/docs/search/criteria_reference/ancestor_criterion.md b/docs/search/criteria_reference/ancestor_criterion.md index 81c74ce7b6..84ea7d5257 100644 --- a/docs/search/criteria_reference/ancestor_criterion.md +++ b/docs/search/criteria_reference/ancestor_criterion.md @@ -15,8 +15,8 @@ The [`Ancestor` Search Criterion](/api/php_api/php_api_reference/classes/Ibexa-C ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); /** @var \Ibexa\Contracts\Core\Repository\LocationService $locationService */ @@ -50,9 +50,8 @@ $query->query = new Criterion\Ancestor([$locationService->loadLocation(62)->path You can use the Ancestor Search Criterion to create a list of breadcrumbs leading to the Location: ``` php hl_lines="2" -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; /** @var int $locationId */ /** @var object{locationService: \Ibexa\Contracts\Core\Repository\LocationService, searchService: \Ibexa\Contracts\Core\Repository\SearchService} $this */ diff --git a/docs/search/criteria_reference/baseprice_criterion.md b/docs/search/criteria_reference/baseprice_criterion.md index 69e625c861..c834d0b416 100644 --- a/docs/search/criteria_reference/baseprice_criterion.md +++ b/docs/search/criteria_reference/baseprice_criterion.md @@ -20,8 +20,8 @@ The `BasePrice` Criterion isn't available in the Legacy Search engine. ### PHP ``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; $query = new ProductQuery( null, diff --git a/docs/search/criteria_reference/checkboxattribute_criterion.md b/docs/search/criteria_reference/checkboxattribute_criterion.md index 126bc24c06..64fefc9895 100644 --- a/docs/search/criteria_reference/checkboxattribute_criterion.md +++ b/docs/search/criteria_reference/checkboxattribute_criterion.md @@ -16,8 +16,8 @@ The `CheckboxAttribute` Search Criterion searches for products by the value of t ### PHP ``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; $query = new ProductQuery( null, diff --git a/docs/search/criteria_reference/colorattribute_criterion.md b/docs/search/criteria_reference/colorattribute_criterion.md index 7e8055b36e..775f206022 100644 --- a/docs/search/criteria_reference/colorattribute_criterion.md +++ b/docs/search/criteria_reference/colorattribute_criterion.md @@ -16,8 +16,8 @@ The `ColorAttribute` Search Criterion searches for products by the value of thei ### PHP ``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; $query = new ProductQuery( null, diff --git a/docs/search/criteria_reference/contentid_criterion.md b/docs/search/criteria_reference/contentid_criterion.md index 5b10d96682..0a547c22ae 100644 --- a/docs/search/criteria_reference/contentid_criterion.md +++ b/docs/search/criteria_reference/contentid_criterion.md @@ -15,8 +15,8 @@ The [`ContentId` Search Criterion](/api/php_api/php_api_reference/classes/Ibexa- ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\ContentId([62, 64]); diff --git a/docs/search/criteria_reference/contentname_criterion.md b/docs/search/criteria_reference/contentname_criterion.md index 9280b29471..81f6557267 100644 --- a/docs/search/criteria_reference/contentname_criterion.md +++ b/docs/search/criteria_reference/contentname_criterion.md @@ -15,8 +15,8 @@ The [`ContentName` Search Criterion](https://github.com/ibexa/core/blob/5.0/src/ ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\ContentName('*phone'); diff --git a/docs/search/criteria_reference/contenttypeid_criterion.md b/docs/search/criteria_reference/contenttypeid_criterion.md index 77156c4a52..853ba1b908 100644 --- a/docs/search/criteria_reference/contenttypeid_criterion.md +++ b/docs/search/criteria_reference/contenttypeid_criterion.md @@ -15,8 +15,8 @@ The [`ContentTypeId` Search Criterion](/api/php_api/php_api_reference/classes/Ib ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\ContentTypeId([44]); diff --git a/docs/search/criteria_reference/contenttypeidentifier_criterion.md b/docs/search/criteria_reference/contenttypeidentifier_criterion.md index c7a8fafb38..1d980812ff 100644 --- a/docs/search/criteria_reference/contenttypeidentifier_criterion.md +++ b/docs/search/criteria_reference/contenttypeidentifier_criterion.md @@ -15,8 +15,8 @@ The [`ContentTypeIdentifier` Search Criterion](/api/php_api/php_api_reference/cl ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\ContentTypeIdentifier(['article', 'blog_post']); diff --git a/docs/search/criteria_reference/createdat_criterion.md b/docs/search/criteria_reference/createdat_criterion.md index c90d0ffed0..4f5a58d5d7 100644 --- a/docs/search/criteria_reference/createdat_criterion.md +++ b/docs/search/criteria_reference/createdat_criterion.md @@ -16,8 +16,8 @@ The `CreatedAt` Search Criterion searches for products based on the date when th ### PHP ``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; $criteria = new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\CreatedAt( new DateTime('2023-03-01'), diff --git a/docs/search/criteria_reference/createdatrange_criterion.md b/docs/search/criteria_reference/createdatrange_criterion.md index 81023d7d97..074fa77c5c 100644 --- a/docs/search/criteria_reference/createdatrange_criterion.md +++ b/docs/search/criteria_reference/createdatrange_criterion.md @@ -16,8 +16,8 @@ The `CreatedAtRange` Search Criterion searches for products based on the date ra ### PHP ``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; $criteria = new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\CreatedAtRange( new \DateTimeImmutable('2020-07-10T00:00:00+00:00'), diff --git a/docs/search/criteria_reference/customergroupid_criterion.md b/docs/search/criteria_reference/customergroupid_criterion.md index 14fea50f8f..44c7b31977 100644 --- a/docs/search/criteria_reference/customergroupid_criterion.md +++ b/docs/search/criteria_reference/customergroupid_criterion.md @@ -15,8 +15,8 @@ The `CustomerGroupId` Search Criterion searches for content based on the ID of i ### PHP ``` php -use Ibexa\Contracts\ProductCatalog\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\ProductCatalog\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\CustomerGroupId(1); diff --git a/docs/search/criteria_reference/customprice_criterion.md b/docs/search/criteria_reference/customprice_criterion.md index 5b70e3ebda..0855e9e596 100644 --- a/docs/search/criteria_reference/customprice_criterion.md +++ b/docs/search/criteria_reference/customprice_criterion.md @@ -22,8 +22,8 @@ The `CustomPrice` Criterion isn't available in the Legacy Search engine. ### PHP ``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; /** @var \Ibexa\Contracts\ProductCatalog\Values\CustomerGroupInterface $customerGroup */ $query = new ProductQuery( @@ -31,6 +31,7 @@ $query = new ProductQuery( new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\CustomPrice( \Money\Money::EUR(13800), \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\Operator::GTE, - $customerGroup) + $customerGroup + ) ); ``` diff --git a/docs/search/criteria_reference/datemetadata_criterion.md b/docs/search/criteria_reference/datemetadata_criterion.md index 1656acbfe9..8e88795028 100644 --- a/docs/search/criteria_reference/datemetadata_criterion.md +++ b/docs/search/criteria_reference/datemetadata_criterion.md @@ -17,8 +17,8 @@ The [`DateMetadata` Search Criterion](/api/php_api/php_api_reference/classes/Ibe ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\DateMetadata( @@ -63,13 +63,13 @@ $query->query = new Criterion\DateMetadata( You can use the `DateMetadata` Criterion to search for blog posts that have been created within the last week: ``` php hl_lines="5" -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; -$query = new LocationQuery; -$date = strtotime("-1 week"); -$query->query = new Criterion\LogicalAnd([ +$query = new LocationQuery(); +$date = strtotime('-1 week'); +$query->query = new Criterion\LogicalAnd( + [ new Criterion\ContentTypeIdentifier('blog_post'), new Criterion\DateMetadata(Criterion\DateMetadata::CREATED, Criterion\Operator::GTE, $date), ] diff --git a/docs/search/criteria_reference/depth_criterion.md b/docs/search/criteria_reference/depth_criterion.md index 69fd6c636f..984ccb6435 100644 --- a/docs/search/criteria_reference/depth_criterion.md +++ b/docs/search/criteria_reference/depth_criterion.md @@ -24,8 +24,8 @@ The `value` argument requires: ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\Location\Depth(Criterion\Operator::LT, 3); diff --git a/docs/search/criteria_reference/field_criterion.md b/docs/search/criteria_reference/field_criterion.md index a27b93cfd1..1733dc21e9 100644 --- a/docs/search/criteria_reference/field_criterion.md +++ b/docs/search/criteria_reference/field_criterion.md @@ -26,8 +26,8 @@ The `Field` Criterion isn't available in [Repository filtering](search_api.md#re ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\Field('name', Criterion\Operator::CONTAINS, 'Platform'); @@ -70,14 +70,14 @@ $query->query = new Criterion\Field('name', Criterion\Operator::CONTAINS, 'Platf You can use the `Field` Criterion to search for articles that contain the word "featured": ``` php hl_lines="4" -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new LocationQuery(); -$query->query = new Criterion\LogicalAnd([ +$query->query = new Criterion\LogicalAnd( + [ new Criterion\ContentTypeIdentifier('article'), - new Criterion\Field('name', Criterion\Operator::CONTAINS, 'Featured') + new Criterion\Field('name', Criterion\Operator::CONTAINS, 'Featured'), ] ); ``` diff --git a/docs/search/criteria_reference/fieldrelation_criterion.md b/docs/search/criteria_reference/fieldrelation_criterion.md index 84a85342b3..9640f43c2c 100644 --- a/docs/search/criteria_reference/fieldrelation_criterion.md +++ b/docs/search/criteria_reference/fieldrelation_criterion.md @@ -23,8 +23,8 @@ The `FieldRelation` Criterion isn't available in [Repository filtering](search_a ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\FieldRelation('relations', Criterion\Operator::CONTAINS, [55, 63]); diff --git a/docs/search/criteria_reference/floatattribute_criterion.md b/docs/search/criteria_reference/floatattribute_criterion.md index b5f112ed9a..edf8e55637 100644 --- a/docs/search/criteria_reference/floatattribute_criterion.md +++ b/docs/search/criteria_reference/floatattribute_criterion.md @@ -16,8 +16,8 @@ The `FloatAttribute` Search Criterion searches for products by the value of thei ### PHP ``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; $query = new ProductQuery( null, diff --git a/docs/search/criteria_reference/fulltext_criterion.md b/docs/search/criteria_reference/fulltext_criterion.md index e5730d4fa4..a9ac61cfbe 100644 --- a/docs/search/criteria_reference/fulltext_criterion.md +++ b/docs/search/criteria_reference/fulltext_criterion.md @@ -40,8 +40,8 @@ The `FullText` Criterion isn't available in [Repository filtering](search_api.md ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\FullText('victory'); @@ -50,8 +50,8 @@ $query->query = new Criterion\FullText('victory'); Using double quotes to indicate a phrase: ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\FullText('"world cup"'); @@ -60,8 +60,8 @@ $query->query = new Criterion\FullText('"world cup"'); Using the AND operator and parenthesis to search for both words at the same time: ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\FullText('baseball AND cup'); @@ -94,8 +94,8 @@ $query->query = new Criterion\FullText('baseball AND cup'); Assume the following search query: ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\FullText('(cup AND ba*ball) "breaking news"'); diff --git a/docs/search/criteria_reference/image_criterion.md b/docs/search/criteria_reference/image_criterion.md index 5158d561fa..43ad087a37 100644 --- a/docs/search/criteria_reference/image_criterion.md +++ b/docs/search/criteria_reference/image_criterion.md @@ -16,8 +16,8 @@ The `Image` Search Criterion searches for image by specified image attributes. ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $imageCriteriaData = [ 'mimeTypes' => [ diff --git a/docs/search/criteria_reference/imagedimensions_criterion.md b/docs/search/criteria_reference/imagedimensions_criterion.md index af896951ae..85bad978be 100644 --- a/docs/search/criteria_reference/imagedimensions_criterion.md +++ b/docs/search/criteria_reference/imagedimensions_criterion.md @@ -16,8 +16,8 @@ The `Dimensions` Search Criterion searches for image with specified dimensions. ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $imageCriteriaData = [ diff --git a/docs/search/criteria_reference/imagefilesize_criterion.md b/docs/search/criteria_reference/imagefilesize_criterion.md index eb25310bf8..284d4507d2 100644 --- a/docs/search/criteria_reference/imagefilesize_criterion.md +++ b/docs/search/criteria_reference/imagefilesize_criterion.md @@ -17,8 +17,8 @@ The `FileSize` Search Criterion searches for image with specified size. ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\Image\FileSize('image', 0, 1.5); diff --git a/docs/search/criteria_reference/imageheight_criterion.md b/docs/search/criteria_reference/imageheight_criterion.md index b612f87637..ff8402b4ae 100644 --- a/docs/search/criteria_reference/imageheight_criterion.md +++ b/docs/search/criteria_reference/imageheight_criterion.md @@ -17,8 +17,8 @@ The `Height` Search Criterion searches for image with specified height. ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\Image\Height('image', 0, 1500); diff --git a/docs/search/criteria_reference/imagemimetype_criterion.md b/docs/search/criteria_reference/imagemimetype_criterion.md index 44120a403f..012807145e 100644 --- a/docs/search/criteria_reference/imagemimetype_criterion.md +++ b/docs/search/criteria_reference/imagemimetype_criterion.md @@ -16,8 +16,8 @@ The `MimeType` Search Criterion searches for image with specified mime type(s). ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\Image\MimeType('image', 'image/jpeg'); @@ -26,8 +26,8 @@ $query->query = new Criterion\Image\MimeType('image', 'image/jpeg'); or ```php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $mimeTypes = [ diff --git a/docs/search/criteria_reference/imagewidth_criterion.md b/docs/search/criteria_reference/imagewidth_criterion.md index 209a2e6164..63aa770802 100644 --- a/docs/search/criteria_reference/imagewidth_criterion.md +++ b/docs/search/criteria_reference/imagewidth_criterion.md @@ -17,8 +17,8 @@ The `Width` Search Criterion searches for image with specified width. ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\Image\Width('image', 150, 1000); diff --git a/docs/search/criteria_reference/integerattribute_criterion.md b/docs/search/criteria_reference/integerattribute_criterion.md index f25dafffd8..bde2ad05ba 100644 --- a/docs/search/criteria_reference/integerattribute_criterion.md +++ b/docs/search/criteria_reference/integerattribute_criterion.md @@ -16,8 +16,8 @@ The `IntegerAttribute` Search Criterion searches for products by the value of th ### PHP ``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; $query = new ProductQuery( null, diff --git a/docs/search/criteria_reference/iscontainer_criterion.md b/docs/search/criteria_reference/iscontainer_criterion.md index 1aac663f2b..b5c30a0770 100644 --- a/docs/search/criteria_reference/iscontainer_criterion.md +++ b/docs/search/criteria_reference/iscontainer_criterion.md @@ -16,8 +16,8 @@ The [`IsContainer` Search Criterion](/api/php_api/php_api_reference/classes/Ibex ### PHP ```php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\IsContainer(); // Finds containers diff --git a/docs/search/criteria_reference/isfieldempty_criterion.md b/docs/search/criteria_reference/isfieldempty_criterion.md index 3706a2e600..25d3dd994e 100644 --- a/docs/search/criteria_reference/isfieldempty_criterion.md +++ b/docs/search/criteria_reference/isfieldempty_criterion.md @@ -26,8 +26,8 @@ For this use case, use [`TaxonomyNoEntries`](taxonomy_no_entries.md) instead. ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\IsFieldEmpty('title'); @@ -38,12 +38,12 @@ $query->query = new Criterion\IsFieldEmpty('title'); You can use the `IsFieldEmpty` Criterion to search for articles that don't have an image: ``` php hl_lines="4" -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; -$query = new LocationQuery; -$query->query = new Criterion\LogicalAnd([ +$query = new LocationQuery(); +$query->query = new Criterion\LogicalAnd( + [ new Criterion\ContentTypeIdentifier('article'), new Criterion\IsFieldEmpty('image'), ] diff --git a/docs/search/criteria_reference/ismainlocation_criterion.md b/docs/search/criteria_reference/ismainlocation_criterion.md index 6508867d33..d3790a5045 100644 --- a/docs/search/criteria_reference/ismainlocation_criterion.md +++ b/docs/search/criteria_reference/ismainlocation_criterion.md @@ -18,9 +18,9 @@ representing whether to search for a main or not main location ### PHP ``` php +use Ibexa\Contracts\Core\Repository\Values\Content\Query; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Location\IsMainLocation; -use Ibexa\Contracts\Core\Repository\Values\Content\Query; $query = new Query(); $query->query = new Criterion\Location\IsMainLocation(IsMainLocation::MAIN); diff --git a/docs/search/criteria_reference/isproductbased_criterion.md b/docs/search/criteria_reference/isproductbased_criterion.md index fb1d4ae184..507450e3e3 100644 --- a/docs/search/criteria_reference/isproductbased_criterion.md +++ b/docs/search/criteria_reference/isproductbased_criterion.md @@ -11,8 +11,8 @@ The `IsProductBased` Search Criterion searches for content that plays the role o ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new \Ibexa\Contracts\ProductCatalog\Values\Content\Query\Criterion\IsProductBased(); diff --git a/docs/search/criteria_reference/isuserbased_criterion.md b/docs/search/criteria_reference/isuserbased_criterion.md index 0b5c9c4e1e..b07c5cd58d 100644 --- a/docs/search/criteria_reference/isuserbased_criterion.md +++ b/docs/search/criteria_reference/isuserbased_criterion.md @@ -25,8 +25,8 @@ The `IsUserBased` Criterion isn't available in Solr or Elasticsearch engines. ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\IsUserBased(); diff --git a/docs/search/criteria_reference/isuserenabled_criterion.md b/docs/search/criteria_reference/isuserenabled_criterion.md index 4a93c6bc35..bd61b058f5 100644 --- a/docs/search/criteria_reference/isuserenabled_criterion.md +++ b/docs/search/criteria_reference/isuserenabled_criterion.md @@ -16,8 +16,8 @@ The [`IsUserEnabled` Search Criterion](/api/php_api/php_api_reference/classes/Ib ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\IsUserEnabled(); diff --git a/docs/search/criteria_reference/isvirtual_criterion.md b/docs/search/criteria_reference/isvirtual_criterion.md index 7aef8f79cd..50b243df6d 100644 --- a/docs/search/criteria_reference/isvirtual_criterion.md +++ b/docs/search/criteria_reference/isvirtual_criterion.md @@ -15,8 +15,8 @@ The `IsVirtual` Search Criterion searches for virtual or physical products. ### PHP ``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; $query = new ProductQuery( null, diff --git a/docs/search/criteria_reference/languagecode_criterion.md b/docs/search/criteria_reference/languagecode_criterion.md index a7ec7a1632..7b74156f66 100644 --- a/docs/search/criteria_reference/languagecode_criterion.md +++ b/docs/search/criteria_reference/languagecode_criterion.md @@ -16,8 +16,8 @@ The [`LanguageCode` Search Criterion](/api/php_api/php_api_reference/classes/Ibe ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\LanguageCode('ger-DE', false); @@ -50,17 +50,17 @@ $query->query = new Criterion\LanguageCode('ger-DE', false); You can use the `LanguageCode` Criterion to search for articles that are lacking a translation into a specific language: -``` php hl_lines="5" -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +``` php hl_lines="9" use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; -$query = new LocationQuery; -$query->query = new Criterion\LogicalAnd([ +$query = new LocationQuery(); +$query->query = new Criterion\LogicalAnd( + [ new Criterion\ContentTypeIdentifier('article'), new Criterion\LogicalNot( new Criterion\LanguageCode('ger-DE', false) - ) + ), ] ); diff --git a/docs/search/criteria_reference/locationid_criterion.md b/docs/search/criteria_reference/locationid_criterion.md index b2892f9179..7fba54c3f7 100644 --- a/docs/search/criteria_reference/locationid_criterion.md +++ b/docs/search/criteria_reference/locationid_criterion.md @@ -15,8 +15,8 @@ The [`LocationId` Search Criterion](/api/php_api/php_api_reference/classes/Ibexa ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\LocationId(62); diff --git a/docs/search/criteria_reference/locationremoteid_criterion.md b/docs/search/criteria_reference/locationremoteid_criterion.md index 1c3380d6fe..e51cadb8c1 100644 --- a/docs/search/criteria_reference/locationremoteid_criterion.md +++ b/docs/search/criteria_reference/locationremoteid_criterion.md @@ -15,8 +15,8 @@ The [`LocationRemoteId` Search Criterion](/api/php_api/php_api_reference/classes ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\LocationRemoteId(['4d1e5f216c0a7aaab7f005ffd4b6a8a8', 'b81ef3e62b514188bfddd2a80d447d34']); diff --git a/docs/search/criteria_reference/logicaland_criterion.md b/docs/search/criteria_reference/logicaland_criterion.md index 5545cbca5b..b5eac8a4b3 100644 --- a/docs/search/criteria_reference/logicaland_criterion.md +++ b/docs/search/criteria_reference/logicaland_criterion.md @@ -21,7 +21,8 @@ use Ibexa\Contracts\Core\Repository\Values\Content\Query; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); -$query->query = new Criterion\LogicalAnd([ +$query->query = new Criterion\LogicalAnd( + [ new Criterion\ContentTypeIdentifier('article'), new Criterion\SectionIdentifier(['sports', 'news']), ] diff --git a/docs/search/criteria_reference/logicalnot_criterion.md b/docs/search/criteria_reference/logicalnot_criterion.md index 6d469f98b3..b1796be8d8 100644 --- a/docs/search/criteria_reference/logicalnot_criterion.md +++ b/docs/search/criteria_reference/logicalnot_criterion.md @@ -15,8 +15,8 @@ It takes only one Criterion in the array parameter. ## Example ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $contentTypeIdentifier = 'article'; diff --git a/docs/search/criteria_reference/logicalor_criterion.md b/docs/search/criteria_reference/logicalor_criterion.md index 03e030422c..0bbc57cd92 100644 --- a/docs/search/criteria_reference/logicalor_criterion.md +++ b/docs/search/criteria_reference/logicalor_criterion.md @@ -21,9 +21,10 @@ use Ibexa\Contracts\Core\Repository\Values\Content\Query; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); -$query->filter = new Criterion\LogicalOr([ +$query->filter = new Criterion\LogicalOr( + [ new Criterion\ContentTypeIdentifier('article'), - new Criterion\SectionIdentifier(['sports', 'news']) + new Criterion\SectionIdentifier(['sports', 'news']), ] ); ``` diff --git a/docs/search/criteria_reference/maplocationdistance_criterion.md b/docs/search/criteria_reference/maplocationdistance_criterion.md index f949779d0e..c70c375524 100644 --- a/docs/search/criteria_reference/maplocationdistance_criterion.md +++ b/docs/search/criteria_reference/maplocationdistance_criterion.md @@ -28,8 +28,8 @@ The `MapLocationDistance` Criterion isn't available in [Repository filtering](se ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\MapLocationDistance('location', Criterion\Operator::LTE, 5, 51.395973, 22.531696); diff --git a/docs/search/criteria_reference/objectstateid_criterion.md b/docs/search/criteria_reference/objectstateid_criterion.md index 9ed385987d..d4de1e801b 100644 --- a/docs/search/criteria_reference/objectstateid_criterion.md +++ b/docs/search/criteria_reference/objectstateid_criterion.md @@ -15,8 +15,8 @@ The [`ObjectStateId` Search Criterion](/api/php_api/php_api_reference/classes/Ib ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\ObjectStateId([4, 5]); diff --git a/docs/search/criteria_reference/objectstateidentifier_criterion.md b/docs/search/criteria_reference/objectstateidentifier_criterion.md index edbaeeef8f..90cdbc36d4 100644 --- a/docs/search/criteria_reference/objectstateidentifier_criterion.md +++ b/docs/search/criteria_reference/objectstateidentifier_criterion.md @@ -16,16 +16,16 @@ The [`ObjectStateIdentifier` Search Criterion](/api/php_api/php_api_reference/cl ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\ObjectStateIdentifier(['ready']); ``` ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\ObjectStateIdentifier(['not_locked'], 'ibexa_lock'); diff --git a/docs/search/criteria_reference/order_created_criterion.md b/docs/search/criteria_reference/order_created_criterion.md index a263bb160c..ac566ca2e6 100644 --- a/docs/search/criteria_reference/order_created_criterion.md +++ b/docs/search/criteria_reference/order_created_criterion.md @@ -17,8 +17,8 @@ The `CreatedAtCriterion` Search Criterion searches for orders based on the date ### PHP ``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; use Ibexa\Contracts\OrderManagement\Value\Order\OrderQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; $criteria = new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\CreatedAtCriterion( new DateTime('2023-03-01'), diff --git a/docs/search/criteria_reference/parentlocationid_criterion.md b/docs/search/criteria_reference/parentlocationid_criterion.md index 62a3d08661..50ea5cc6fb 100644 --- a/docs/search/criteria_reference/parentlocationid_criterion.md +++ b/docs/search/criteria_reference/parentlocationid_criterion.md @@ -16,8 +16,8 @@ searches for content based on the Location ID of its parent. ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\ParentLocationId([54, 58]); @@ -50,9 +50,8 @@ $query->query = new Criterion\ParentLocationId([54, 58]); You can use the `ParentLocationId` Search Criterion to list blog posts contained in a blog: ``` php hl_lines="4" -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; /** @var int $locationId */ /** @var object{searchService: \Ibexa\Contracts\Core\Repository\SearchService} $this */ diff --git a/docs/search/criteria_reference/payment_createdat_criterion.md b/docs/search/criteria_reference/payment_createdat_criterion.md index 0588a4b115..66c1130db3 100644 --- a/docs/search/criteria_reference/payment_createdat_criterion.md +++ b/docs/search/criteria_reference/payment_createdat_criterion.md @@ -17,8 +17,8 @@ The `CreatedAt` Search Criterion searches for payments based on the date when th ### PHP ``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; use Ibexa\Contracts\Payment\Payment\PaymentQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; $criteria = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\CreatedAt( new DateTime('2023-03-01') diff --git a/docs/search/criteria_reference/payment_method_createdat_criterion.md b/docs/search/criteria_reference/payment_method_createdat_criterion.md index 7160d1e177..fd2280a011 100644 --- a/docs/search/criteria_reference/payment_method_createdat_criterion.md +++ b/docs/search/criteria_reference/payment_method_createdat_criterion.md @@ -17,8 +17,8 @@ The `CreatedAt` Search Criterion searches for payment methods based on the date ### PHP ``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; use Ibexa\Contracts\Payment\PaymentMethod\PaymentMethodQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; $criteria = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\CreatedAt( new DateTime('2023-03-01') diff --git a/docs/search/criteria_reference/priority_criterion.md b/docs/search/criteria_reference/priority_criterion.md index 2eb275fefd..feffcf99ac 100644 --- a/docs/search/criteria_reference/priority_criterion.md +++ b/docs/search/criteria_reference/priority_criterion.md @@ -23,8 +23,8 @@ The `value` argument requires: ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\Location\Priority(Criterion\Operator::GTE, 50); diff --git a/docs/search/criteria_reference/productavailability_criterion.md b/docs/search/criteria_reference/productavailability_criterion.md index 50b9e010c4..78369e88f3 100644 --- a/docs/search/criteria_reference/productavailability_criterion.md +++ b/docs/search/criteria_reference/productavailability_criterion.md @@ -15,8 +15,8 @@ The `ProductAvailability` Search Criterion searches for products by their availa ### PHP ``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; $query = new ProductQuery( null, diff --git a/docs/search/criteria_reference/productcategory_criterion.md b/docs/search/criteria_reference/productcategory_criterion.md index ebf36ff1fe..8ca37ebc9c 100644 --- a/docs/search/criteria_reference/productcategory_criterion.md +++ b/docs/search/criteria_reference/productcategory_criterion.md @@ -15,8 +15,8 @@ The `ProductCategory` Search Criterion searches for products by the category the ### PHP ``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; $query = new ProductQuery( null, diff --git a/docs/search/criteria_reference/productcode_criterion.md b/docs/search/criteria_reference/productcode_criterion.md index 4e1735921a..be143665c5 100644 --- a/docs/search/criteria_reference/productcode_criterion.md +++ b/docs/search/criteria_reference/productcode_criterion.md @@ -15,8 +15,8 @@ The `ProductCode` Search Criterion searches for products by their codes. ### PHP ``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; $query = new ProductQuery( null, diff --git a/docs/search/criteria_reference/productname_criterion.md b/docs/search/criteria_reference/productname_criterion.md index d99b499ae7..5a3d9a18cf 100644 --- a/docs/search/criteria_reference/productname_criterion.md +++ b/docs/search/criteria_reference/productname_criterion.md @@ -15,8 +15,8 @@ The `ProductName` Search Criterion searches for products by their names. ### PHP ``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; $query = new ProductQuery( null, diff --git a/docs/search/criteria_reference/productstock_criterion.md b/docs/search/criteria_reference/productstock_criterion.md index 34e3d1a45f..710041b361 100644 --- a/docs/search/criteria_reference/productstock_criterion.md +++ b/docs/search/criteria_reference/productstock_criterion.md @@ -16,8 +16,8 @@ The `ProductStock` Search Criterion searches for products by their numerical sto ### PHP ``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; $productQuery = new ProductQuery( null, @@ -26,8 +26,8 @@ $productQuery = new ProductQuery( ``` ``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; $productQuery = new ProductQuery( null, diff --git a/docs/search/criteria_reference/productstockrange_criterion.md b/docs/search/criteria_reference/productstockrange_criterion.md index 040d0cf677..b185a705c8 100644 --- a/docs/search/criteria_reference/productstockrange_criterion.md +++ b/docs/search/criteria_reference/productstockrange_criterion.md @@ -16,8 +16,8 @@ The `ProductStockRange` Search Criterion searches for products by their numerica ### PHP ``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; $productQuery = new ProductQuery( null, diff --git a/docs/search/criteria_reference/producttype_criterion.md b/docs/search/criteria_reference/producttype_criterion.md index e59678c751..08bc2859a7 100644 --- a/docs/search/criteria_reference/producttype_criterion.md +++ b/docs/search/criteria_reference/producttype_criterion.md @@ -15,8 +15,8 @@ The `ProductType` Search Criterion searches for products by their codes. ### PHP ``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; $query = new ProductQuery( null, diff --git a/docs/search/criteria_reference/rangemeasurementattributemaximum_criterion.md b/docs/search/criteria_reference/rangemeasurementattributemaximum_criterion.md index be24a6545d..7a5a71edae 100644 --- a/docs/search/criteria_reference/rangemeasurementattributemaximum_criterion.md +++ b/docs/search/criteria_reference/rangemeasurementattributemaximum_criterion.md @@ -16,8 +16,8 @@ The `RangeMeasurementAttributeMaximum` Search Criterion searches for products by ### PHP ``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; /** @var \Ibexa\Contracts\Measurement\MeasurementServiceInterface $measurementService */ $value = $measurementService->buildSimpleValue('length', 150, 'centimeter'); diff --git a/docs/search/criteria_reference/rangemeasurementattributeminimum_criterion.md b/docs/search/criteria_reference/rangemeasurementattributeminimum_criterion.md index a352936e24..7f103eee09 100644 --- a/docs/search/criteria_reference/rangemeasurementattributeminimum_criterion.md +++ b/docs/search/criteria_reference/rangemeasurementattributeminimum_criterion.md @@ -16,8 +16,8 @@ The `RangeMeasurementAttributeMinimum` Search Criterion searches for products by ### PHP ``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; /** @var \Ibexa\Contracts\Measurement\MeasurementServiceInterface $measurementService */ $value = $measurementService->buildSimpleValue('length', 100, 'centimeter'); diff --git a/docs/search/criteria_reference/remoteid_criterion.md b/docs/search/criteria_reference/remoteid_criterion.md index f87e91a919..948ec2c7e8 100644 --- a/docs/search/criteria_reference/remoteid_criterion.md +++ b/docs/search/criteria_reference/remoteid_criterion.md @@ -16,8 +16,8 @@ searches for content based on its remote content ID. ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\RemoteId('abab615dcf26699a4291657152da4337'); diff --git a/docs/search/criteria_reference/sectionid_criterion.md b/docs/search/criteria_reference/sectionid_criterion.md index b7faf8bf2d..b7879fed3b 100644 --- a/docs/search/criteria_reference/sectionid_criterion.md +++ b/docs/search/criteria_reference/sectionid_criterion.md @@ -15,8 +15,8 @@ The [`SectionId` Search Criterion](/api/php_api/php_api_reference/classes/Ibexa- ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\SectionId(3); diff --git a/docs/search/criteria_reference/sectionidentifier_criterion.md b/docs/search/criteria_reference/sectionidentifier_criterion.md index 61ed688c17..e043a3ac82 100644 --- a/docs/search/criteria_reference/sectionidentifier_criterion.md +++ b/docs/search/criteria_reference/sectionidentifier_criterion.md @@ -15,8 +15,8 @@ The [`SectionIdentifier` Search Criterion](/api/php_api/php_api_reference/classe ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\SectionIdentifier(['sports', 'news']); diff --git a/docs/search/criteria_reference/selectionattribute_criterion.md b/docs/search/criteria_reference/selectionattribute_criterion.md index bd9c9bb956..de676a4c8f 100644 --- a/docs/search/criteria_reference/selectionattribute_criterion.md +++ b/docs/search/criteria_reference/selectionattribute_criterion.md @@ -16,8 +16,8 @@ The `SelectionAttribute` Search Criterion searches for products by the value of ### PHP ``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; $query = new ProductQuery( null, diff --git a/docs/search/criteria_reference/sibling_criterion.md b/docs/search/criteria_reference/sibling_criterion.md index 8907c56e15..e1504c979c 100644 --- a/docs/search/criteria_reference/sibling_criterion.md +++ b/docs/search/criteria_reference/sibling_criterion.md @@ -16,8 +16,8 @@ The [`Sibling` Search Criterion](/api/php_api/php_api_reference/classes/Ibexa-Co ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\Sibling(59, 2); @@ -26,8 +26,8 @@ $query->query = new Criterion\Sibling(59, 2); You can also use the named constructor `Criterion\Sibling::fromLocation` and provide it with the location object: ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); /** @var \Ibexa\Contracts\Core\Repository\LocationService $locationService */ diff --git a/docs/search/criteria_reference/simplemeasurementattribute_criterion.md b/docs/search/criteria_reference/simplemeasurementattribute_criterion.md index cd2f3096ad..7cd56eb2c3 100644 --- a/docs/search/criteria_reference/simplemeasurementattribute_criterion.md +++ b/docs/search/criteria_reference/simplemeasurementattribute_criterion.md @@ -16,8 +16,8 @@ The `SimpleMeasurementAttribute` Search Criterion searches for products by the v ### PHP ``` php -use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; +use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion; /** @var \Ibexa\Contracts\Measurement\MeasurementServiceInterface $measurementService */ $value = $measurementService->buildSimpleValue('length', 120, 'centimeter'); diff --git a/docs/search/criteria_reference/subtree_criterion.md b/docs/search/criteria_reference/subtree_criterion.md index 27ae7ff341..53d5fa7bb2 100644 --- a/docs/search/criteria_reference/subtree_criterion.md +++ b/docs/search/criteria_reference/subtree_criterion.md @@ -16,8 +16,8 @@ It returns the content item and all the content items below it in the subtree. ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\Subtree('/1/2/71/72/'); diff --git a/docs/search/criteria_reference/taxonomy_entry_id.md b/docs/search/criteria_reference/taxonomy_entry_id.md index 0bff4de06a..a87423cbe8 100644 --- a/docs/search/criteria_reference/taxonomy_entry_id.md +++ b/docs/search/criteria_reference/taxonomy_entry_id.md @@ -15,8 +15,8 @@ The [`TaxonomyEntryId` Search Criterion](/api/php_api/php_api_reference/classes/ ### PHP ``` php -use Ibexa\Contracts\Taxonomy\Search\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Taxonomy\Search\Query\Criterion; $query = new Query(); $query->query = new Criterion\TaxonomyEntryId(1); @@ -25,8 +25,8 @@ $query->query = new Criterion\TaxonomyEntryId(1); Add an array of ID's to find Content tagged with at least one of the tags (OR). ```php -use Ibexa\Contracts\Taxonomy\Search\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Taxonomy\Search\Query\Criterion; $query = new Query(); $query->query = new Criterion\TaxonomyEntryId([1, 2, 3]); diff --git a/docs/search/criteria_reference/useremail_criterion.md b/docs/search/criteria_reference/useremail_criterion.md index 0b16415ffe..9402e1c999 100644 --- a/docs/search/criteria_reference/useremail_criterion.md +++ b/docs/search/criteria_reference/useremail_criterion.md @@ -20,16 +20,16 @@ Solr search engine and Elasticsearch support IN and EQ operators only. ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\UserEmail(['johndoe']); ``` ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\UserEmail('nospam*', Criterion\Operator::LIKE); diff --git a/docs/search/criteria_reference/userid_criterion.md b/docs/search/criteria_reference/userid_criterion.md index 4dde3ff553..cfdf847d0f 100644 --- a/docs/search/criteria_reference/userid_criterion.md +++ b/docs/search/criteria_reference/userid_criterion.md @@ -15,8 +15,8 @@ The [`UserId` Search Criterion](/api/php_api/php_api_reference/classes/Ibexa-Con ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\UserId([14]); diff --git a/docs/search/criteria_reference/userlogin_criterion.md b/docs/search/criteria_reference/userlogin_criterion.md index 98fef8660b..74647dfbf1 100644 --- a/docs/search/criteria_reference/userlogin_criterion.md +++ b/docs/search/criteria_reference/userlogin_criterion.md @@ -20,16 +20,16 @@ Solr search engine and Elasticsearch support IN and EQ operators only. ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\UserLogin(['johndoe']); ``` ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\UserLogin('adm*', Criterion\Operator::LIKE); diff --git a/docs/search/criteria_reference/usermetadata_criterion.md b/docs/search/criteria_reference/usermetadata_criterion.md index 944307742a..6aabd01472 100644 --- a/docs/search/criteria_reference/usermetadata_criterion.md +++ b/docs/search/criteria_reference/usermetadata_criterion.md @@ -17,8 +17,8 @@ The [`UserMetadata` Search Criterion](/api/php_api/php_api_reference/classes/Ibe ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\UserMetadata(Criterion\UserMetadata::GROUP, Criterion\Operator::EQ, 12); @@ -60,18 +60,18 @@ $query->query = new Criterion\UserMetadata(Criterion\UserMetadata::GROUP, Criter You can use the `UserMetadata` Criterion to search for blog posts created by the Contributor user group: -``` php hl_lines="7" +``` php hl_lines="10" // ID of your custom Contributor User Group -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; -use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $contributorGroupId = 32; -$query = new LocationQuery; -$query->query = new Criterion\LogicalAnd([ +$query = new LocationQuery(); +$query->query = new Criterion\LogicalAnd( + [ new Criterion\ContentTypeIdentifier('blog_post'), - new Criterion\UserMetadata(Criterion\UserMetadata::GROUP, Criterion\Operator::EQ, $contributorGroupId) + new Criterion\UserMetadata(Criterion\UserMetadata::GROUP, Criterion\Operator::EQ, $contributorGroupId), ] ); ``` diff --git a/docs/search/criteria_reference/visibility_criterion.md b/docs/search/criteria_reference/visibility_criterion.md index cb0eb92ef7..86a4829471 100644 --- a/docs/search/criteria_reference/visibility_criterion.md +++ b/docs/search/criteria_reference/visibility_criterion.md @@ -21,8 +21,8 @@ Use Location Search to avoid this. ### PHP ``` php -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; $query = new Query(); $query->query = new Criterion\Visibility(Criterion\Visibility::HIDDEN); diff --git a/docs/search/sort_clause_reference/baseprice_sort_clause.md b/docs/search/sort_clause_reference/baseprice_sort_clause.md index 1ed04f2103..b19edc4e07 100644 --- a/docs/search/sort_clause_reference/baseprice_sort_clause.md +++ b/docs/search/sort_clause_reference/baseprice_sort_clause.md @@ -26,7 +26,7 @@ $sortClauses = [ new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\BasePrice( $currency, ProductQuery::SORT_ASC - ) + ), ]; $productQuery = new ProductQuery(null, null, $sortClauses); ``` diff --git a/docs/search/sort_clause_reference/contentid_sort_clause.md b/docs/search/sort_clause_reference/contentid_sort_clause.md index 6a561e0259..e41e3f3bfd 100644 --- a/docs/search/sort_clause_reference/contentid_sort_clause.md +++ b/docs/search/sort_clause_reference/contentid_sort_clause.md @@ -16,7 +16,6 @@ The [`ContentId` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-Contr use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - $query = new LocationQuery(); $query->sortClauses = [new SortClause\ContentId()]; ``` diff --git a/docs/search/sort_clause_reference/contentname_sort_clause.md b/docs/search/sort_clause_reference/contentname_sort_clause.md index 9aa6664be3..51fd8ceee3 100644 --- a/docs/search/sort_clause_reference/contentname_sort_clause.md +++ b/docs/search/sort_clause_reference/contentname_sort_clause.md @@ -16,7 +16,6 @@ The [`ContentName` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-Con use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - $query = new LocationQuery(); $query->sortClauses = [new SortClause\ContentName()]; ``` diff --git a/docs/search/sort_clause_reference/contenttranslatedname_sort_clause.md b/docs/search/sort_clause_reference/contenttranslatedname_sort_clause.md index 964205d882..317de17705 100644 --- a/docs/search/sort_clause_reference/contenttranslatedname_sort_clause.md +++ b/docs/search/sort_clause_reference/contenttranslatedname_sort_clause.md @@ -20,7 +20,6 @@ The `ContentTranslatedName` Sort Clause isn't available in [Repository filtering use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - $query = new LocationQuery(); $query->sortClauses = [new SortClause\ContentTranslatedName()]; ``` diff --git a/docs/search/sort_clause_reference/contenttypename_sort_clause.md b/docs/search/sort_clause_reference/contenttypename_sort_clause.md index da0cf84919..80d031a018 100644 --- a/docs/search/sort_clause_reference/contenttypename_sort_clause.md +++ b/docs/search/sort_clause_reference/contenttypename_sort_clause.md @@ -16,7 +16,6 @@ The [`ContentTypeName` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa use Ibexa\Contracts\Core\Repository\Values\Content\Query; use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - $query = new Query(); $query->sortClauses = [new SortClause\Trash\ContentTypeName()]; ``` diff --git a/docs/search/sort_clause_reference/createdat_sort_clause.md b/docs/search/sort_clause_reference/createdat_sort_clause.md index 8e1f8e7b77..f68a4944fa 100644 --- a/docs/search/sort_clause_reference/createdat_sort_clause.md +++ b/docs/search/sort_clause_reference/createdat_sort_clause.md @@ -15,13 +15,13 @@ The `CreatedAt` Sort Clause sorts search results by the date and time of the cre ``` php use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; - $productQuery = new ProductQuery( null, null, [ new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\CreatedAt( - \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\CreatedAt::SORT_ASC) + \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\CreatedAt::SORT_ASC + ), ] ); ``` diff --git a/docs/search/sort_clause_reference/customfield_sort_clause.md b/docs/search/sort_clause_reference/customfield_sort_clause.md index 7e78824330..64e8602e17 100644 --- a/docs/search/sort_clause_reference/customfield_sort_clause.md +++ b/docs/search/sort_clause_reference/customfield_sort_clause.md @@ -26,7 +26,6 @@ The `CustomField` Sort Clause isn't available in [Repository filtering](search_a use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - $query = new LocationQuery(); $query->sortClauses = [new SortClause\CustomField('my_custom_field_s')]; ``` diff --git a/docs/search/sort_clause_reference/customprice_sort_clause.md b/docs/search/sort_clause_reference/customprice_sort_clause.md index 68d22f625b..1e03c725f9 100644 --- a/docs/search/sort_clause_reference/customprice_sort_clause.md +++ b/docs/search/sort_clause_reference/customprice_sort_clause.md @@ -29,8 +29,9 @@ use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; $sortClauses = [ new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\CustomPrice( $currency, - ProductQuery::SORT_ASC, $customerGroup - ) + ProductQuery::SORT_ASC, + $customerGroup + ), ]; $productQuery = new ProductQuery(null, null, $sortClauses); ``` diff --git a/docs/search/sort_clause_reference/datemodified_sort_clause.md b/docs/search/sort_clause_reference/datemodified_sort_clause.md index a65ee456b2..a626be31a2 100644 --- a/docs/search/sort_clause_reference/datemodified_sort_clause.md +++ b/docs/search/sort_clause_reference/datemodified_sort_clause.md @@ -16,7 +16,6 @@ The [`DateModified` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-Co use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - $query = new LocationQuery(); $query->sortClauses = [new SortClause\DateModified()]; ``` diff --git a/docs/search/sort_clause_reference/datepublished_sort_clause.md b/docs/search/sort_clause_reference/datepublished_sort_clause.md index 5061595390..92a25e1f6e 100644 --- a/docs/search/sort_clause_reference/datepublished_sort_clause.md +++ b/docs/search/sort_clause_reference/datepublished_sort_clause.md @@ -16,7 +16,6 @@ The [`DatePublished` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-C use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - $query = new LocationQuery(); $query->sortClauses = [new SortClause\DatePublished()]; ``` diff --git a/docs/search/sort_clause_reference/datetrashed_sort_clause.md b/docs/search/sort_clause_reference/datetrashed_sort_clause.md index f43d867f6d..4bfa6d9e41 100644 --- a/docs/search/sort_clause_reference/datetrashed_sort_clause.md +++ b/docs/search/sort_clause_reference/datetrashed_sort_clause.md @@ -16,7 +16,6 @@ The [`DateTrashed` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-Con use Ibexa\Contracts\Core\Repository\Values\Content\Query; use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - $query = new Query(); $query->sortClauses = [new SortClause\Trash\DateTrashed()]; ``` diff --git a/docs/search/sort_clause_reference/field_sort_clause.md b/docs/search/sort_clause_reference/field_sort_clause.md index a636bff689..b32776ee18 100644 --- a/docs/search/sort_clause_reference/field_sort_clause.md +++ b/docs/search/sort_clause_reference/field_sort_clause.md @@ -24,7 +24,6 @@ The `Field` Sort Clause isn't available in [Repository filtering](search_api.md# use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - $query = new LocationQuery(); $query->sortClauses = [new SortClause\Field('article', 'title')]; ``` diff --git a/docs/search/sort_clause_reference/maplocationdistance_sort_clause.md b/docs/search/sort_clause_reference/maplocationdistance_sort_clause.md index 8ffa84335a..6ed59fd571 100644 --- a/docs/search/sort_clause_reference/maplocationdistance_sort_clause.md +++ b/docs/search/sort_clause_reference/maplocationdistance_sort_clause.md @@ -23,7 +23,6 @@ The `MapLocationDistance` Sort Clause isn't available in [Repository filtering]( use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - $query = new LocationQuery(); $query->sortClauses = [new SortClause\MapLocationDistance('place', 'location', 49.542889, 20.111349)]; ``` diff --git a/docs/search/sort_clause_reference/order_created_sort_clause.md b/docs/search/sort_clause_reference/order_created_sort_clause.md index c3a8f435b9..20a3a1f8c2 100644 --- a/docs/search/sort_clause_reference/order_created_sort_clause.md +++ b/docs/search/sort_clause_reference/order_created_sort_clause.md @@ -22,7 +22,8 @@ $orderQuery = new OrderQuery( $criteria, [ new \Ibexa\Contracts\OrderManagement\Value\Order\Query\SortClause\Created( - \Ibexa\Contracts\OrderManagement\Value\Order\Query\SortClause\Created::SORT_ASC) + \Ibexa\Contracts\OrderManagement\Value\Order\Query\SortClause\Created::SORT_ASC + ), ] ); ``` diff --git a/docs/search/sort_clause_reference/order_id_sort_clause.md b/docs/search/sort_clause_reference/order_id_sort_clause.md index a6e23651e1..74db82f0b9 100644 --- a/docs/search/sort_clause_reference/order_id_sort_clause.md +++ b/docs/search/sort_clause_reference/order_id_sort_clause.md @@ -22,7 +22,8 @@ $orderQuery = new OrderQuery( $criteria, [ new \Ibexa\Contracts\OrderManagement\Value\Order\Query\SortClause\Id( - \Ibexa\Contracts\OrderManagement\Value\Order\Query\SortClause\Id::SORT_ASC) + \Ibexa\Contracts\OrderManagement\Value\Order\Query\SortClause\Id::SORT_ASC + ), ] ); ``` diff --git a/docs/search/sort_clause_reference/order_status_sort_clause.md b/docs/search/sort_clause_reference/order_status_sort_clause.md index 3187c4deb8..3173d9bf18 100644 --- a/docs/search/sort_clause_reference/order_status_sort_clause.md +++ b/docs/search/sort_clause_reference/order_status_sort_clause.md @@ -22,7 +22,8 @@ $orderQuery = new OrderQuery( $criteria, [ new \Ibexa\Contracts\OrderManagement\Value\Order\Query\SortClause\Status( - \Ibexa\Contracts\OrderManagement\Value\Order\Query\SortClause\Status::SORT_ASC) + \Ibexa\Contracts\OrderManagement\Value\Order\Query\SortClause\Status::SORT_ASC + ), ] ); ``` diff --git a/docs/search/sort_clause_reference/order_updated_sort_clause.md b/docs/search/sort_clause_reference/order_updated_sort_clause.md index f83d526852..87a3a63d8c 100644 --- a/docs/search/sort_clause_reference/order_updated_sort_clause.md +++ b/docs/search/sort_clause_reference/order_updated_sort_clause.md @@ -22,7 +22,8 @@ $orderQuery = new OrderQuery( $criteria, [ new \Ibexa\Contracts\OrderManagement\Value\Order\Query\SortClause\Updated( - \Ibexa\Contracts\OrderManagement\Value\Order\Query\SortClause\Updated::SORT_ASC) + \Ibexa\Contracts\OrderManagement\Value\Order\Query\SortClause\Updated::SORT_ASC + ), ] ); ``` diff --git a/docs/search/sort_clause_reference/path_sort_clause.md b/docs/search/sort_clause_reference/path_sort_clause.md index bd1c1d509e..ba5812567b 100644 --- a/docs/search/sort_clause_reference/path_sort_clause.md +++ b/docs/search/sort_clause_reference/path_sort_clause.md @@ -20,7 +20,6 @@ The [`Location\Path` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-C use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - $query = new LocationQuery(); $query->sortClauses = [new SortClause\Location\Path()]; ``` diff --git a/docs/search/sort_clause_reference/payment_createdat_sort_clause.md b/docs/search/sort_clause_reference/payment_createdat_sort_clause.md index f1ba6e0f9f..5c9c6572bc 100644 --- a/docs/search/sort_clause_reference/payment_createdat_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_createdat_sort_clause.md @@ -22,7 +22,8 @@ $paymentQuery = new PaymentQuery( $criteria, [ new \Ibexa\Contracts\Payment\Payment\Query\SortClause\CreatedAt( - \Ibexa\Contracts\Payment\Payment\Query\SortClause\CreatedAt::SORT_ASC) + \Ibexa\Contracts\Payment\Payment\Query\SortClause\CreatedAt::SORT_ASC + ), ] ); ``` diff --git a/docs/search/sort_clause_reference/payment_id_sort_clause.md b/docs/search/sort_clause_reference/payment_id_sort_clause.md index 56b3c572c9..b1ae85c22f 100644 --- a/docs/search/sort_clause_reference/payment_id_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_id_sort_clause.md @@ -22,7 +22,8 @@ $paymentQuery = new PaymentQuery( $criteria, [ new \Ibexa\Contracts\Payment\Payment\Query\SortClause\Id( - \Ibexa\Contracts\Payment\Payment\Query\SortClause\Id::SORT_ASC) + \Ibexa\Contracts\Payment\Payment\Query\SortClause\Id::SORT_ASC + ), ] ); ``` diff --git a/docs/search/sort_clause_reference/payment_identifier_sort_clause.md b/docs/search/sort_clause_reference/payment_identifier_sort_clause.md index 37dba9f724..9eb188771b 100644 --- a/docs/search/sort_clause_reference/payment_identifier_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_identifier_sort_clause.md @@ -22,7 +22,8 @@ $paymentQuery = new PaymentQuery( $criteria, [ new \Ibexa\Contracts\Payment\Payment\Query\SortClause\Identifier( - \Ibexa\Contracts\Payment\Payment\Query\SortClause\Identifier::SORT_ASC) + \Ibexa\Contracts\Payment\Payment\Query\SortClause\Identifier::SORT_ASC + ), ] ); ``` diff --git a/docs/search/sort_clause_reference/payment_method_createdat_sort_clause.md b/docs/search/sort_clause_reference/payment_method_createdat_sort_clause.md index 1767f22202..e9b386d399 100644 --- a/docs/search/sort_clause_reference/payment_method_createdat_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_method_createdat_sort_clause.md @@ -22,7 +22,8 @@ $paymentMethodQuery = new PaymentMethodQuery( $criteria, [ new \Ibexa\Contracts\Payment\PaymentMethod\Query\SortClause\CreatedAt( - \Ibexa\Contracts\Payment\PaymentMethod\Query\SortClause\CreatedAt::SORT_ASC) + \Ibexa\Contracts\Payment\PaymentMethod\Query\SortClause\CreatedAt::SORT_ASC + ), ] ); ``` diff --git a/docs/search/sort_clause_reference/payment_method_enabled_sort_clause.md b/docs/search/sort_clause_reference/payment_method_enabled_sort_clause.md index aee9bbdf92..85e7f6e3e3 100644 --- a/docs/search/sort_clause_reference/payment_method_enabled_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_method_enabled_sort_clause.md @@ -22,7 +22,8 @@ $paymentMethodQuery = new PaymentMethodQuery( $criteria, [ new \Ibexa\Contracts\Payment\PaymentMethod\Query\SortClause\Enabled( - \Ibexa\Contracts\Payment\PaymentMethod\Query\SortClause\Enabled::SORT_DESC) + \Ibexa\Contracts\Payment\PaymentMethod\Query\SortClause\Enabled::SORT_DESC + ), ] ); ``` diff --git a/docs/search/sort_clause_reference/payment_method_id_sort_clause.md b/docs/search/sort_clause_reference/payment_method_id_sort_clause.md index fe3e7b7a7b..5173b48c3e 100644 --- a/docs/search/sort_clause_reference/payment_method_id_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_method_id_sort_clause.md @@ -22,7 +22,8 @@ $paymentMethodQuery = new PaymentMethodQuery( $criteria, [ new \Ibexa\Contracts\Payment\PaymentMethod\Query\SortClause\Id( - \Ibexa\Contracts\Payment\PaymentMethod\Query\SortClause\Id::SORT_ASC) + \Ibexa\Contracts\Payment\PaymentMethod\Query\SortClause\Id::SORT_ASC + ), ] ); ``` diff --git a/docs/search/sort_clause_reference/payment_method_identifier_sort_clause.md b/docs/search/sort_clause_reference/payment_method_identifier_sort_clause.md index 998bd403af..8a70fd9bd2 100644 --- a/docs/search/sort_clause_reference/payment_method_identifier_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_method_identifier_sort_clause.md @@ -22,7 +22,8 @@ $paymentMethodQuery = new PaymentMethodQuery( $criteria, [ new \Ibexa\Contracts\Payment\PaymentMethod\Query\SortClause\Identifier( - \Ibexa\Contracts\Payment\PaymentMethod\Query\SortClause\Identifier::SORT_ASC) + \Ibexa\Contracts\Payment\PaymentMethod\Query\SortClause\Identifier::SORT_ASC + ), ] ); ``` diff --git a/docs/search/sort_clause_reference/payment_method_updatedat_sort_clause.md b/docs/search/sort_clause_reference/payment_method_updatedat_sort_clause.md index 57f8698de2..da117cf6c3 100644 --- a/docs/search/sort_clause_reference/payment_method_updatedat_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_method_updatedat_sort_clause.md @@ -22,7 +22,8 @@ $paymentMethodQuery = new PaymentMethodQuery( $criteria, [ new \Ibexa\Contracts\Payment\PaymentMethod\Query\SortClause\UpdatedAt( - \Ibexa\Contracts\Payment\PaymentMethod\Query\SortClause\UpdatedAt::SORT_DESC) + \Ibexa\Contracts\Payment\PaymentMethod\Query\SortClause\UpdatedAt::SORT_DESC + ), ] ); ``` diff --git a/docs/search/sort_clause_reference/payment_status_sort_clause.md b/docs/search/sort_clause_reference/payment_status_sort_clause.md index f8547efaf5..d7f805f524 100644 --- a/docs/search/sort_clause_reference/payment_status_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_status_sort_clause.md @@ -22,7 +22,8 @@ $paymentQuery = new PaymentQuery( $criteria, [ new \Ibexa\Contracts\Payment\Payment\Query\SortClause\Status( - \Ibexa\Contracts\Payment\Payment\Query\SortClause\Status::SORT_ASC) + \Ibexa\Contracts\Payment\Payment\Query\SortClause\Status::SORT_ASC + ), ] ); ``` diff --git a/docs/search/sort_clause_reference/payment_updatedat_sort_clause.md b/docs/search/sort_clause_reference/payment_updatedat_sort_clause.md index 542c231222..344505ba41 100644 --- a/docs/search/sort_clause_reference/payment_updatedat_sort_clause.md +++ b/docs/search/sort_clause_reference/payment_updatedat_sort_clause.md @@ -22,7 +22,8 @@ $paymentQuery = new PaymentQuery( $criteria, [ new \Ibexa\Contracts\Payment\Payment\Query\SortClause\UpdatedAt( - \Ibexa\Contracts\Payment\Payment\Query\SortClause\UpdatedAt::SORT_ASC) + \Ibexa\Contracts\Payment\Payment\Query\SortClause\UpdatedAt::SORT_ASC + ), ] ); ``` diff --git a/docs/search/sort_clause_reference/priority_sort_clause.md b/docs/search/sort_clause_reference/priority_sort_clause.md index 4f87576024..d1eec92ae0 100644 --- a/docs/search/sort_clause_reference/priority_sort_clause.md +++ b/docs/search/sort_clause_reference/priority_sort_clause.md @@ -16,7 +16,6 @@ The [`Location\Priority` Sort Clause](/api/php_api/php_api_reference/classes/Ibe use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - $query = new LocationQuery(); $query->sortClauses = [new SortClause\Location\Priority()]; ``` diff --git a/docs/search/sort_clause_reference/productavailability_sort_clause.md b/docs/search/sort_clause_reference/productavailability_sort_clause.md index 037fbf6e6d..9ef70c1406 100644 --- a/docs/search/sort_clause_reference/productavailability_sort_clause.md +++ b/docs/search/sort_clause_reference/productavailability_sort_clause.md @@ -15,12 +15,11 @@ The `ProductAvailability` Sort Clause sorts search results by whether they have ``` php use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; - $query = new ProductQuery( null, null, [ - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\ProductAvailability() + new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\ProductAvailability(), ] ); ``` diff --git a/docs/search/sort_clause_reference/productcode_sort_clause.md b/docs/search/sort_clause_reference/productcode_sort_clause.md index 7fa840812c..8b20582234 100644 --- a/docs/search/sort_clause_reference/productcode_sort_clause.md +++ b/docs/search/sort_clause_reference/productcode_sort_clause.md @@ -15,12 +15,11 @@ The `ProductCode` Sort Clause sorts search results by the product code. ``` php use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; - $query = new ProductQuery( null, null, [ - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\ProductCode() + new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\ProductCode(), ] ); ``` diff --git a/docs/search/sort_clause_reference/productname_sort_clause.md b/docs/search/sort_clause_reference/productname_sort_clause.md index 99ff71ee2a..a7f8b4c3cd 100644 --- a/docs/search/sort_clause_reference/productname_sort_clause.md +++ b/docs/search/sort_clause_reference/productname_sort_clause.md @@ -15,12 +15,11 @@ The `ProductName` Sort Clause sorts search results by the Product code. ``` php use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery; - $query = new ProductQuery( null, null, [ - new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\ProductName() + new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\ProductName(), ] ); ``` diff --git a/docs/search/sort_clause_reference/random_sort_clause.md b/docs/search/sort_clause_reference/random_sort_clause.md index 4e8eaf038d..a8963b33e6 100644 --- a/docs/search/sort_clause_reference/random_sort_clause.md +++ b/docs/search/sort_clause_reference/random_sort_clause.md @@ -22,7 +22,6 @@ In Elasticsearch engine, you cannot combine the `Random` Sort Clause with any ot use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - $query = new LocationQuery(); $query->sortClauses = [new SortClause\Random()]; ``` diff --git a/docs/search/sort_clause_reference/score_sort_clause.md b/docs/search/sort_clause_reference/score_sort_clause.md index 99a24fbbe0..39215791c2 100644 --- a/docs/search/sort_clause_reference/score_sort_clause.md +++ b/docs/search/sort_clause_reference/score_sort_clause.md @@ -20,7 +20,6 @@ The `Score` Sort Clause isn't available in [Repository filtering](search_api.md# use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - $query = new LocationQuery(); $query->sortClauses = [new SortClause\Score()]; ``` diff --git a/docs/search/sort_clause_reference/sectionidentifier_sort_clause.md b/docs/search/sort_clause_reference/sectionidentifier_sort_clause.md index 9fd1018f5e..3a11bc14e6 100644 --- a/docs/search/sort_clause_reference/sectionidentifier_sort_clause.md +++ b/docs/search/sort_clause_reference/sectionidentifier_sort_clause.md @@ -20,7 +20,6 @@ The [`SectionIdentifier` Sort Clause](/api/php_api/php_api_reference/classes/Ibe use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - $query = new LocationQuery(); $query->sortClauses = [new SortClause\SectionIdentifier()]; ``` diff --git a/docs/search/sort_clause_reference/sectionname_sort_clause.md b/docs/search/sort_clause_reference/sectionname_sort_clause.md index f7e15b3294..3abdd458e1 100644 --- a/docs/search/sort_clause_reference/sectionname_sort_clause.md +++ b/docs/search/sort_clause_reference/sectionname_sort_clause.md @@ -16,7 +16,6 @@ The [`SectionName` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-Con use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - $query = new LocationQuery(); $query->sortClauses = [new SortClause\SectionName()]; ``` diff --git a/docs/search/sort_clause_reference/shipment_createdat_sort_clause.md b/docs/search/sort_clause_reference/shipment_createdat_sort_clause.md index 5124711d19..b8526a0aa2 100644 --- a/docs/search/sort_clause_reference/shipment_createdat_sort_clause.md +++ b/docs/search/sort_clause_reference/shipment_createdat_sort_clause.md @@ -21,7 +21,8 @@ $shipmentQuery = new ShipmentQuery( $criteria, [ new \Ibexa\Contracts\Shipping\Shipment\Query\SortClause\CreatedAt( - \Ibexa\Contracts\Shipping\Shipment\Query\SortClause\CreatedAt::SORT_ASC) + \Ibexa\Contracts\Shipping\Shipment\Query\SortClause\CreatedAt::SORT_ASC + ), ] ); ``` diff --git a/docs/search/sort_clause_reference/shipment_id_sort_clause.md b/docs/search/sort_clause_reference/shipment_id_sort_clause.md index 8e826e1609..55f63a6560 100644 --- a/docs/search/sort_clause_reference/shipment_id_sort_clause.md +++ b/docs/search/sort_clause_reference/shipment_id_sort_clause.md @@ -21,7 +21,8 @@ $shipmentQuery = new ShipmentQuery( $criteria, [ new \Ibexa\Contracts\Shipping\Shipment\Query\SortClause\Id( - \Ibexa\Contracts\Shipping\Shipment\Query\SortClause\Id::SORT_ASC) + \Ibexa\Contracts\Shipping\Shipment\Query\SortClause\Id::SORT_ASC + ), ] ); ``` diff --git a/docs/search/sort_clause_reference/shipment_identifier_sort_clause.md b/docs/search/sort_clause_reference/shipment_identifier_sort_clause.md index a25501de18..18a93a034e 100644 --- a/docs/search/sort_clause_reference/shipment_identifier_sort_clause.md +++ b/docs/search/sort_clause_reference/shipment_identifier_sort_clause.md @@ -21,7 +21,8 @@ $shipmentQuery = new ShipmentQuery( $criteria, [ new \Ibexa\Contracts\Shipping\Shipment\Query\SortClause\Identifier( - \Ibexa\Contracts\Shipping\Shipment\Query\SortClause\Identifier::SORT_ASC) + \Ibexa\Contracts\Shipping\Shipment\Query\SortClause\Identifier::SORT_ASC + ), ] ); ``` diff --git a/docs/search/sort_clause_reference/shipment_status_sort_clause.md b/docs/search/sort_clause_reference/shipment_status_sort_clause.md index 1478eef4d1..f4a48e908a 100644 --- a/docs/search/sort_clause_reference/shipment_status_sort_clause.md +++ b/docs/search/sort_clause_reference/shipment_status_sort_clause.md @@ -21,7 +21,8 @@ $shipmentQuery = new ShipmentQuery( $criteria, [ new \Ibexa\Contracts\Shipping\Shipment\Query\SortClause\Status( - \Ibexa\Contracts\Shipping\Shipment\Query\SortClause\Status::SORT_ASC) + \Ibexa\Contracts\Shipping\Shipment\Query\SortClause\Status::SORT_ASC + ), ] ); ``` diff --git a/docs/search/sort_clause_reference/shipment_updatedat_sort_clause.md b/docs/search/sort_clause_reference/shipment_updatedat_sort_clause.md index 4c54a15034..412a452113 100644 --- a/docs/search/sort_clause_reference/shipment_updatedat_sort_clause.md +++ b/docs/search/sort_clause_reference/shipment_updatedat_sort_clause.md @@ -21,7 +21,8 @@ $shipmentQuery = new ShipmentQuery( $criteria, [ new \Ibexa\Contracts\Shipping\Shipment\Query\SortClause\UpdatedAt( - \Ibexa\Contracts\Shipping\Shipment\Query\SortClause\UpdatedAt::SORT_ASC) + \Ibexa\Contracts\Shipping\Shipment\Query\SortClause\UpdatedAt::SORT_ASC + ), ] ); ``` diff --git a/docs/search/sort_clause_reference/userlogin_sort_clause.md b/docs/search/sort_clause_reference/userlogin_sort_clause.md index 2297368c57..0389b84134 100644 --- a/docs/search/sort_clause_reference/userlogin_sort_clause.md +++ b/docs/search/sort_clause_reference/userlogin_sort_clause.md @@ -16,7 +16,6 @@ The [`UserLogin` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-Contr use Ibexa\Contracts\Core\Repository\Values\Content\Query; use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - $query = new Query(); $query->sortClauses = [new SortClause\Trash\UserLogin()]; ``` diff --git a/docs/search/sort_clause_reference/visibility_sort_clause.md b/docs/search/sort_clause_reference/visibility_sort_clause.md index 210fc9f071..8ee670136b 100644 --- a/docs/search/sort_clause_reference/visibility_sort_clause.md +++ b/docs/search/sort_clause_reference/visibility_sort_clause.md @@ -18,7 +18,6 @@ Locations that aren't visible are ranked as higher values (for example, with asc use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause; - $query = new LocationQuery(); $query->sortClauses = [new SortClause\Location\Visibility()]; ``` diff --git a/docs/search/url_search_reference/id_url_sort_clause.md b/docs/search/url_search_reference/id_url_sort_clause.md index ba2420079e..6e21977453 100644 --- a/docs/search/url_search_reference/id_url_sort_clause.md +++ b/docs/search/url_search_reference/id_url_sort_clause.md @@ -13,8 +13,8 @@ The [`SortClause\Id` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa-C ## Example ``` php -use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; use Ibexa\Contracts\Core\Repository\Values\URL\Query\SortClause; +use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; // ... diff --git a/docs/search/url_search_reference/logicaland_url_criterion.md b/docs/search/url_search_reference/logicaland_url_criterion.md index 096d0b2b7c..c4b0e6a60f 100644 --- a/docs/search/url_search_reference/logicaland_url_criterion.md +++ b/docs/search/url_search_reference/logicaland_url_criterion.md @@ -20,7 +20,7 @@ $query = new URLQuery(); $query->filter = new Criterion\LogicalAnd( [ new Criterion\Validity(true), - new Criterion\Pattern('ibexa.co') + new Criterion\Pattern('ibexa.co'), ] ); ``` diff --git a/docs/search/url_search_reference/logicalnot_url_criterion.md b/docs/search/url_search_reference/logicalnot_url_criterion.md index c2c8886f84..eed8ab36a4 100644 --- a/docs/search/url_search_reference/logicalnot_url_criterion.md +++ b/docs/search/url_search_reference/logicalnot_url_criterion.md @@ -20,6 +20,6 @@ use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; $query = new URLQuery(); $query->filter = new Criterion\LogicalNot( - new Criterion\Pattern('ibexa.co') + new Criterion\Pattern('ibexa.co') ); ``` diff --git a/docs/search/url_search_reference/logicalor_url_criterion.md b/docs/search/url_search_reference/logicalor_url_criterion.md index 763f38d145..aef8778e22 100644 --- a/docs/search/url_search_reference/logicalor_url_criterion.md +++ b/docs/search/url_search_reference/logicalor_url_criterion.md @@ -20,7 +20,7 @@ $query = new URLQuery(); $query->filter = new Criterion\LogicalOr( [ new Criterion\SectionIdentifier(['sports', 'news']), - new Criterion\Pattern('ibexa.co') + new Criterion\Pattern('ibexa.co'), ] ); ``` diff --git a/docs/search/url_search_reference/url_url_sort_clause.md b/docs/search/url_search_reference/url_url_sort_clause.md index 100e56354a..4d6aa1f43e 100644 --- a/docs/search/url_search_reference/url_url_sort_clause.md +++ b/docs/search/url_search_reference/url_url_sort_clause.md @@ -13,8 +13,8 @@ The [`SortClause\Url` Sort Clause](/api/php_api/php_api_reference/classes/Ibexa- ## Example ``` php -use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; use Ibexa\Contracts\Core\Repository\Values\URL\Query\SortClause; +use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; // ... diff --git a/docs/templating/layout/add_login_form.md b/docs/templating/layout/add_login_form.md index d035abf03e..3e6e30e120 100644 --- a/docs/templating/layout/add_login_form.md +++ b/docs/templating/layout/add_login_form.md @@ -88,12 +88,12 @@ final class LoginFormViewSubscriber implements EventSubscriberInterface $view = $event->getContentView(); if (!($view instanceof LoginFormView)) { - return ; + return; } $view->addParameters([ 'foo' => 'foo', - 'bar' => 'bar' + 'bar' => 'bar', ]); if ($view->getLastAuthenticationException() instanceof CredentialsExpiredException) { diff --git a/docs/tutorials/beginner_tutorial/5_display_a_list_of_content_items.md b/docs/tutorials/beginner_tutorial/5_display_a_list_of_content_items.md index 6df4be0fdb..7713125f5d 100644 --- a/docs/tutorials/beginner_tutorial/5_display_a_list_of_content_items.md +++ b/docs/tutorials/beginner_tutorial/5_display_a_list_of_content_items.md @@ -82,7 +82,7 @@ class RideQueryType implements QueryType new Criterion\Visibility(Criterion\Visibility::VISIBLE), new Criterion\ContentTypeIdentifier(['ride']), ] - ) + ), ]); } diff --git a/docs/tutorials/beginner_tutorial/7_embed_content.md b/docs/tutorials/beginner_tutorial/7_embed_content.md index 2912636c24..f2483ff6fc 100644 --- a/docs/tutorials/beginner_tutorial/7_embed_content.md +++ b/docs/tutorials/beginner_tutorial/7_embed_content.md @@ -129,8 +129,8 @@ Create a `src/Controller/RideController.php` file: namespace App\Controller; use Ibexa\Bundle\Core\Controller; -use Ibexa\Core\MVC\Symfony\View\ContentView; use Ibexa\Contracts\Core\Repository\ContentService; +use Ibexa\Core\MVC\Symfony\View\ContentView; class RideController extends Controller { diff --git a/docs/update_and_migration/from_4.6/update_to_5.0.md b/docs/update_and_migration/from_4.6/update_to_5.0.md index b319fdc243..af9fcf329d 100644 --- a/docs/update_and_migration/from_4.6/update_to_5.0.md +++ b/docs/update_and_migration/from_4.6/update_to_5.0.md @@ -51,19 +51,19 @@ It's recommended to activate one rule set at a time and preview the output by ru Your configuration could look like the following example: ```php -use Rector\Config\RectorConfig; use Ibexa\Contracts\Rector\Sets\IbexaSetList; +use Rector\Config\RectorConfig; return RectorConfig::configure() ->withPaths( - [ + [ __DIR__ . '/src', - ] + ] ) ->withSets( - [ + [ IbexaSetList::IBEXA_46->value, - ] + ] ) ->withPhpSets(php83: true) ->withComposerBased(symfony: true) @@ -468,8 +468,9 @@ As this update spans across a broad range of versions, multiple rules can be con //… use Ibexa\Contracts\Rector\Sets\IbexaSetList; use Rector\Config\RectorConfig; -use Rector\Symfony\Set\SymfonySetList; use Rector\Symfony\Set\SensiolabsSetList; +use Rector\Symfony\Set\SymfonySetList; + return RectorConfig::configure() // ... ->withSets( diff --git a/docs/users/user_authentication.md b/docs/users/user_authentication.md index ebbc2ec73b..da33ba3a24 100644 --- a/docs/users/user_authentication.md +++ b/docs/users/user_authentication.md @@ -76,8 +76,8 @@ Don't mix `MVCEvents::INTERACTIVE_LOGIN` event (specific to [[= product_name =]] namespace App\EventListener; -use Ibexa\Contracts\Core\Repository\UserService; use eIbexa\Core\MVC\Symfony\Event\InteractiveLoginEvent; +use Ibexa\Contracts\Core\Repository\UserService; use Ibexa\Core\MVC\Symfony\MVCEvents; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -96,7 +96,7 @@ class InteractiveLoginListener implements EventSubscriberInterface public static function getSubscribedEvents() { return [ - MVCEvents::INTERACTIVE_LOGIN => 'onInteractiveLogin' + MVCEvents::INTERACTIVE_LOGIN => 'onInteractiveLogin', ]; } @@ -104,7 +104,7 @@ class InteractiveLoginListener implements EventSubscriberInterface { // This loads a generic User and assigns it back to the event. // You may want to create Users here, or even load predefined Users depending on your own rules. - $event->setApiUser($this->userService->loadUserByLogin( 'lolautruche' )); + $event->setApiUser($this->userService->loadUserByLogin('lolautruche')); } } ``` From 33e01a11237773dd8742e9cd6e21b0327382330a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Sun, 17 May 2026 14:34:33 +0200 Subject: [PATCH 05/18] Added declare(strict_types=1) to extracted files --- .php-cs-fixer-factory.php | 7 +++---- .php-cs-fixer-inline.php | 9 ++++----- .php-cs-fixer.php | 4 +++- phpstan-baseline.neon | 2 +- tests/InlineSamples/InlinePhpSyncer.php | 22 ++++++++++++++++++++- tests/InlineSamples/InlinePhpSyncerTest.php | 15 ++++++++++++++ tests/InlineSamples/InlinePhpWriter.php | 12 ++++++++++- tests/InlineSamples/InlinePhpWriterTest.php | 18 +++++++++++++++++ 8 files changed, 76 insertions(+), 13 deletions(-) diff --git a/.php-cs-fixer-factory.php b/.php-cs-fixer-factory.php index 72a146b418..37d0c0807a 100644 --- a/.php-cs-fixer-factory.php +++ b/.php-cs-fixer-factory.php @@ -8,9 +8,8 @@ use Ibexa\CodeStyle\PhpCsFixer\InternalConfigFactory; -$configFactory = new InternalConfigFactory(); -$configFactory->withRules([ +$commonRules = [ 'header_comment' => false, -]); +]; -return $configFactory; +return [new InternalConfigFactory(), $commonRules]; diff --git a/.php-cs-fixer-inline.php b/.php-cs-fixer-inline.php index ced5007939..b30b9978a5 100644 --- a/.php-cs-fixer-inline.php +++ b/.php-cs-fixer-inline.php @@ -9,17 +9,16 @@ /** * PHP-CS-Fixer configuration for auto-generated inline snippets in code_samples/_inline_php/. * - * Builds on top of the main .php-cs-fixer.php configuration with additional - * rule overrides: + * Builds on top of the shared factory with additional rule overrides: * - psr_autoloading is disabled: snippet files are named line_N.php and do not * correspond to any class, so the filename≠class-name rule does not apply. */ -$configFactory = require __DIR__ . '/.php-cs-fixer-factory.php'; +[$configFactory, $commonRules] = require __DIR__ . '/.php-cs-fixer-factory.php'; -$configFactory->withRules([ +$configFactory->withRules(array_merge($commonRules, [ 'psr_autoloading' => false, 'AdamWojs/phpdoc_force_fqcn_fixer' => false, -]); +])); return $configFactory ->buildConfig() diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index b04adee758..9796c76101 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -6,7 +6,9 @@ */ declare(strict_types=1); -$configFactory = require __DIR__ . '/.php-cs-fixer-factory.php'; +[$configFactory, $commonRules] = require __DIR__ . '/.php-cs-fixer-factory.php'; + +$configFactory->withRules($commonRules); return $configFactory ->buildConfig() diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 6cc2fc3804..2df5ee9110 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -34,7 +34,7 @@ parameters: message: '#^Call to an undefined method Symfony\\Component\\Notifier\\Recipient\\RecipientInterface\:\:getUser\(\)\.$#' identifier: method.notFound count: 1 - path: code_samples/_inline_php/commerce/transactional_emails/extend_transactional_emails/line_83.php + path: code_samples/_inline_php/commerce/transactional_emails/extend_transactional_emails/line_80.php - message: '#^Property Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Content\:\:\$fields is not writable\.$#' diff --git a/tests/InlineSamples/InlinePhpSyncer.php b/tests/InlineSamples/InlinePhpSyncer.php index 69a818c9a6..67caef7012 100644 --- a/tests/InlineSamples/InlinePhpSyncer.php +++ b/tests/InlineSamples/InlinePhpSyncer.php @@ -164,7 +164,27 @@ private function applyToMarkdown(string $fixedBody, int $bodyLine, string $mdCon : $secondLine; $hadBlankAfterOpenTag = $secondLineStripped === ''; - $fixedBody = 'syncer->sync($phpFile, $md)); } + public function testSyncReturnsNullWhenDeclareSnippetIsUnchanged(): void + { + $md = "text\n\n```php\nbuildPhpFile('docs/test.md', $bodyLine, "syncer->sync($phpFile, $md)); + } + // ------------------------------------------------------------------------- // sync — body line out of range // ------------------------------------------------------------------------- @@ -360,6 +369,12 @@ public static function provideRoundtripCases(): iterable ['use B\\Foo;' . "\n" . 'use A\\Bar;' => 'use A\\Bar;' . "\n" . 'use B\\Foo;'], "use A\\Bar;\nuse B\\Foo;", ]; + + yield 'snippet with declare(strict_types=1), spacing fix' => [ + "text\n\n```php\n '$x = 1;'], + " @@ -32,7 +33,7 @@ final class InlinePhpWriter { public const string FILE_TEMPLATE = - "writer->build('docs/example.md', 5, '$x = 1;'); + self::assertStringStartsWith("writer->build('docs/api/example.md', 42, '$x = 1;'); @@ -169,5 +175,17 @@ public static function provideExactContent(): iterable " [ + 'docs/foo.md', 10, + " [ + 'docs/foo.md', 5, + "declare(strict_types=1);\n\$x = 1;", + '$x = 1;', + ]; } } From 168475584cfa6d7e8d6150da7c63c0480f045881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Sun, 17 May 2026 14:46:59 +0200 Subject: [PATCH 06/18] Use hash of file content for filenames --- phpstan-baseline.neon | 43 +++++++++++++------------ tests/InlineSamples/InlinePhpWriter.php | 2 +- tools/extract-inline-php.php | 11 +++++-- tools/sync-inline-php-to-markdown.php | 2 +- 4 files changed, 32 insertions(+), 26 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 2df5ee9110..1609962b03 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -4,127 +4,127 @@ parameters: message: '#^Offset ''acme'' does not exist on array\{alias\: string, storage\: array\{engine\: string, connection\: string, config\?\: array\\}, search\: array\{engine\: string, connection\: string\}, fields_groups\: array\{default\: string, list\: array\\}, options\: array\\}\.$#' identifier: offsetAccess.notFound count: 1 - path: code_samples/_inline_php/administration/configuration/repository_configuration/line_349.php + path: code_samples/_inline_php/administration/configuration/repository_configuration/f375c926bac1bea78d0a7c63103acbda9f06946b4c7c5afb0c8dcb2021dcff0d.php - message: '#^Dead catch \- Ibexa\\Contracts\\Core\\Repository\\Exceptions\\NotFoundException is never thrown in the try block\.$#' identifier: catch.neverThrown count: 1 - path: code_samples/_inline_php/api/php_api/php_api/line_154.php + path: code_samples/_inline_php/api/php_api/php_api/dd6676867249e539a49af9bbc5378daedf4d78d4f887c69d6ad7ccdf37122f12.php - message: '#^Dead catch \- Ibexa\\Contracts\\Core\\Repository\\Exceptions\\UnauthorizedException is never thrown in the try block\.$#' identifier: catch.neverThrown count: 1 - path: code_samples/_inline_php/api/php_api/php_api/line_154.php + path: code_samples/_inline_php/api/php_api/php_api/dd6676867249e539a49af9bbc5378daedf4d78d4f887c69d6ad7ccdf37122f12.php - message: '#^Instantiated class MyValue not found\.$#' identifier: class.notFound count: 1 - path: code_samples/_inline_php/api/rest_api/extending_rest_api/creating_new_rest_resource/line_72.php + path: code_samples/_inline_php/api/rest_api/extending_rest_api/creating_new_rest_resource/6886002ea53abecb63d61d585bc055fc9df36a19db675e286408a52f40aa794c.php - message: '#^Variable \$args might not be defined\.$#' identifier: variable.undefined count: 1 - path: code_samples/_inline_php/api/rest_api/extending_rest_api/creating_new_rest_resource/line_72.php + path: code_samples/_inline_php/api/rest_api/extending_rest_api/creating_new_rest_resource/6886002ea53abecb63d61d585bc055fc9df36a19db675e286408a52f40aa794c.php - message: '#^Call to an undefined method Symfony\\Component\\Notifier\\Recipient\\RecipientInterface\:\:getUser\(\)\.$#' identifier: method.notFound count: 1 - path: code_samples/_inline_php/commerce/transactional_emails/extend_transactional_emails/line_80.php + path: code_samples/_inline_php/commerce/transactional_emails/extend_transactional_emails/9512b966ae24a637ff0bba4d63a51f6418567d4c1245ea3d61272890838582a4.php - message: '#^Property Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Content\:\:\$fields is not writable\.$#' identifier: assign.propertyReadOnly count: 1 - path: code_samples/_inline_php/content_management/field_types/field_type_reference/countryfield/line_53.php + path: code_samples/_inline_php/content_management/field_types/field_type_reference/countryfield/3cd88088ebfaab6dc8aab79fd8d9e380586a05e9a250f208935020a274d6a77f.php - message: '#^Expression "\[''isISBN13'' \=\> \\true\]" on a separate line does not do anything\.$#' identifier: expr.resultUnused count: 1 - path: code_samples/_inline_php/content_management/field_types/field_type_reference/isbnfield/line_36.php + path: code_samples/_inline_php/content_management/field_types/field_type_reference/isbnfield/678db783359b1c65999e5fed725950d32aaab547ab82f6bda18afcafa3392e8b.php - message: '#^Expression "\[''StringLengthValidator'' \=\> \[''maxStringLength'' \=\> 60, ''minStringLength'' \=\> 1\]\]" on a separate line does not do anything\.$#' identifier: expr.resultUnused count: 1 - path: code_samples/_inline_php/content_management/field_types/field_type_reference/textlinefield/line_39.php + path: code_samples/_inline_php/content_management/field_types/field_type_reference/textlinefield/abeeb0a02156f9dd413b5f54292d97783f49043458623888d904267ffa60acde.php - message: '#^Expression "\[''stringLength'' \=\> \[''minStringLength'' \=\> \[''type'' \=\> ''int'', ''default'' \=\> 0\], ''maxStringLength'' \=\> \[''type'' \=\> ''int'', ''default'' \=\> \\null\]\]\]" on a separate line does not do anything\.$#' identifier: expr.resultUnused count: 1 - path: code_samples/_inline_php/content_management/field_types/field_type_validation/line_21.php + path: code_samples/_inline_php/content_management/field_types/field_type_validation/9ff627c9326c9d9aa0613061d4b96d5e0b22526a04e1c3cf6c671bdc73f537e7.php - message: '#^Expression "\[''backupData'' \=\> \[''type'' \=\> ''bool'', ''default'' \=\> \\false\], ''defaultValue'' \=\> \[''type'' \=\> ''string'', ''default'' \=\> ''Default Value''\]\]" on a separate line does not do anything\.$#' identifier: expr.resultUnused count: 1 - path: code_samples/_inline_php/content_management/field_types/type_and_value/line_172.php + path: code_samples/_inline_php/content_management/field_types/type_and_value/4d9e52e02d6e226f71015653d598f662f6b4d4eb0af9e99b4c49d5389af19671.php - message: '#^Call to an undefined method object\:\:loadObject\(\)\.$#' identifier: method.notFound count: 1 - path: code_samples/_inline_php/infrastructure_and_maintenance/cache/persistence_cache/line_267.php + path: code_samples/_inline_php/infrastructure_and_maintenance/cache/persistence_cache/a5a1471bf52540ef2e36019d8f4ea41327b7ee0283aff5caf8d85ddbeb903ba6.php - message: '#^Property App\\MyService\:\:\$contentService is never read, only written\.$#' identifier: property.onlyWritten count: 1 - path: code_samples/_inline_php/multisite/siteaccess/injecting_siteaccess/line_20.php + path: code_samples/_inline_php/multisite/siteaccess/injecting_siteaccess/bbeeb5ca5baf26ca0aa13685c4680362c490b7d114deec30014b2a4b2978a1f2.php - message: '#^Property App\\MyService\:\:\$siteAccessService is never read, only written\.$#' identifier: property.onlyWritten count: 1 - path: code_samples/_inline_php/multisite/siteaccess/injecting_siteaccess/line_20.php + path: code_samples/_inline_php/multisite/siteaccess/injecting_siteaccess/bbeeb5ca5baf26ca0aa13685c4680362c490b7d114deec30014b2a4b2978a1f2.php - message: '#^Method App\\QueryType\\RideQueryType\:\:getSupportedParameters\(\) return type has no value type specified in iterable type array\.$#' identifier: missingType.iterableValue count: 1 - path: code_samples/_inline_php/tutorials/beginner_tutorial/5_display_a_list_of_content_items/line_61.php + path: code_samples/_inline_php/tutorials/beginner_tutorial/5_display_a_list_of_content_items/ccb9d8424978af9df4ec24d732f91c6f7cab90b6879eecd0ea97fef21b833b3b.php - message: '#^Cannot access property \$destinationContentIds on Ibexa\\Contracts\\Core\\FieldType\\Value\|null\.$#' identifier: property.nonObject count: 1 - path: code_samples/_inline_php/tutorials/beginner_tutorial/7_embed_content/line_127.php + path: code_samples/_inline_php/tutorials/beginner_tutorial/7_embed_content/f94706cc49dde292703d524c7b07537449b65e58d081d075c1997f0e6e33d567.php - message: '#^Access to constant ANNOTATIONS_TO_ATTRIBUTES on an unknown class Rector\\Symfony\\Set\\SensiolabsSetList\.$#' identifier: class.notFound count: 1 - path: code_samples/_inline_php/update_and_migration/from_4.6/update_to_5.0/line_468.php + path: code_samples/_inline_php/update_and_migration/from_4.6/update_to_5.0/20a5c589183c1b8ee4f67c7a0c9352320eb7349e3f06f89c61e245ea4b7f585f.php - message: '#^Access to undefined constant Ibexa\\Core\\MVC\\Symfony\\MVCEvents\:\:INTERACTIVE_LOGIN\.$#' identifier: classConstant.notFound count: 1 - path: code_samples/_inline_php/users/user_authentication/line_75.php + path: code_samples/_inline_php/users/user_authentication/91c89a3c8487a5419d764ad793e216152abfd07c24a50bf96db22c4d53993e25.php - message: '#^Call to method setApiUser\(\) on an unknown class eIbexa\\Core\\MVC\\Symfony\\Event\\InteractiveLoginEvent\.$#' identifier: class.notFound count: 1 - path: code_samples/_inline_php/users/user_authentication/line_75.php + path: code_samples/_inline_php/users/user_authentication/91c89a3c8487a5419d764ad793e216152abfd07c24a50bf96db22c4d53993e25.php - message: '#^Method App\\EventListener\\InteractiveLoginListener\:\:onInteractiveLogin\(\) has no return type specified\.$#' identifier: missingType.return count: 1 - path: code_samples/_inline_php/users/user_authentication/line_75.php + path: code_samples/_inline_php/users/user_authentication/91c89a3c8487a5419d764ad793e216152abfd07c24a50bf96db22c4d53993e25.php - message: '#^Parameter \$event of method App\\EventListener\\InteractiveLoginListener\:\:onInteractiveLogin\(\) has invalid type eIbexa\\Core\\MVC\\Symfony\\Event\\InteractiveLoginEvent\.$#' identifier: class.notFound count: 1 - path: code_samples/_inline_php/users/user_authentication/line_75.php + path: code_samples/_inline_php/users/user_authentication/91c89a3c8487a5419d764ad793e216152abfd07c24a50bf96db22c4d53993e25.php - message: '#^Class App\\Form\\Type\\TextToTextOptionsType extends generic class Symfony\\Component\\Form\\AbstractType but does not specify its types\: TData$#' @@ -821,3 +821,4 @@ parameters: identifier: argument.type count: 1 path: code_samples/workflow/custom_workflow/src/EventListener/LegalTransitionListener.php + diff --git a/tests/InlineSamples/InlinePhpWriter.php b/tests/InlineSamples/InlinePhpWriter.php index 413d30073b..4bfe0062e9 100644 --- a/tests/InlineSamples/InlinePhpWriter.php +++ b/tests/InlineSamples/InlinePhpWriter.php @@ -20,7 +20,7 @@ * // Source: docs/path/to/file.md:LINE * // (auto-generated by tools/extract-inline-php.php — do not edit) * - * + * * * Important: the build($sourceRelPath, $line, $body)); ++$snippetCount; diff --git a/tools/sync-inline-php-to-markdown.php b/tools/sync-inline-php-to-markdown.php index eb8a9707ff..e10f2e8f93 100644 --- a/tools/sync-inline-php-to-markdown.php +++ b/tools/sync-inline-php-to-markdown.php @@ -10,7 +10,7 @@ * Syncs PHP-CS-Fixer-formatted inline snippets back to their source Markdown files. * * The extraction pipeline (tools/extract-inline-php.php) writes each inline PHP block - * to code_samples/_inline_php//line_N.php, prepending an auto-generated header: + * to code_samples/_inline_php//{sha256(body)}.php, prepending an auto-generated header. * * Date: Sun, 17 May 2026 14:54:37 +0200 Subject: [PATCH 07/18] fixup! Added declare(strict_types=1) to extracted files --- docs/multisite/siteaccess/injecting_siteaccess.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/multisite/siteaccess/injecting_siteaccess.md b/docs/multisite/siteaccess/injecting_siteaccess.md index 2b60d58ab1..9d1dfb9529 100644 --- a/docs/multisite/siteaccess/injecting_siteaccess.md +++ b/docs/multisite/siteaccess/injecting_siteaccess.md @@ -17,6 +17,8 @@ services: ``` ``` php + Date: Sun, 17 May 2026 14:54:42 +0200 Subject: [PATCH 08/18] fixup! Added declare(strict_types=1) to extracted files --- tests/InlineSamples/InlinePhpSyncer.php | 3 ++- tests/InlineSamples/InlinePhpSyncerTest.php | 10 ++++++---- tests/InlineSamples/InlinePhpWriter.php | 2 +- tests/InlineSamples/InlinePhpWriterTest.php | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/InlineSamples/InlinePhpSyncer.php b/tests/InlineSamples/InlinePhpSyncer.php index 67caef7012..224d58a4e9 100644 --- a/tests/InlineSamples/InlinePhpSyncer.php +++ b/tests/InlineSamples/InlinePhpSyncer.php @@ -180,7 +180,8 @@ private function applyToMarkdown(string $fixedBody, int $bodyLine, string $mdCon $prefix = 'buildPhpFile('docs/test.md', $bodyLine, "buildPhpFile('docs/test.md', $bodyLine, "syncer->sync($phpFile, $md)); } @@ -371,9 +373,9 @@ public static function provideRoundtripCases(): iterable ]; yield 'snippet with declare(strict_types=1), spacing fix' => [ - "text\n\n```php\n '$x = 1;'], - "writer->build('docs/example.md', 5, '$x = 1;'); - self::assertStringStartsWith(" Date: Sun, 17 May 2026 14:57:47 +0200 Subject: [PATCH 09/18] fixup! Added declare(strict_types=1) to extracted files --- tests/InlineSamples/InlinePhpSyncer.php | 4 ++-- tests/InlineSamples/InlinePhpWriter.php | 5 ++++- tests/InlineSamples/InlinePhpWriterTest.php | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/InlineSamples/InlinePhpSyncer.php b/tests/InlineSamples/InlinePhpSyncer.php index 224d58a4e9..92c426d707 100644 --- a/tests/InlineSamples/InlinePhpSyncer.php +++ b/tests/InlineSamples/InlinePhpSyncer.php @@ -180,8 +180,8 @@ private function applyToMarkdown(string $fixedBody, int $bodyLine, string $mdCon $prefix = ' [ 'docs/foo.md', 10, " [ From 9150572a62c11000803271186fbcae675ce66175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Sun, 17 May 2026 15:00:35 +0200 Subject: [PATCH 10/18] fixup! Use hash of file content for filenames --- phpstan-baseline.neon | 4 ++-- phpstan.neon | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 1609962b03..864b4923f2 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -76,13 +76,13 @@ parameters: message: '#^Property App\\MyService\:\:\$contentService is never read, only written\.$#' identifier: property.onlyWritten count: 1 - path: code_samples/_inline_php/multisite/siteaccess/injecting_siteaccess/bbeeb5ca5baf26ca0aa13685c4680362c490b7d114deec30014b2a4b2978a1f2.php + path: code_samples/_inline_php/multisite/siteaccess/injecting_siteaccess/cb7d390849731a90746ee24236ea392043611c515c68c64bb2697336bca76b51.php - message: '#^Property App\\MyService\:\:\$siteAccessService is never read, only written\.$#' identifier: property.onlyWritten count: 1 - path: code_samples/_inline_php/multisite/siteaccess/injecting_siteaccess/bbeeb5ca5baf26ca0aa13685c4680362c490b7d114deec30014b2a4b2978a1f2.php + path: code_samples/_inline_php/multisite/siteaccess/injecting_siteaccess/cb7d390849731a90746ee24236ea392043611c515c68c64bb2697336bca76b51.php - message: '#^Method App\\QueryType\\RideQueryType\:\:getSupportedParameters\(\) return type has no value type specified in iterable type array\.$#' diff --git a/phpstan.neon b/phpstan.neon index def4a36323..3b3b56df27 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -8,3 +8,4 @@ parameters: paths: - code_samples treatPhpDocTypesAsCertain: false + reportUnmatchedIgnoredErrors: false From 00f5fbaac1455f7ed74e9968d03f0610fc614f39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Sun, 17 May 2026 15:06:19 +0200 Subject: [PATCH 11/18] Run Rector --- .../formatting_date_and_time.md | 9 +------ .../back_office/browser/browser.md | 2 +- .../configuration/dynamic_configuration.md | 8 +------ .../configuration/repository_configuration.md | 2 +- docs/api/php_api/php_api.md | 8 +++---- .../cache/persistence_cache.md | 2 +- .../languages/back_office_translations.md | 7 ++---- .../siteaccess/injecting_siteaccess.md | 12 ++-------- .../beginner_tutorial/7_embed_content.md | 5 +--- docs/users/user_authentication.md | 10 ++------ tests/InlineSamples/InlinePhpSyncer.php | 23 +++++++++--------- tests/InlineSamples/InlinePhpSyncerTest.php | 24 +++++++++++++++++++ 12 files changed, 51 insertions(+), 61 deletions(-) diff --git a/docs/administration/back_office/back_office_elements/formatting_date_and_time.md b/docs/administration/back_office/back_office_elements/formatting_date_and_time.md index 56ed659966..a1377914fa 100644 --- a/docs/administration/back_office/back_office_elements/formatting_date_and_time.md +++ b/docs/administration/back_office/back_office_elements/formatting_date_and_time.md @@ -28,16 +28,9 @@ use Ibexa\User\UserSetting\DateTimeFormat\FormatterInterface; class MyService { - /** @var \Ibexa\User\UserSetting\DateTimeFormat\FormatterInterface */ - private $shortDateTimeFormatter; - - public function __construct(FormatterInterface $shortDateTimeFormatter) + public function __construct(private readonly FormatterInterface $shortDateTimeFormatter) { // your code - - $this->shortDateTimeFormatter = $shortDateTimeFormatter; - - // your code } public function foo(): void diff --git a/docs/administration/back_office/browser/browser.md b/docs/administration/back_office/browser/browser.md index 18fdcdb611..eee49198ca 100644 --- a/docs/administration/back_office/browser/browser.md +++ b/docs/administration/back_office/browser/browser.md @@ -154,7 +154,7 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; class JohnDoeCanSelectMore implements EventSubscriberInterface { - private const CONFIGURATION_NAME = 'my_custom_udw'; + private const string CONFIGURATION_NAME = 'my_custom_udw'; /** * Returns an array of event names this subscriber wants to listen to. diff --git a/docs/administration/configuration/dynamic_configuration.md b/docs/administration/configuration/dynamic_configuration.md index e0688ac0b3..f30432a59f 100644 --- a/docs/administration/configuration/dynamic_configuration.md +++ b/docs/administration/configuration/dynamic_configuration.md @@ -84,14 +84,8 @@ use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; class Service { - /** - * @var \Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface - */ - private $configResolver; - - public function __construct(ConfigResolverInterface $configResolver) + public function __construct(private readonly ConfigResolverInterface $configResolver) { - $this->configResolver = $configResolver; } public function someMethodThatNeedConfig(): void diff --git a/docs/administration/configuration/repository_configuration.md b/docs/administration/configuration/repository_configuration.md index 82f7066ade..9396455bfd 100644 --- a/docs/administration/configuration/repository_configuration.md +++ b/docs/administration/configuration/repository_configuration.md @@ -346,6 +346,6 @@ final class AcmeFeatureBundle extends Bundle To access the configuration settings, use the `Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider::getRepositoryConfig` method: ``` php -/** @var \Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider $repositoryConfigProvider */ +/** @var \Ibexa\Contracts\Core\Container\ApiLoader\RepositoryConfigurationProviderInterface $repositoryConfigProvider */ $acmeConfig = $repositoryConfigProvider->getRepositoryConfig()['acme']; ``` diff --git a/docs/api/php_api/php_api.md b/docs/api/php_api/php_api.md index cf9c759b20..1329676fc0 100644 --- a/docs/api/php_api/php_api.md +++ b/docs/api/php_api/php_api.md @@ -116,9 +116,7 @@ use Ibexa\Contracts\Core\Repository\Values\Content\Location; /** @var Repository $repository */ /** @var Location $location */ -$hiddenLocation = $repository->sudo(static function (Repository $repository) use ($location): Location { - return $repository->getLocationService()->hideLocation($location); -}); +$hiddenLocation = $repository->sudo(static fn(Repository $repository): Location => $repository->getLocationService()->hideLocation($location)); ``` ### Setting the repository user @@ -153,9 +151,9 @@ Both cases should be covered with error messages: ``` php try { // ... -} catch (\Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException $e) { +} catch (\Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException) { $output->writeln("No content with id $contentId found"); -} catch (\Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException $e) { +} catch (\Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException) { $output->writeln("Permission denied on content with id $contentId"); } ``` diff --git a/docs/infrastructure_and_maintenance/cache/persistence_cache.md b/docs/infrastructure_and_maintenance/cache/persistence_cache.md index 28b48f4b4d..636f376ee9 100644 --- a/docs/infrastructure_and_maintenance/cache/persistence_cache.md +++ b/docs/infrastructure_and_maintenance/cache/persistence_cache.md @@ -271,7 +271,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** @var TagAwareAdapterInterface $pool */ /** @var ContainerInterface $container */ /** @var int $id */ -$cacheItem = $pool->getItem("myApp-object-${id}"); +$cacheItem = $pool->getItem("myApp-object-{$id}"); if ($cacheItem->isHit()) { return $cacheItem->get(); } diff --git a/docs/multisite/languages/back_office_translations.md b/docs/multisite/languages/back_office_translations.md index 2838c5386e..3d234ee12a 100644 --- a/docs/multisite/languages/back_office_translations.md +++ b/docs/multisite/languages/back_office_translations.md @@ -61,13 +61,10 @@ Here's an example: ``` php hl_lines="14-16" use Symfony\Contracts\Translation\TranslatorInterface; -final class MyService +final readonly class MyService { - private TranslatorInterface $translator; - - public function __construct(TranslatorInterface $translator) + public function __construct(private TranslatorInterface $translator) { - $this->translator = $translator; } public function getTranslatedDescription(): string diff --git a/docs/multisite/siteaccess/injecting_siteaccess.md b/docs/multisite/siteaccess/injecting_siteaccess.md index 9d1dfb9529..a3622db286 100644 --- a/docs/multisite/siteaccess/injecting_siteaccess.md +++ b/docs/multisite/siteaccess/injecting_siteaccess.md @@ -28,16 +28,8 @@ use Ibexa\Core\MVC\Symfony\SiteAccess\SiteAccessServiceInterface; class MyService { - private ContentService $contentService; - - private SiteAccessServiceInterface $siteAccessService; - - public function __construct( - SiteAccessServiceInterface $siteAccessService, - ContentService $contentService - ) { - $this->siteAccessService = $siteAccessService; - $this->contentService = $contentService; + public function __construct(private readonly SiteAccessServiceInterface $siteAccessService, private readonly ContentService $contentService) + { } } ``` diff --git a/docs/tutorials/beginner_tutorial/7_embed_content.md b/docs/tutorials/beginner_tutorial/7_embed_content.md index f2483ff6fc..69b55bc5f9 100644 --- a/docs/tutorials/beginner_tutorial/7_embed_content.md +++ b/docs/tutorials/beginner_tutorial/7_embed_content.md @@ -134,11 +134,8 @@ use Ibexa\Core\MVC\Symfony\View\ContentView; class RideController extends Controller { - private ContentService $contentService; - - public function __construct(ContentService $contentService) + public function __construct(private readonly ContentService $contentService) { - $this->contentService = $contentService; } public function viewRideWithLandmarksAction(ContentView $view): ContentView diff --git a/docs/users/user_authentication.md b/docs/users/user_authentication.md index da33ba3a24..c1f5b720ae 100644 --- a/docs/users/user_authentication.md +++ b/docs/users/user_authentication.md @@ -83,17 +83,11 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; class InteractiveLoginListener implements EventSubscriberInterface { - /** - * @var \Ibexa\Contracts\Core\Repository\UserService - */ - private $userService; - - public function __construct(UserService $userService) + public function __construct(private readonly UserService $userService) { - $this->userService = $userService; } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ MVCEvents::INTERACTIVE_LOGIN => 'onInteractiveLogin', diff --git a/tests/InlineSamples/InlinePhpSyncer.php b/tests/InlineSamples/InlinePhpSyncer.php index 92c426d707..aaa484409f 100644 --- a/tests/InlineSamples/InlinePhpSyncer.php +++ b/tests/InlineSamples/InlinePhpSyncer.php @@ -71,33 +71,34 @@ public function sync(string $phpFileContent, string $mdContent): ?string /** * Extracts the snippet body from a _inline_php file by stripping the auto-generated header. * - * The header ends at the first blank line that follows the auto-generated comments. + * Uses the "// (auto-generated ...)" line as the end-of-header anchor so that the + * body is located correctly even when a refactoring tool (e.g. Rector) removes the + * blank separator line between the header and the body. * The $line) { - if (preg_match('/^\/\/ Source: .+:\d+$/', $line)) { - $sourceIdx = $i; + if (str_starts_with($line, '// (auto-generated by tools/extract-inline-php.php')) { + $autoGenIdx = $i; break; } } - if ($sourceIdx === null) { + if ($autoGenIdx === null) { return ''; } - // Advance past remaining header comment lines to the blank separator. - $cursor = $sourceIdx + 1; - while ($cursor < count($lines) && $lines[$cursor] !== '') { + // Body starts right after the marker; skip one optional blank separator. + // The blank may be absent when a refactoring tool (e.g. Rector) collapses it. + $cursor = $autoGenIdx + 1; + if (isset($lines[$cursor]) && $lines[$cursor] === '') { ++$cursor; } - ++$cursor; // skip the blank separator itself $bodyLines = array_slice($lines, $cursor); diff --git a/tests/InlineSamples/InlinePhpSyncerTest.php b/tests/InlineSamples/InlinePhpSyncerTest.php index 3aeb0c6ca7..7013707d61 100644 --- a/tests/InlineSamples/InlinePhpSyncerTest.php +++ b/tests/InlineSamples/InlinePhpSyncerTest.php @@ -182,6 +182,30 @@ public function testSyncAppliesMultiLineCodeChange(): void self::assertStringContainsString("\$a = 1;\n\$b = 2;", $result); } + public function testSyncWorksWhenBlankSeparatorRemovedByRefactoringTool(): void + { + // Rector (and similar tools) may remove the blank line between the auto-generated + // header and the body. The syncer must not produce an empty body in that case. + $md = "```php\n\$x = 1;\n```\n"; + $bodyLine = self::bodyLineOf($md); + + // Build a normal file then strip the blank separator to simulate Rector's behaviour. + $normalFile = $this->buildPhpFile('docs/test.md', $bodyLine, '$x = 1;'); + $fileWithoutBlank = str_replace( + "// (auto-generated by tools/extract-inline-php.php — do not edit)\n\n", + "// (auto-generated by tools/extract-inline-php.php — do not edit)\n", + $normalFile, + ); + + // A refactoring tool also changed the body. + $fileWithChange = str_replace('$x = 1;', '$x = 2;', $fileWithoutBlank); + + $result = $this->syncer->sync($fileWithChange, $md); + + self::assertNotNull($result); + self::assertStringContainsString('$x = 2;', $result); + } + // ------------------------------------------------------------------------- // sync — Date: Sun, 17 May 2026 15:07:35 +0200 Subject: [PATCH 12/18] Code style & PHPStan --- docs/api/php_api/php_api.md | 2 +- phpstan-baseline.neon | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/api/php_api/php_api.md b/docs/api/php_api/php_api.md index 1329676fc0..1fa7fbbf9c 100644 --- a/docs/api/php_api/php_api.md +++ b/docs/api/php_api/php_api.md @@ -116,7 +116,7 @@ use Ibexa\Contracts\Core\Repository\Values\Content\Location; /** @var Repository $repository */ /** @var Location $location */ -$hiddenLocation = $repository->sudo(static fn(Repository $repository): Location => $repository->getLocationService()->hideLocation($location)); +$hiddenLocation = $repository->sudo(static fn (Repository $repository): Location => $repository->getLocationService()->hideLocation($location)); ``` ### Setting the repository user diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 864b4923f2..5ca0768645 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -4,19 +4,19 @@ parameters: message: '#^Offset ''acme'' does not exist on array\{alias\: string, storage\: array\{engine\: string, connection\: string, config\?\: array\\}, search\: array\{engine\: string, connection\: string\}, fields_groups\: array\{default\: string, list\: array\\}, options\: array\\}\.$#' identifier: offsetAccess.notFound count: 1 - path: code_samples/_inline_php/administration/configuration/repository_configuration/f375c926bac1bea78d0a7c63103acbda9f06946b4c7c5afb0c8dcb2021dcff0d.php + path: code_samples/_inline_php/administration/configuration/repository_configuration/ab545148cd13f7537467f6c43859d757ba15120b5df7d9933e6236336f1bf5e1.php - message: '#^Dead catch \- Ibexa\\Contracts\\Core\\Repository\\Exceptions\\NotFoundException is never thrown in the try block\.$#' identifier: catch.neverThrown count: 1 - path: code_samples/_inline_php/api/php_api/php_api/dd6676867249e539a49af9bbc5378daedf4d78d4f887c69d6ad7ccdf37122f12.php + path: code_samples/_inline_php/api/php_api/php_api/1207fc11956ce57c9503ab18d8fb6316f391ed152816968fccfb020a4d498420.php - message: '#^Dead catch \- Ibexa\\Contracts\\Core\\Repository\\Exceptions\\UnauthorizedException is never thrown in the try block\.$#' identifier: catch.neverThrown count: 1 - path: code_samples/_inline_php/api/php_api/php_api/dd6676867249e539a49af9bbc5378daedf4d78d4f887c69d6ad7ccdf37122f12.php + path: code_samples/_inline_php/api/php_api/php_api/1207fc11956ce57c9503ab18d8fb6316f391ed152816968fccfb020a4d498420.php - message: '#^Instantiated class MyValue not found\.$#' @@ -70,19 +70,19 @@ parameters: message: '#^Call to an undefined method object\:\:loadObject\(\)\.$#' identifier: method.notFound count: 1 - path: code_samples/_inline_php/infrastructure_and_maintenance/cache/persistence_cache/a5a1471bf52540ef2e36019d8f4ea41327b7ee0283aff5caf8d85ddbeb903ba6.php + path: code_samples/_inline_php/infrastructure_and_maintenance/cache/persistence_cache/353177557bb0bc90eb5b4270a1c24e9544452d429462edff6f2aab293e6999e9.php - message: '#^Property App\\MyService\:\:\$contentService is never read, only written\.$#' identifier: property.onlyWritten count: 1 - path: code_samples/_inline_php/multisite/siteaccess/injecting_siteaccess/cb7d390849731a90746ee24236ea392043611c515c68c64bb2697336bca76b51.php + path: code_samples/_inline_php/multisite/siteaccess/injecting_siteaccess/8c8e5bbb699fa46d35caf839176460dccbdd53431e04edd95c7ea25a7e638d9c.php - message: '#^Property App\\MyService\:\:\$siteAccessService is never read, only written\.$#' identifier: property.onlyWritten count: 1 - path: code_samples/_inline_php/multisite/siteaccess/injecting_siteaccess/cb7d390849731a90746ee24236ea392043611c515c68c64bb2697336bca76b51.php + path: code_samples/_inline_php/multisite/siteaccess/injecting_siteaccess/8c8e5bbb699fa46d35caf839176460dccbdd53431e04edd95c7ea25a7e638d9c.php - message: '#^Method App\\QueryType\\RideQueryType\:\:getSupportedParameters\(\) return type has no value type specified in iterable type array\.$#' @@ -94,7 +94,7 @@ parameters: message: '#^Cannot access property \$destinationContentIds on Ibexa\\Contracts\\Core\\FieldType\\Value\|null\.$#' identifier: property.nonObject count: 1 - path: code_samples/_inline_php/tutorials/beginner_tutorial/7_embed_content/f94706cc49dde292703d524c7b07537449b65e58d081d075c1997f0e6e33d567.php + path: code_samples/_inline_php/tutorials/beginner_tutorial/7_embed_content/d8ad5ae7972b67d11cb172c321b891e268d5a346d166f73c5570d61b9b372a7d.php - message: '#^Access to constant ANNOTATIONS_TO_ATTRIBUTES on an unknown class Rector\\Symfony\\Set\\SensiolabsSetList\.$#' @@ -106,25 +106,25 @@ parameters: message: '#^Access to undefined constant Ibexa\\Core\\MVC\\Symfony\\MVCEvents\:\:INTERACTIVE_LOGIN\.$#' identifier: classConstant.notFound count: 1 - path: code_samples/_inline_php/users/user_authentication/91c89a3c8487a5419d764ad793e216152abfd07c24a50bf96db22c4d53993e25.php + path: code_samples/_inline_php/users/user_authentication/661a7600ac0964cdf501697eda6461ec2a7a1c3813025f1fbb4ffa16ec174b53.php - message: '#^Call to method setApiUser\(\) on an unknown class eIbexa\\Core\\MVC\\Symfony\\Event\\InteractiveLoginEvent\.$#' identifier: class.notFound count: 1 - path: code_samples/_inline_php/users/user_authentication/91c89a3c8487a5419d764ad793e216152abfd07c24a50bf96db22c4d53993e25.php + path: code_samples/_inline_php/users/user_authentication/661a7600ac0964cdf501697eda6461ec2a7a1c3813025f1fbb4ffa16ec174b53.php - message: '#^Method App\\EventListener\\InteractiveLoginListener\:\:onInteractiveLogin\(\) has no return type specified\.$#' identifier: missingType.return count: 1 - path: code_samples/_inline_php/users/user_authentication/91c89a3c8487a5419d764ad793e216152abfd07c24a50bf96db22c4d53993e25.php + path: code_samples/_inline_php/users/user_authentication/661a7600ac0964cdf501697eda6461ec2a7a1c3813025f1fbb4ffa16ec174b53.php - message: '#^Parameter \$event of method App\\EventListener\\InteractiveLoginListener\:\:onInteractiveLogin\(\) has invalid type eIbexa\\Core\\MVC\\Symfony\\Event\\InteractiveLoginEvent\.$#' identifier: class.notFound count: 1 - path: code_samples/_inline_php/users/user_authentication/91c89a3c8487a5419d764ad793e216152abfd07c24a50bf96db22c4d53993e25.php + path: code_samples/_inline_php/users/user_authentication/661a7600ac0964cdf501697eda6461ec2a7a1c3813025f1fbb4ffa16ec174b53.php - message: '#^Class App\\Form\\Type\\TextToTextOptionsType extends generic class Symfony\\Component\\Form\\AbstractType but does not specify its types\: TData$#' From 80a332425f2c3d3dfa17d6862e6dad5e69cf48f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Sun, 17 May 2026 15:10:51 +0200 Subject: [PATCH 13/18] Run deptrac --- deptrac.baseline.yaml | 26 +++++++++++++++++++ .../storefront/configure_storefront.md | 16 ++---------- .../url_management/url_management.md | 23 +--------------- 3 files changed, 29 insertions(+), 36 deletions(-) diff --git a/deptrac.baseline.yaml b/deptrac.baseline.yaml index c45d47606a..7c50c6f419 100644 --- a/deptrac.baseline.yaml +++ b/deptrac.baseline.yaml @@ -1,5 +1,7 @@ deptrac: skip_violations: + AcmeFeatureBundle: + - Ibexa\Bundle\Core\DependencyInjection\IbexaCoreExtension App\AutomatedTranslation\ImageFieldEncoder: - Ibexa\Core\FieldType\Image\Value App\Block\Listener\MyBlockListener: @@ -92,6 +94,9 @@ deptrac: - Ibexa\Core\MVC\Symfony\View\View App\Controller\RelationController: - Ibexa\Core\MVC\Symfony\View\View + App\Controller\RideController: + - Ibexa\Bundle\Core\Controller + - Ibexa\Core\MVC\Symfony\View\ContentView App\Controller\SvgController: - Ibexa\Core\Helper\TranslationHelper - Ibexa\Core\IO\IOServiceInterface @@ -117,6 +122,9 @@ deptrac: - Ibexa\Discounts\Repository\DiscountRule\DiscountRuleFactoryInterface App\Dispatcher\SomeClassThatSchedulesExecutionInTheBackground: - Ibexa\Bundle\Messenger\Stamp\DeduplicateStamp + App\EventListener\InteractiveLoginListener: + - Ibexa\Core\MVC\Symfony\MVCEvents + - eIbexa\Core\MVC\Symfony\Event\InteractiveLoginEvent App\EventListener\TextAnchorMenuTabListener: - Ibexa\AdminUi\Menu\ContentEditAnchorMenuBuilder - Ibexa\AdminUi\Menu\Event\ConfigureMenuEvent @@ -128,6 +136,10 @@ deptrac: - Ibexa\FormBuilder\Event\FormEvents App\EventSubscriber\HelpMenuSubscriber: - Ibexa\AdminUi\Menu\Event\ConfigureMenuEvent + App\EventSubscriber\LoginFormViewSubscriber: + - Ibexa\Core\MVC\Symfony\Event\PreContentViewEvent + - Ibexa\Core\MVC\Symfony\MVCEvents + - Ibexa\Core\MVC\Symfony\View\LoginFormView App\EventSubscriber\MyMenuSubscriber: - Ibexa\AdminUi\Menu\Event\ConfigureMenuEvent - Ibexa\AdminUi\Menu\MainMenuBuilder @@ -135,6 +147,8 @@ deptrac: - Ibexa\IntegratedHelp\ProductTour\Block\LinkBlock - Ibexa\IntegratedHelp\ProductTour\Block\TextBlock - Ibexa\IntegratedHelp\ProductTour\ProductTourStep + App\EventSubscriber\ResolveCampaginEventSubscriber: + - Ibexa\ConnectorActito\Campaign\Campaign App\Event\RandomBlockListener: - Ibexa\FieldTypePage\FieldType\Page\Block\Renderer\BlockRenderEvents - Ibexa\FieldTypePage\FieldType\Page\Block\Renderer\Event\PreRenderEvent @@ -192,6 +206,8 @@ deptrac: - Ibexa\Migration\ValueObject\Step\StepInterface App\Migrations\Step\ReplaceNameStepNormalizer: - Ibexa\Migration\ValueObject\Step\StepInterface + App\MyService: + - Ibexa\Core\MVC\Symfony\SiteAccess\SiteAccessServiceInterface App\Notification\ListRenderer: - Ibexa\Core\Notification\Renderer\NotificationRenderer - Ibexa\Core\Notification\Renderer\TypedNotificationRendererInterface @@ -207,6 +223,8 @@ deptrac: App\QueryType\OptionsBasedLatestContentQueryType: - Ibexa\Core\QueryType\OptionsResolverBasedQueryType - Ibexa\Core\QueryType\QueryType + App\QueryType\RideQueryType: + - Ibexa\Core\QueryType\QueryType App\Search\Model\Suggestion\ProductSuggestion: - Ibexa\ProductCatalog\Local\Repository\Values\Product App\Security\FormPolicyProvider: @@ -231,6 +249,8 @@ deptrac: - Ibexa\AdminUi\Limitation\LimitationValueMapperInterface App\Security\MyPolicyProvider: - Ibexa\Bundle\Core\DependencyInjection\Security\PolicyProvider\YamlPolicyProvider + App\Service\MyService: + - Ibexa\User\UserSetting\DateTimeFormat\FormatterInterface App\Setting\Group\MyGroup: - Ibexa\User\UserSetting\Group\AbstractGroup App\Setting\Unit: @@ -249,3 +269,9 @@ deptrac: - Ibexa\Core\MVC\Symfony\View\View AttributeTypeExtension: - Ibexa\PageBuilder\Form\Type\Attribute\AttributeType + CustomRepositoryConfigParser: + - Ibexa\Bundle\Core\DependencyInjection\Configuration\RepositoryConfigParserInterface + JohnDoeCanSelectMore: + - Ibexa\AdminUi\UniversalDiscovery\Event\ConfigResolveEvent + MyMapper: + - Ibexa\ContentForms\Form\Type\FieldType\CheckboxFieldType diff --git a/docs/commerce/storefront/configure_storefront.md b/docs/commerce/storefront/configure_storefront.md index 5d69a73251..82e0a6cedb 100644 --- a/docs/commerce/storefront/configure_storefront.md +++ b/docs/commerce/storefront/configure_storefront.md @@ -65,21 +65,9 @@ The basic configuration of the Storefront can look as follows: ## Retrieve catalog assigned to user -The `\Ibexa\Contracts\Storefront\Repository\CatalogResolverInterface` interface allows retrieving the product catalog available for a specific user. +The [`\Ibexa\Contracts\Storefront\Repository\CatalogResolverInterface`](api/php_api/php_api_reference/classes/Ibexa-Contracts-Storefront-Repository-CatalogResolverInterface.html) interface allows retrieving the product catalog available for a specific user. -```php -namespace Ibexa\Contracts\Storefront\Repository; - -use Ibexa\Contracts\Core\Repository\Values\User\User; -use Ibexa\Contracts\ProductCatalog\Values\CatalogInterface; - -interface CatalogResolverInterface -{ - public function resolveCatalog(?User $user = null): ?CatalogInterface; -} -``` - -`null` stands for the current user. +To retrieve catalog assigned for the current user, pass `null`. ### Configure user account diff --git a/docs/content_management/url_management/url_management.md b/docs/content_management/url_management/url_management.md index 13ecba94a8..f631043e1d 100644 --- a/docs/content_management/url_management/url_management.md +++ b/docs/content_management/url_management/url_management.md @@ -100,28 +100,7 @@ For more information about [[= product_name_base =]] configuration, see [Configu ### Custom protocol support You can extend the external URL address validation with a custom protocol. -To do this, you must provide a service that implements the `Ibexa\Bundle\Core\URLChecker\URLHandlerInterface` interface: -s -```php - Date: Sun, 17 May 2026 15:17:00 +0200 Subject: [PATCH 14/18] Fixed broken link --- docs/commerce/storefront/configure_storefront.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/commerce/storefront/configure_storefront.md b/docs/commerce/storefront/configure_storefront.md index 82e0a6cedb..ed631726bb 100644 --- a/docs/commerce/storefront/configure_storefront.md +++ b/docs/commerce/storefront/configure_storefront.md @@ -65,7 +65,7 @@ The basic configuration of the Storefront can look as follows: ## Retrieve catalog assigned to user -The [`\Ibexa\Contracts\Storefront\Repository\CatalogResolverInterface`](api/php_api/php_api_reference/classes/Ibexa-Contracts-Storefront-Repository-CatalogResolverInterface.html) interface allows retrieving the product catalog available for a specific user. +The [`\Ibexa\Contracts\Storefront\Repository\CatalogResolverInterface`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Storefront-Repository-CatalogResolverInterface.html) interface allows retrieving the product catalog available for a specific user. To retrieve catalog assigned for the current user, pass `null`. From c52819a6389bc8c27d1e0c811587400bd0e68751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Sun, 17 May 2026 15:24:44 +0200 Subject: [PATCH 15/18] Selfreview --- docs/administration/back_office/browser/browser.md | 2 +- .../search/criteria_reference/ancestor_criterion.md | 13 +++++++------ phpstan-baseline.neon | 6 ++++++ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/docs/administration/back_office/browser/browser.md b/docs/administration/back_office/browser/browser.md index eee49198ca..a45963c4e7 100644 --- a/docs/administration/back_office/browser/browser.md +++ b/docs/administration/back_office/browser/browser.md @@ -146,7 +146,7 @@ If an event listener catches additional parameters passed with context, it uses In the example below, the `johndoe` parameter enables the user to choose multiple items from a **Browser window** by changing `multiple: false` from `my_custom_udw` configuration to `multiple: true`. -```php hl_lines="29 30 31" +```php hl_lines="31 32 33" query = new Criterion\Ancestor([$locationService->loadLocation(62)->path You can use the Ancestor Search Criterion to create a list of breadcrumbs leading to the Location: -``` php hl_lines="2" +``` php hl_lines="8" use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; -/** @var int $locationId */ -/** @var object{locationService: \Ibexa\Contracts\Core\Repository\LocationService, searchService: \Ibexa\Contracts\Core\Repository\SearchService} $this */ +$locationId = 12345; + $query = new LocationQuery(); -$query->query = new Criterion\Ancestor([$this->locationService->loadLocation($locationId)->pathString]); +/** @var \Ibexa\Contracts\Core\Repository\LocationService $locationService */ +$query->query = new Criterion\Ancestor([$locationService->loadLocation($locationId)->pathString]); -$results = $this->searchService->findLocations($query); +/** @var \Ibexa\Contracts\Core\Repository\SearchService $searchService */ +$results = $searchService->findLocations($query); $breadcrumbs = []; foreach ($results->searchHits as $searchHit) { $breadcrumbs[] = $searchHit; } -// @phpstan-ignore-next-line return $this->render('parts/breadcrumbs.html.twig', [ 'breadcrumbs' => $breadcrumbs, ]); diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 5ca0768645..44bcbdd60d 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -84,6 +84,12 @@ parameters: count: 1 path: code_samples/_inline_php/multisite/siteaccess/injecting_siteaccess/8c8e5bbb699fa46d35caf839176460dccbdd53431e04edd95c7ea25a7e638d9c.php + - + message: '#^Variable \$this might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: code_samples/_inline_php/search/criteria_reference/ancestor_criterion/4a5427b7ae43106059e9d543fcbf5e7b66602c10052ab6ff67750e041857c6ad.php + - message: '#^Method App\\QueryType\\RideQueryType\:\:getSupportedParameters\(\) return type has no value type specified in iterable type array\.$#' identifier: missingType.iterableValue From 4ca44bae95f79b5d81b9b91eee6d1d23b2826305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Sun, 17 May 2026 15:27:04 +0200 Subject: [PATCH 16/18] Selfreview --- .../criteria_reference/parentlocationid_criterion.md | 8 ++++---- phpstan-baseline.neon | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/search/criteria_reference/parentlocationid_criterion.md b/docs/search/criteria_reference/parentlocationid_criterion.md index 50ea5cc6fb..3dbd36c19d 100644 --- a/docs/search/criteria_reference/parentlocationid_criterion.md +++ b/docs/search/criteria_reference/parentlocationid_criterion.md @@ -53,21 +53,21 @@ You can use the `ParentLocationId` Search Criterion to list blog posts contained use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; -/** @var int $locationId */ -/** @var object{searchService: \Ibexa\Contracts\Core\Repository\SearchService} $this */ +$locationId = 12345; + $query = new LocationQuery(); $query->query = new Criterion\LogicalAnd([ new Criterion\Visibility(Criterion\Visibility::VISIBLE), new Criterion\ParentLocationId($locationId), ]); -$results = $this->searchService->findLocations($query); +/** @var \Ibexa\Contracts\Core\Repository\SearchService $searchService */ +$results = $searchService->findLocations($query); $posts = []; foreach ($results->searchHits as $searchHit) { $posts[] = $searchHit; } -// @phpstan-ignore-next-line return $this->render('full/blog.html.twig', [ 'posts' => $posts, ]); diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 44bcbdd60d..cf73a541c5 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -90,6 +90,12 @@ parameters: count: 1 path: code_samples/_inline_php/search/criteria_reference/ancestor_criterion/4a5427b7ae43106059e9d543fcbf5e7b66602c10052ab6ff67750e041857c6ad.php + - + message: '#^Variable \$this might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: code_samples/_inline_php/search/criteria_reference/parentlocationid_criterion/c85766351eda977c61c12ab7d00c11cba956bde544bbdff4cad24e0bbf7717d9.php + - message: '#^Method App\\QueryType\\RideQueryType\:\:getSupportedParameters\(\) return type has no value type specified in iterable type array\.$#' identifier: missingType.iterableValue From 382f520041ceb211fea01ae210bae14927debefc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Sun, 17 May 2026 15:32:44 +0200 Subject: [PATCH 17/18] Self review: hl_lines --- docs/administration/back_office/browser/browser.md | 2 +- docs/multisite/languages/back_office_translations.md | 2 +- .../search/criteria_reference/contenttypegroupid_criterion.md | 2 +- docs/search/criteria_reference/datemetadata_criterion.md | 2 +- docs/search/criteria_reference/field_criterion.md | 2 +- docs/search/criteria_reference/isfieldempty_criterion.md | 2 +- docs/search/criteria_reference/parentlocationid_criterion.md | 2 +- docs/search/criteria_reference/usermetadata_criterion.md | 4 ++-- .../beginner_tutorial/5_display_a_list_of_content_items.md | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/administration/back_office/browser/browser.md b/docs/administration/back_office/browser/browser.md index a45963c4e7..4b981dcc1e 100644 --- a/docs/administration/back_office/browser/browser.md +++ b/docs/administration/back_office/browser/browser.md @@ -146,7 +146,7 @@ If an event listener catches additional parameters passed with context, it uses In the example below, the `johndoe` parameter enables the user to choose multiple items from a **Browser window** by changing `multiple: false` from `my_custom_udw` configuration to `multiple: true`. -```php hl_lines="31 32 33" +```php hl_lines="31-34" query = new Criterion\ContentTypeGroupId([1, 2]); You can use the `ContentTypeGroupId` Criterion to query all Media content items (the default ID for the Media content type group is 3): -``` php hl_lines="1" +``` php hl_lines="6" use Ibexa\Contracts\Core\Repository\SearchService; use Ibexa\Contracts\Core\Repository\Values\Content\Query; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; diff --git a/docs/search/criteria_reference/datemetadata_criterion.md b/docs/search/criteria_reference/datemetadata_criterion.md index 8e88795028..200a02d3e2 100644 --- a/docs/search/criteria_reference/datemetadata_criterion.md +++ b/docs/search/criteria_reference/datemetadata_criterion.md @@ -62,7 +62,7 @@ $query->query = new Criterion\DateMetadata( You can use the `DateMetadata` Criterion to search for blog posts that have been created within the last week: -``` php hl_lines="5" +``` php hl_lines="9" use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; diff --git a/docs/search/criteria_reference/field_criterion.md b/docs/search/criteria_reference/field_criterion.md index 1733dc21e9..c873d73305 100644 --- a/docs/search/criteria_reference/field_criterion.md +++ b/docs/search/criteria_reference/field_criterion.md @@ -69,7 +69,7 @@ $query->query = new Criterion\Field('name', Criterion\Operator::CONTAINS, 'Platf You can use the `Field` Criterion to search for articles that contain the word "featured": -``` php hl_lines="4" +``` php hl_lines="8" use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; diff --git a/docs/search/criteria_reference/isfieldempty_criterion.md b/docs/search/criteria_reference/isfieldempty_criterion.md index 25d3dd994e..c4ca0506f2 100644 --- a/docs/search/criteria_reference/isfieldempty_criterion.md +++ b/docs/search/criteria_reference/isfieldempty_criterion.md @@ -37,7 +37,7 @@ $query->query = new Criterion\IsFieldEmpty('title'); You can use the `IsFieldEmpty` Criterion to search for articles that don't have an image: -``` php hl_lines="4" +``` php hl_lines="8" use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; diff --git a/docs/search/criteria_reference/parentlocationid_criterion.md b/docs/search/criteria_reference/parentlocationid_criterion.md index 3dbd36c19d..eb1514964b 100644 --- a/docs/search/criteria_reference/parentlocationid_criterion.md +++ b/docs/search/criteria_reference/parentlocationid_criterion.md @@ -49,7 +49,7 @@ $query->query = new Criterion\ParentLocationId([54, 58]); You can use the `ParentLocationId` Search Criterion to list blog posts contained in a blog: -``` php hl_lines="4" +``` php hl_lines="9" use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; diff --git a/docs/search/criteria_reference/usermetadata_criterion.md b/docs/search/criteria_reference/usermetadata_criterion.md index 6aabd01472..ef6939f9b8 100644 --- a/docs/search/criteria_reference/usermetadata_criterion.md +++ b/docs/search/criteria_reference/usermetadata_criterion.md @@ -60,11 +60,11 @@ $query->query = new Criterion\UserMetadata(Criterion\UserMetadata::GROUP, Criter You can use the `UserMetadata` Criterion to search for blog posts created by the Contributor user group: -``` php hl_lines="10" -// ID of your custom Contributor User Group +``` php hl_lines="11" use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +// ID of your custom Contributor User Group $contributorGroupId = 32; $query = new LocationQuery(); diff --git a/docs/tutorials/beginner_tutorial/5_display_a_list_of_content_items.md b/docs/tutorials/beginner_tutorial/5_display_a_list_of_content_items.md index 7713125f5d..4ee939afaa 100644 --- a/docs/tutorials/beginner_tutorial/5_display_a_list_of_content_items.md +++ b/docs/tutorials/beginner_tutorial/5_display_a_list_of_content_items.md @@ -57,7 +57,7 @@ For more information, see [Built-In Query Types](built-in_query_types.md). Here, you need to display `ride` objects that have been published (are visible). Create a `RideQueryType.php` file in `src/QueryType`: -``` php hl_lines="21 22" +``` php hl_lines="22-23" Date: Sun, 17 May 2026 16:18:42 +0200 Subject: [PATCH 18/18] Use new skip-validation attribute --- .../configuration/dynamic_configuration.md | 2 +- docs/api/graphql/graphql_custom_ft.md | 2 +- .../field_type_reference/authorfield.md | 2 +- .../field_type_reference/countryfield.md | 2 +- .../siteaccess_aware_configuration.md | 2 +- docs/permissions/permission_overview.md | 6 ++--- .../personalization/enable_personalization.md | 2 +- .../integrate_recommendation_service.md | 6 ++--- docs/release_notes/ez_platform_v2.4.md | 2 +- .../ez_platform_v3.0_deprecations.md | 2 +- docs/release_notes/ibexa_dxp_v4.6.md | 2 +- .../contributing/package_structure.md | 24 +++++++++---------- .../solr_search_engine/configure_solr.md | 2 +- .../search_term_aggregation_settings.md | 2 +- .../from_1.x_2.x/update_db_to_2.5.md | 8 +++---- .../update_code/2_update_configuration.md | 4 ++-- .../update_code/4_update_signal_slots.md | 4 ++-- .../from_4.3/update_from_4.3_old_commerce.md | 2 +- .../migrating_from_ez_publish_platform.md | 4 ++-- 19 files changed, 40 insertions(+), 40 deletions(-) diff --git a/docs/administration/configuration/dynamic_configuration.md b/docs/administration/configuration/dynamic_configuration.md index f30432a59f..60d8516a97 100644 --- a/docs/administration/configuration/dynamic_configuration.md +++ b/docs/administration/configuration/dynamic_configuration.md @@ -29,7 +29,7 @@ parameters: Inside a controller extending the `Ibexa\Core\MVC\Symfony\Controller\Controller` class, in `site_group` SiteAccess, you can use the parameters in the following way (the same applies for `hasParameter()`): -``` php skip-validation +``` php {skip-validation} $configResolver = $this->getConfigResolver(); // ibexa.site_access.config is the default namespace, so no need to specify it diff --git a/docs/api/graphql/graphql_custom_ft.md b/docs/api/graphql/graphql_custom_ft.md index 1a4f416d5c..bb144cfef5 100644 --- a/docs/api/graphql/graphql_custom_ft.md +++ b/docs/api/graphql/graphql_custom_ft.md @@ -40,7 +40,7 @@ If not specified, it uses `FieldDefinition`. Compiler pass example that should be placed in `src/DependencyInjection/Compiler`: -``` php skip-validation +``` php {skip-validation} [[= include_file('code_samples/api/graphql/src/DependencyInjection/Compiler/MyCustomTypeGraphQLCompilerPass.php') =]] ``` diff --git a/docs/content_management/field_types/field_type_reference/authorfield.md b/docs/content_management/field_types/field_type_reference/authorfield.md index edcec8fb81..7e573295a8 100644 --- a/docs/content_management/field_types/field_type_reference/authorfield.md +++ b/docs/content_management/field_types/field_type_reference/authorfield.md @@ -41,7 +41,7 @@ The hash format mostly matches the value object. It has the following key `autho Example -``` php skip-validation +``` php {skip-validation} [ [ 'id' => 1, diff --git a/docs/content_management/field_types/field_type_reference/countryfield.md b/docs/content_management/field_types/field_type_reference/countryfield.md index ec13082512..0a8ce82625 100644 --- a/docs/content_management/field_types/field_type_reference/countryfield.md +++ b/docs/content_management/field_types/field_type_reference/countryfield.md @@ -12,7 +12,7 @@ This field type represents one or multiple countries. Example array: -``` php skip-validation +``` php {skip-validation} [ "JP" => [ "Name" => "Japan", diff --git a/docs/multisite/siteaccess/siteaccess_aware_configuration.md b/docs/multisite/siteaccess/siteaccess_aware_configuration.md index b3d72943b4..0a121d9ce7 100644 --- a/docs/multisite/siteaccess/siteaccess_aware_configuration.md +++ b/docs/multisite/siteaccess/siteaccess_aware_configuration.md @@ -27,7 +27,7 @@ For more information about the ConfigResolver, namespaces and scopes, see [confi The example below assumes you're using an `Acme\ExampleBundle`. Remember to register the bundle by adding it to `config/bundles.php`: -``` php skip-validation +``` php {skip-validation} return [ // ... Acme\ExampleBundle\AcmeExampleBundle::class => ['all' => true], diff --git a/docs/permissions/permission_overview.md b/docs/permissions/permission_overview.md index dc2b4502ad..5f89078342 100644 --- a/docs/permissions/permission_overview.md +++ b/docs/permissions/permission_overview.md @@ -38,7 +38,7 @@ You can control access to a custom controller by implementing the `performAccess In the following example the user doesn't have access to the controller unless they have the `section/view` policy: -``` php skip-validation +``` php {skip-validation} use Ibexa\Core\MVC\Symfony\Security\Authorization\Attribute; public function performAccessCheck(): void @@ -63,7 +63,7 @@ public function performAccessCheck(): void To check if a user has access to an operation, use the `isGranted()` method. For example, to check if content can be assigned to a Section: -``` php skip-validation +``` php {skip-validation} $hasAccess = $this->isGranted( new Attribute('section', 'assign', ['valueObject' => $contentInfo, 'targets' => [$section]]) ); @@ -79,6 +79,6 @@ checks the `content/edit` permission for the provided content item at the provid To block access to a specific action of the controller, add the following to the action's definition: -``` php skip-validation +``` php {skip-validation} $this->denyAccessUnlessGranted(new Attribute('state', 'administrate')); ``` diff --git a/docs/personalization/enable_personalization.md b/docs/personalization/enable_personalization.md index 5c66279b2c..63e35cb6f0 100644 --- a/docs/personalization/enable_personalization.md +++ b/docs/personalization/enable_personalization.md @@ -491,7 +491,7 @@ You can retrieve data returned from the Personalization server and modify it bef To modify recommendation data, subscribe to `RecommendationResponseEvent`. See [`Event/Subscriber/RecommendationEventSubscriber.php`](https://github.com/ibexa/personalization-client/blob/main/src/lib/Event/Subscriber/RecommendationEventSubscriber.php) for an example: -``` php skip-validation +``` php {skip-validation} public static function getSubscribedEvents(): array { return [ diff --git a/docs/personalization/integrate_recommendation_service.md b/docs/personalization/integrate_recommendation_service.md index e42d07ecdf..4b6e224bfe 100644 --- a/docs/personalization/integrate_recommendation_service.md +++ b/docs/personalization/integrate_recommendation_service.md @@ -34,7 +34,7 @@ The following examples show how you can integrate a CLICK event: PHP: -``` php skip-validation +``` php {skip-validation} $mandator_id = '00000'; $content_type_id = '1'; $product_id = '123'; @@ -57,7 +57,7 @@ ycimg.src=url; A similar tracking image can be placed on a confirmation page that ends the payment process. -``` php skip-validation +``` php {skip-validation} $server = '//event.perso.ibexa.co'; foreach ($just_bought_products as $product_id) { $tracking = $server.'/api/'.$mandator_id.'/buy/'.urlencode(user_id()).$content_type_id.$product_id; @@ -122,7 +122,7 @@ A response with two recommendations resembles the following object: You can use the following code to make requests and parse results: -``` php skip-validation +``` php {skip-validation} $mandator_id = '00000'; $license_key = '67890-1234-5678-90123-4567'; $server = "https://reco.perso.ibexa.co"; diff --git a/docs/release_notes/ez_platform_v2.4.md b/docs/release_notes/ez_platform_v2.4.md index 4fb51d888b..515ee1488c 100644 --- a/docs/release_notes/ez_platform_v2.4.md +++ b/docs/release_notes/ez_platform_v2.4.md @@ -182,7 +182,7 @@ The biggest benefit of this feature is saving load time on complex landing pages 1\. Register `LexikJWTAuthenticationBundle` bundle in `/app/AppKernel.php` - ``` php skip-validation + ``` php {skip-validation} public function registerBundles() { $bundles = array( diff --git a/docs/release_notes/ez_platform_v3.0_deprecations.md b/docs/release_notes/ez_platform_v3.0_deprecations.md index 630820ee3e..bd5c636842 100644 --- a/docs/release_notes/ez_platform_v3.0_deprecations.md +++ b/docs/release_notes/ez_platform_v3.0_deprecations.md @@ -772,7 +772,7 @@ All classes and interfaces from `eZ\Publish\Core\Persistence\Database` and `eZ\P The signature of the `\eZ\Publish\Core\Persistence\Legacy\URL\Query\CriterionHandler::handle` contract now accepts `\Doctrine\DBAL\Query\QueryBuilder` instead of `\eZ\Publish\Core\Persistence\Database\SelectQuery` and has the following form: -``` php skip-validation +``` php {skip-validation} use \Doctrine\DBAL\Query\QueryBuilder; use \eZ\Publish\Core\Persistence\Legacy\URL\Query\CriteriaConverter; use \eZ\Publish\API\Repository\Values\URL\Query\Criterion; diff --git a/docs/release_notes/ibexa_dxp_v4.6.md b/docs/release_notes/ibexa_dxp_v4.6.md index f04e188ced..f810689a2b 100644 --- a/docs/release_notes/ibexa_dxp_v4.6.md +++ b/docs/release_notes/ibexa_dxp_v4.6.md @@ -1640,7 +1640,7 @@ Endpoints that allow you to manage prices in your platform with REST API: A signature for the `\Ibexa\Contracts\Rest\Output\Generator::startValueElement` method has been updated to the following: -```php skip-validation +```php {skip-validation} /** * @phpstan-param scalar $value * @phpstan-param array $attributes diff --git a/docs/resources/contributing/package_structure.md b/docs/resources/contributing/package_structure.md index 471b36ed4d..74129c8c77 100644 --- a/docs/resources/contributing/package_structure.md +++ b/docs/resources/contributing/package_structure.md @@ -17,17 +17,17 @@ The following conventions apply to contributions to [[= product_name_base =]] co Define [[= product_name =]] core PHP code in a namespace with the following prefix: -```php skip-validation +```php {skip-validation} namespace Ibexa; ``` A package which groups some DXP features can use an additional prefix, for example: -```php skip-validation +```php {skip-validation} namespace Ibexa\Commerce; ``` -```php skip-validation +```php {skip-validation} namespace Ibexa\Personalization; ``` @@ -55,11 +55,11 @@ The `src/lib` directory and its corresponding `Ibexa\` namespace ar Examples: -```php skip-validation +```php {skip-validation} namespace Ibexa\Search; ``` -```php skip-validation +```php {skip-validation} namespace Ibexa\Commerce\Shop; ``` @@ -67,7 +67,7 @@ namespace Ibexa\Commerce\Shop; The bundle class definition in the `src/bundle` directory must be: -```php skip-validation +```php {skip-validation} namespace Ibexa\Bundle\; class Ibexa[ProductGroup]Bundle // ... @@ -76,13 +76,13 @@ class Ibexa[ProductGroup]Bundle // ... Examples: -```php skip-validation +```php {skip-validation} namespace Ibexa\Bundle\Search; class IbexaSearchBundle // ... ``` -```php skip-validation +```php {skip-validation} namespace Ibexa\Bundle\Commerce\Shop; class IbexaCommerceShopBundle // ... @@ -92,21 +92,21 @@ class IbexaCommerceShopBundle // ... A package may introduce a namespace for contracts, to be consumed by first and third party packages and projects, which must be prefixed as: -```php skip-validation +```php {skip-validation} namespace Ibexa\Contracts; ``` Examples: -```php skip-validation +```php {skip-validation} namespace Ibexa\Contracts\Kernel; ``` -```php skip-validation +```php {skip-validation} namespace Ibexa\Contracts\SiteFactory; ``` -```php skip-validation +```php {skip-validation} namespace Ibexa\Contracts\Commerce\Shop; ``` diff --git a/docs/search/search_engines/solr_search_engine/configure_solr.md b/docs/search/search_engines/solr_search_engine/configure_solr.md index 74040d9b86..d5108436d9 100644 --- a/docs/search/search_engines/solr_search_engine/configure_solr.md +++ b/docs/search/search_engines/solr_search_engine/configure_solr.md @@ -72,7 +72,7 @@ The configuration above results in the following boosting (content type / Field) The second step requires you to use `\Novactive\EzSolrSearchExtra\Query\Content\Criterion\MultipleFieldsFullText` instead of default `\Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\FullText`. The following example shows custom query which benefits from the custom fields created in the previous example. - ```php skip-validation + ```php {skip-validation} setLimit(5); $aggregation->setMinCount(10); diff --git a/docs/update_and_migration/from_1.x_2.x/update_db_to_2.5.md b/docs/update_and_migration/from_1.x_2.x/update_db_to_2.5.md index 6767fbee13..9a89b936a6 100644 --- a/docs/update_and_migration/from_1.x_2.x/update_db_to_2.5.md +++ b/docs/update_and_migration/from_1.x_2.x/update_db_to_2.5.md @@ -197,7 +197,7 @@ defined in the [Enterprise Beginner tutorial](page_and_form_tutorial.md) `src/AppBundle/Block/RandomBlock.php`: - ``` php skip-validation + ``` php {skip-validation} ['all' => true], Ibexa\Bundle\Checkout\IbexaCheckoutBundle::class => ['all' => true], Ibexa\Bundle\Storefront\IbexaStorefrontBundle::class => ['all' => true], diff --git a/docs/update_and_migration/migrate_to_ibexa_dxp/migrating_from_ez_publish_platform.md b/docs/update_and_migration/migrate_to_ibexa_dxp/migrating_from_ez_publish_platform.md index a489352eae..8c644e2475 100644 --- a/docs/update_and_migration/migrate_to_ibexa_dxp/migrating_from_ez_publish_platform.md +++ b/docs/update_and_migration/migrate_to_ibexa_dxp/migrating_from_ez_publish_platform.md @@ -582,7 +582,7 @@ To use the script, do the following: **2.** Add `ezflow-migration-toolkit` to `AppKernel.php`. -``` php skip-validation +``` php {skip-validation} // AppKernel.php new EzSystems\EzFlowMigrationToolkitBundle\EzSystemsEzFlowMigrationToolkitBundle() ``` @@ -618,7 +618,7 @@ You can see a report summarizing the results of the migration. **6.** Add `MigrationBundle` to `AppKernel.php`. -``` php skip-validation +``` php {skip-validation} // AppKernel.php new MigrationBundle\MigrationBundle() ```