Skip to content

Commit f4fbb1d

Browse files
committed
Fixed issues
1 parent 5130e55 commit f4fbb1d

4 files changed

Lines changed: 18 additions & 16 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)) {

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: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ If not specified, it uses `FieldDefinition`.
4040

4141
Compiler pass example that should be placed in `src/DependencyInjection/Compiler`:
4242

43-
``` php
43+
``` php skip-validation
4444
[[= include_file('code_samples/api/graphql/src/DependencyInjection/Compiler/MyCustomTypeGraphQLCompilerPass.php') =]]
4545
```
4646

@@ -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_file('code_samples/api/graphql/src/GraphQL/Schema/MyFieldDefinitionMapper.php', 19, 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 & 12 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
@@ -678,18 +690,6 @@ parameters:
678690
count: 1
679691
path: code_samples/tutorials/page_tutorial_starting_point/src/QueryType/MenuQueryType.php
680692

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-
693693
-
694694
message: '#^Parameter \#2 \$email of method Ibexa\\Contracts\\OAuth2Client\\Repository\\OAuth2UserService\:\:newOAuth2UserCreateStruct\(\) expects string, string\|null given\.$#'
695695
identifier: argument.type

0 commit comments

Comments
 (0)