Skip to content

Commit 414f306

Browse files
committed
Fixed issues
1 parent a67efbb commit 414f306

5 files changed

Lines changed: 23 additions & 21 deletions

File tree

code_samples/api/graphql/src/GraphQL/Schema/MyFieldDefinitionMapper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ protected function getFieldTypeIdentifier(): string
1515
return 'my_field_type';
1616
}
1717

18+
#[\Override]
1819
public function mapToFieldValueInputType(ContentType $contentType, FieldDefinition $fieldDefinition): ?string
1920
{
2021
if (!$this->canMap($fieldDefinition)) {

code_samples/catalog/custom_catalog_filter/src/CatalogFilter/DataTransformer/ProductNameCriterionTransformer.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
use Symfony\Component\Form\DataTransformerInterface;
99
use Symfony\Component\Form\Exception\TransformationFailedException;
1010

11+
/**
12+
* @implements \Symfony\Component\Form\DataTransformerInterface<
13+
* \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductName,
14+
* \Ibexa\Bundle\ProductCatalog\Form\Data\Catalog\CatalogFilterPriceData
15+
* >
16+
*/
1117
final class ProductNameCriterionTransformer implements DataTransformerInterface
1218
{
1319
public function transform($value): ?string

deptrac.baseline.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ deptrac:
174174
- Ibexa\Bundle\Checkout\Form\Type\AddressType
175175
- Ibexa\Bundle\Payment\Form\Type\PaymentMethodChoiceType
176176
- Ibexa\Bundle\Shipping\Form\Type\ShippingMethodChoiceType
177-
App\GraphQL\Schema\MyCustomFieldDefinitionMapper:
177+
App\GraphQL\Schema\MyFieldDefinitionMapper:
178178
- Ibexa\GraphQL\Schema\Domain\Content\Mapper\FieldDefinition\DecoratingFieldDefinitionMapper
179179
App\Migrations\Action\AssignSection:
180180
- Ibexa\Migration\ValueObject\Step\Action

docs/api/graphql/graphql_custom_ft.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ It requires that you implement the `getFieldTypeIdentifier` method to tell which
6060
Add `MyFieldDefinitionMapper.php` mapper to `src/GraphQL/Schema`:
6161

6262
``` php
63-
[[= 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) =]]
63+
[[= include_code('code_samples/api/graphql/src/GraphQL/Schema/MyFieldDefinitionMapper.php', 1, 17) =]]
64+
[[= include_code('code_samples/api/graphql/src/GraphQL/Schema/MyFieldDefinitionMapper.php', 38, 39) =]]
6465
```
6566

6667
The `FieldDefinitionMapper` interface defines following methods:
@@ -75,7 +76,7 @@ When a mapper method is decorated, you need to call the decorated service method
7576
To do that, you need to replace `mapXXX` by the method it's in:
7677

7778
```php
78-
[[= include_code('code_samples/api/graphql/src/GraphQL/Schema/MyFieldDefinitionMapper.php', 20, 22, remove_indent=True) =]]
79+
[[= include_code('code_samples/api/graphql/src/GraphQL/Schema/MyFieldDefinitionMapper.php', 21, 24, remove_indent=True) =]]
7980
```
8081

8182
It's required for every implemented method, so that other mappers are called for the other field types.

phpstan-baseline.neon

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ parameters:
3030
count: 1
3131
path: code_samples/api/migration/src/Command/MigrationCommand.php
3232

33+
-
34+
message: '#^Instantiated class App\\Notifications\\MyNotification not found\.$#'
35+
identifier: class.notFound
36+
count: 1
37+
path: code_samples/api/notifications/notification_send.php
38+
39+
-
40+
message: '#^Parameter \#1 \$notification of class Ibexa\\Contracts\\Notifications\\Value\\Notification\\SymfonyNotificationAdapter constructor expects Symfony\\Component\\Notifier\\Notification\\Notification, App\\Notifications\\MyNotification given\.$#'
41+
identifier: argument.type
42+
count: 1
43+
path: code_samples/api/notifications/notification_send.php
44+
3345
-
3446
message: '#^Call to an undefined method Ibexa\\Contracts\\ProductCatalog\\Values\\ProductInterface\:\:getPrice\(\)\.$#'
3547
identifier: method.notFound
@@ -312,12 +324,6 @@ parameters:
312324
count: 1
313325
path: code_samples/catalog/custom_attribute_type/src/Attribute/Percent/Storage/PercentStorageConverter.php
314326

315-
-
316-
message: '#^Class App\\CatalogFilter\\DataTransformer\\ProductNameCriterionTransformer implements generic interface Symfony\\Component\\Form\\DataTransformerInterface but does not specify its types\: T, R$#'
317-
identifier: missingType.generics
318-
count: 1
319-
path: code_samples/catalog/custom_catalog_filter/src/CatalogFilter/DataTransformer/ProductNameCriterionTransformer.php
320-
321327
-
322328
message: '#^Method App\\CatalogFilter\\ProductNameFilter\:\:getTranslationMessages\(\) return type has no value type specified in iterable type array\.$#'
323329
identifier: missingType.iterableValue
@@ -678,18 +684,6 @@ parameters:
678684
count: 1
679685
path: code_samples/tutorials/page_tutorial_starting_point/src/QueryType/MenuQueryType.php
680686

681-
-
682-
message: '#^Instantiated class App\\Notifications\\MyNotification not found\.$#'
683-
identifier: class.notFound
684-
count: 1
685-
path: code_samples/user_management/notifications/notification_send.php
686-
687-
-
688-
message: '#^Parameter \#1 \$notification of class Ibexa\\Contracts\\Notifications\\Value\\Notification\\SymfonyNotificationAdapter constructor expects Symfony\\Component\\Notifier\\Notification\\Notification, App\\Notifications\\MyNotification given\.$#'
689-
identifier: argument.type
690-
count: 1
691-
path: code_samples/user_management/notifications/notification_send.php
692-
693687
-
694688
message: '#^Parameter \#2 \$email of method Ibexa\\Contracts\\OAuth2Client\\Repository\\OAuth2UserService\:\:newOAuth2UserCreateStruct\(\) expects string, string\|null given\.$#'
695689
identifier: argument.type

0 commit comments

Comments
 (0)