Skip to content

Commit a846587

Browse files
authored
Merge pull request #842 from mlaopane/patch-2
Fix dto.md
2 parents 6ca7140 + 62028f3 commit a846587

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

core/dto.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ We can transform the `BookInput` to a `Book` resource instance:
8787
namespace App\DataTransformer;
8888
8989
use ApiPlatform\Core\DataTransformer\DataTransformerInterface;
90-
use App\Dto\BookInput;
90+
use App\Entity\Book;
9191
9292
final class BookInputDataTransformer implements DataTransformerInterface
9393
{
@@ -220,7 +220,7 @@ namespace App\DataTransformer;
220220
221221
use ApiPlatform\Core\DataTransformer\DataTransformerInterface;
222222
use ApiPlatform\Core\Serializer\AbstractItemNormalizer;
223-
use App\Dto\BookInput;
223+
use App\Entity\Book;
224224
225225
final class BookInputDataTransformer implements DataTransformerInterface
226226
{
@@ -313,7 +313,6 @@ namespace App\DataTransformer;
313313
314314
use ApiPlatform\Core\DataTransformer\DataTransformerInterface;
315315
use ApiPlatform\Core\Validator\ValidatorInterface;
316-
use App\Dto\BookInput;
317316
use App\Entity\Book;
318317
319318
final class BookInputDataTransformer implements DataTransformerInterface
@@ -326,7 +325,7 @@ final class BookInputDataTransformer implements DataTransformerInterface
326325
}
327326
328327
/**
329-
* @param BookInput $data
328+
* {@inheritdoc}
330329
*/
331330
public function transform($data, string $to, array $context = []): Book
332331
{
@@ -337,6 +336,9 @@ final class BookInputDataTransformer implements DataTransformerInterface
337336
return $book;
338337
}
339338
339+
/**
340+
* {@inheritdoc}
341+
*/
340342
public function supportsTransformation($data, string $to, array $context = []): bool
341343
{
342344
if ($data instanceof Book) {
@@ -346,4 +348,4 @@ final class BookInputDataTransformer implements DataTransformerInterface
346348
return Book::class === $to && null !== ($context['input']['class'] ?? null);
347349
}
348350
}
349-
```
351+
```

0 commit comments

Comments
 (0)