Skip to content

Commit

Permalink
Line offset fixes (#2430)
Browse files Browse the repository at this point in the history
* checkout_api.md: Fix included lines after PHPStan fixes

* price_api.md: Fix included lines after PHPStan fixes

The confirmation output at the end of "Resolve prices" example was missing.

* create_custom_attribute_type.md: Fix highlighted line

Two lines removed in 086b885 but the highlighted line wasn't updated.

* search_api.md: Use `ContentTypeTermAggregation` lines

* oauth_client.md: Fix PROVIDER_PREFIX highlight

* segment_api.md: Fix highlighted line

One line added in aeee20a but the highlighted line wasn't updated.

(renaming from docs/api/public_php_api_managing_users.md to docs/users/segment_api.md in a9031bd)

* segment_api.md: Fix highlighted lines

One line added in aeee20a but the highlighted line wasn't updated.

(renaming from docs/api/public_php_api_managing_users.md to docs/users/segment_api.md in a9031bd)

* segment_api.md: Fix loadSegmentByIdentifier example intro

* search_api.md: Fix #sorting-results offset

* cart_api.md: Add missing EOF new line
  • Loading branch information
adriendupuis authored Jul 15, 2024
1 parent 43349f5 commit 35ef89b
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docs/commerce/cart/cart_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,4 @@ This operation is helpful when you want to consolidate items from a reorder cart
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 151, 154) =]]
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 155, 161) =]]
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 162, 164) =]]
```
```
10 changes: 5 additions & 5 deletions docs/commerce/checkout/checkout_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ From the developer's perspective, checkouts are referenced with an UUID identifi
To access a single checkout, use the `CheckoutServiceInterface::getCheckout` method:

``` php
[[= include_file('code_samples/api/commerce/src/Controller/CustomCheckoutController.php', 31, 32) =]]
[[= include_file('code_samples/api/commerce/src/Controller/CustomCheckoutController.php', 32, 33) =]]
```

## Get single checkout for specific cart
Expand All @@ -35,7 +35,7 @@ It can be useful when you want to initiate the checkout process right after
products are successfully added to a cart.

``` php
[[= include_file('code_samples/api/commerce/src/Controller/CustomCheckoutController.php', 25, 29) =]]
[[= include_file('code_samples/api/commerce/src/Controller/CustomCheckoutController.php', 26, 30) =]]
```

## Create checkout
Expand All @@ -44,7 +44,7 @@ To create a checkout, use the `CheckoutServiceInterface::createCheckout` method
provide it with a `CheckoutCreateStruct` struct that contains a `CartInterface` object.

``` php
[[= include_file('code_samples/api/commerce/src/Controller/CustomCheckoutController.php', 34, 40) =]]
[[= include_file('code_samples/api/commerce/src/Controller/CustomCheckoutController.php', 35, 41) =]]
```

## Update checkout
Expand All @@ -60,13 +60,13 @@ step of the workflow, as well as a transition name to identify what step will fo
All data is placed in session storage.

``` php
[[= include_file('code_samples/api/commerce/src/Controller/CustomCheckoutController.php', 42, 44) =]]
[[= include_file('code_samples/api/commerce/src/Controller/CustomCheckoutController.php', 43, 45) =]]
```

## Delete checkout

To delete a checkout from the session, use the `CheckoutServiceInterface::deleteCheckout` method:

``` php
[[= include_file('code_samples/api/commerce/src/Controller/CustomCheckoutController.php', 46, 47) =]]
[[= include_file('code_samples/api/commerce/src/Controller/CustomCheckoutController.php', 47, 48) =]]
```
4 changes: 2 additions & 2 deletions docs/pim/create_custom_attribute_type.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ A form mapper maps the data entered in an editing form into an attribute value.

The form mapper must implement `Ibexa\Contracts\ProductCatalog\Local\Attribute\ValueFormMapperInterface`.

In this example, you can use the Symfony's built-in `PercentType` class (line 42).
In this example, you can use the Symfony's built-in `PercentType` class (line 40).

``` php hl_lines="42"
``` php hl_lines="40"
[[= include_file('code_samples/catalog/custom_attribute_type/src/Attribute/Percent/Form/PercentValueFormMapper.php') =]]
```

Expand Down
4 changes: 2 additions & 2 deletions docs/pim/price_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ To resolve a price of a product in the currency for the current context, use eit
[[= include_file('code_samples/api/product_catalog/src/Command/ProductPriceCommand.php', 7, 8) =]][[= include_file('code_samples/api/product_catalog/src/Command/ProductPriceCommand.php', 11, 12) =]]

// ...
[[= include_file('code_samples/api/product_catalog/src/Command/ProductPriceCommand.php', 110, 114) =]]
[[= include_file('code_samples/api/product_catalog/src/Command/ProductPriceCommand.php', 111, 115) =]]
```

## VAT
Expand All @@ -105,4 +105,4 @@ To get a single VAT category, use `VatServiceInterface::getVatCategoryByIdentifi

``` php
[[= include_file('code_samples/api/product_catalog/src/Command/VatCommand.php', 57, 59) =]]
```
```
4 changes: 2 additions & 2 deletions docs/search/search_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ For example, to order search results by their publicationg date, from oldest to
and then alphabetically by content name, add the following Sort Clauses to the query:

``` php
[[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 54, 58) =]]
[[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 55, 59) =]]
```

!!! tip
Expand Down Expand Up @@ -337,7 +337,7 @@ With aggregations you can find the count of search results or other result infor
To do this, you use of the query's `$aggregations` property:

``` php
[[= include_file('code_samples/api/public_php_api/src/Command/FindWithAggregationCommand.php', 39, 40) =]]
[[= include_file('code_samples/api/public_php_api/src/Command/FindWithAggregationCommand.php', 34, 39) =]]
```

The name of the aggregation must be unique in the given query.
Expand Down
2 changes: 1 addition & 1 deletion docs/users/oauth_client.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ based on the information from `resourceOwner`, that's the OAuth2 authorization s

The new username is set with a `google:` prefix (lines 19, 109), to avoid conflicts with users registered in a regular way.

``` php hl_lines="19 54 64 109"
``` php hl_lines="20 54 64 109"
[[= include_file('code_samples/user_management/oauth_google/src/OAuth/GoogleResourceOwnerMapper.php') =]]
```

Expand Down
12 changes: 6 additions & 6 deletions docs/users/segment_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ To load a Segment Group, use `SegmentationService::loadSegmentGroupByIdentifier(
Get all Segments assigned to the group with `SegmentationService::loadSegmentsAssignedToGroup()`:

``` php
[[= include_file('code_samples/api/public_php_api/src/Command/SegmentCommand.php', 53, 60) =]]
[[= include_file('code_samples/api/public_php_api/src/Command/SegmentCommand.php', 54, 62) =]]
```

Similarly, you can load a Segment in a group by using `SegmentationService::loadSegmentIdentifier()`:
Similarly, you can load a Segment by using `SegmentationService::loadSegmentByIdentifier()`:

``` php
[[= include_file('code_samples/api/public_php_api/src/Command/SegmentCommand.php', 62, 63) =]]
Expand All @@ -29,15 +29,15 @@ Similarly, you can load a Segment in a group by using `SegmentationService::load
You can check whether a User is assigned to a Segment with `SegmentationService::isUserAssignedToSegment()`:

``` php
[[= include_file('code_samples/api/public_php_api/src/Command/SegmentCommand.php', 65, 69) =]]
[[= include_file('code_samples/api/public_php_api/src/Command/SegmentCommand.php', 66, 71) =]]
```

## Assigning Users

To assign a User to a Segment, use `SegmentationService::assignUserToSegment()`:

``` php
[[= include_file('code_samples/api/public_php_api/src/Command/SegmentCommand.php', 64, 66) =]]
[[= include_file('code_samples/api/public_php_api/src/Command/SegmentCommand.php', 64, 65) =]]
```

## Creating Segments
Expand All @@ -48,14 +48,14 @@ To create a Segment Group, use `SegmentationService::createSegmentGroup()`
and provide it with a `SegmentGroupCreateStruct`:

``` php
[[= include_file('code_samples/api/public_php_api/src/Command/SegmentCommand.php', 37, 44) =]]
[[= include_file('code_samples/api/public_php_api/src/Command/SegmentCommand.php', 38, 45) =]]
```

To add a Segment, use `SegmentationService::createSegment()`
and provide it with a `SegmentCreateStruct`, which takes an existing group as one of the parameters:

``` php
[[= include_file('code_samples/api/public_php_api/src/Command/SegmentCommand.php', 45, 52) =]]
[[= include_file('code_samples/api/public_php_api/src/Command/SegmentCommand.php', 46, 53) =]]
```

## Updating Segments
Expand Down

0 comments on commit 35ef89b

Please sign in to comment.