Skip to content

Commit

Permalink
remove inheritdoc PHPDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Jan 11, 2024
1 parent c15749d commit d2f5e74
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 62 deletions.
12 changes: 0 additions & 12 deletions core/file-upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,6 @@ final class MultipartDecoder implements DecoderInterface

public function __construct(private RequestStack $requestStack) {}

/**
* {@inheritdoc}
*/
public function decode(string $data, string $format, array $context = []): ?array
{
$request = $this->requestStack->getCurrentRequest();
Expand All @@ -427,9 +424,6 @@ final class MultipartDecoder implements DecoderInterface
}, $request->request->all()) + $request->files->all();
}

/**
* {@inheritdoc}
*/
public function supportsDecoding(string $format): bool
{
return self::FORMAT === $format;
Expand All @@ -452,17 +446,11 @@ use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;

final class UploadedFileDenormalizer implements DenormalizerInterface
{
/**
* {@inheritdoc}
*/
public function denormalize($data, string $type, string $format = null, array $context = []): UploadedFile
{
return $data;
}

/**
* {@inheritdoc}
*/
public function supportsDenormalization($data, $type, $format = null): bool
{
return $data instanceof UploadedFile;
Expand Down
29 changes: 1 addition & 28 deletions core/graphql.md
Original file line number Diff line number Diff line change
Expand Up @@ -888,9 +888,6 @@ final class WriteStage implements WriteStageInterface
$this->writeStage = $writeStage;
}
/**
* {@inheritdoc}
*/
public function __invoke($data, string $resourceClass, string $operationName, array $context)
{
// You can add pre-write code here.
Expand Down Expand Up @@ -2192,9 +2189,6 @@ final class ErrorHandler implements ErrorHandlerInterface
$this->defaultErrorHandler = $defaultErrorHandler;
}
/**
* {@inheritdoc}
*/
public function __invoke(array $errors, callable $formatter): array
{
// Log or filter the errors.
Expand Down Expand Up @@ -2285,9 +2279,6 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
final class MyExceptionNormalizer implements NormalizerInterface
{
/**
* {@inheritdoc}
*/
public function normalize($object, $format = null, array $context = []): array
{
$exception = $object->getPrevious();
Expand All @@ -2299,9 +2290,6 @@ final class MyExceptionNormalizer implements NormalizerInterface
return $error;
}
/**
* {@inheritdoc}
*/
public function supportsNormalization($data, $format = null): bool
{
return $data instanceof Error && $data->getPrevious() instanceof MyException;
Expand Down Expand Up @@ -2486,9 +2474,6 @@ final class DateTimeType extends ScalarType implements TypeInterface
return $this->name;
}

/**
* {@inheritdoc}
*/
public function serialize($value)
{
// Already serialized.
Expand All @@ -2503,10 +2488,7 @@ final class DateTimeType extends ScalarType implements TypeInterface
return $value->format(\DateTime::ATOM);
}

/**
* {@inheritdoc}
*/
public function parseValue($value)
public function parseValue($value)
{
if (!\is_string($value)) {
throw new Error(sprintf('DateTime cannot represent non string value: %s', Utils::printSafeJson($value)));
Expand All @@ -2520,9 +2502,6 @@ final class DateTimeType extends ScalarType implements TypeInterface
return $value;
}

/**
* {@inheritdoc}
*/
public function parseLiteral($valueNode, ?array $variables = null)
{
if ($valueNode instanceof StringValueNode && false !== \DateTime::createFromFormat(\DateTime::ATOM, $valueNode->value)) {
Expand Down Expand Up @@ -2593,9 +2572,6 @@ final class TypeConverter implements TypeConverterInterface
$this->defaultTypeConverter = $defaultTypeConverter;
}
/**
* {@inheritdoc}
*/
public function convertType(Type $type, bool $input, Operation $rootOperation, string $resourceClass, string $rootResource, ?string $property, int $depth)
{
if ('publicationDate' === $property
Expand All @@ -2607,9 +2583,6 @@ final class TypeConverter implements TypeConverterInterface
return $this->defaultTypeConverter->convertType($type, $input, $rootOperation, $resourceClass, $rootResource, $property, $depth);
}
/**
* {@inheritdoc}
*/
public function resolveType(string $type): ?GraphQLType
{
return $this->defaultTypeConverter->resolveType($type);
Expand Down
5 changes: 2 additions & 3 deletions core/identifiers.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Let's create a `Provider` for the `Person` entity:

```php
<?php
// api/src/State/PersonProvider.php
namespace App\State;

use App\Entity\Person;
Expand All @@ -71,9 +72,6 @@ use App\Uuid;

final class PersonProvider implements ProviderInterface
{
/**
* {@inheritDoc}
*/
public function provide(Operation $operation, array $uriVariables = [], array $context = [])
{
// Our identifier is:
Expand All @@ -89,6 +87,7 @@ This case is covered by an URI variable transformer:

```php
<?php
// api/src/Identifier/UuidUriVariableTransformer.php
namespace App\Identifier;

use ApiPlatform\Api\UriVariableTransformerInterface;
Expand Down
10 changes: 4 additions & 6 deletions core/serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -594,19 +594,13 @@ class PlainIdentifierDenormalizer implements ContextAwareDenormalizerInterface,
$this->iriConverter = $iriConverter;
}
/**
* {@inheritdoc}
*/
public function denormalize($data, $class, $format = null, array $context = [])
{
$data['relatedDummy'] = $this->iriConverter->getIriFromResource(resource: RelatedDummy::class, context: ['uri_variables' => ['id' => $data['relatedDummy']]]);
return $this->denormalizer->denormalize($data, $class, $format, $context + [__CLASS__ => true]);
}
/**
* {@inheritdoc}
*/
public function supportsDenormalization($data, $type, $format = null, array $context = []): bool
{
return \in_array($format, ['json', 'jsonld'], true) && is_a($type, Dummy::class, true) && !empty($data['relatedDummy']) && !isset($context[__CLASS__]);
Expand All @@ -624,6 +618,7 @@ For instance:
```php
<?php
// api/src/Entity/Book.php
namespace App\Entity;
use ApiPlatform\Metadata\ApiResource;
Expand Down Expand Up @@ -657,6 +652,7 @@ It's also possible to only change the denormalization or normalization context:
```php
<?php
// api/src/Entity/Book.php
namespace App\Entity;
use ApiPlatform\Metadata\ApiResource;
Expand All @@ -679,6 +675,7 @@ Groups are also supported:
```php
<?php
// api/src/Entity/Book.php
namespace App\Entity;
use ApiPlatform\Metadata\ApiResource;
Expand Down Expand Up @@ -711,6 +708,7 @@ Sometimes you need to expose calculated fields. This can be done by leveraging t
```php
<?php
// api/src/Entity/Greeting.php
namespace App\Entity;
use ApiPlatform\Metadata\ApiResource;
Expand Down
9 changes: 6 additions & 3 deletions core/state-processors.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Here is an implementation example:

```php
<?php
// api/src/State/BlogPostProcessor.php

namespace App\State;

Expand All @@ -42,9 +43,6 @@ use ApiPlatform\State\ProcessorInterface;

class BlogPostProcessor implements ProcessorInterface
{
/**
* {@inheritDoc}
*/
public function process($data, Operation $operation, array $uriVariables = [], array $context = [])
{
// call your persistence layer to save $data
Expand All @@ -57,6 +55,7 @@ We then configure our operation to use this processor:

```php
<?php
// api/src/Entity/BlogPost.php

namespace App\Entity;

Expand All @@ -74,6 +73,7 @@ Otherwise, if you use a custom dependency injection configuration, you need to r

```yaml
# api/config/services.yaml

services:
# ...
App\State\BlogPostProcessor: ~
Expand All @@ -91,6 +91,7 @@ Here is an implementation example which sends new users a welcome email after a

```php
<?php
// api/src/Sate/UserProcessor.php

namespace App\State;

Expand Down Expand Up @@ -129,6 +130,7 @@ Even with service autowiring and autoconfiguration enabled, you must still confi

```yaml
# api/config/services.yaml

services:
# ...
App\State\UserProcessor:
Expand All @@ -147,6 +149,7 @@ And configure that you want to use this processor on the User resource:

```php
<?php
// api/src/Entity/User.php

namespace App\Entity;

Expand Down
16 changes: 9 additions & 7 deletions core/state-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ First, your `BlogPostProvider` has to implement the

```php
<?php
// api/src/State/BlogPostProvider.php

namespace App\State;

Expand All @@ -42,9 +43,6 @@ use ApiPlatform\State\ProviderInterface;

final class BlogPostProvider implements ProviderInterface
{
/**
* {@inheritDoc}
*/
public function provide(Operation $operation, array $uriVariables = [], array $context = [])
{
return new BlogPost($uriVariables['id']);
Expand All @@ -59,6 +57,7 @@ To use this provider we need to configure the provider on the operation:

```php
<?php
// api/src/Entity/BlogPost.php

namespace App\Entity;

Expand All @@ -75,6 +74,7 @@ To declare the service explicitly, you can use the following snippet:

```yaml
# api/config/services.yaml

services:
# ...
App\State\BlogPostProvider: ~
Expand All @@ -87,6 +87,7 @@ supporting a wider range of operations. Then we can provide a collection of blog

```php
<?php
// api/src/State/BlogPostProvider.php

namespace App\State;

Expand All @@ -97,10 +98,7 @@ use ApiPlatform\Metadata\CollectionOperationInterface;

final class BlogPostProvider implements ProviderInterface
{
/**
* {@inheritDoc}
*/
public function provide(Operation $operation, array $uriVariables = [], array $context = [])
public function provide(@Operation $operation, array $uriVariables = [], array $context = [])
{
if ($operation instanceof CollectionOperationInterface) {
return [new BlogPost(), new BlogPost()];
Expand All @@ -115,6 +113,7 @@ We then need to configure this same provider on the BlogPost `GetCollection` ope

```php
<?php
// api/src/Entity/BlogPost.php

namespace App\Entity;

Expand All @@ -133,6 +132,7 @@ The next example uses a [DTO](https://api-platform.com/docs/core/dto/#using-data

```php
<?php
// api/src/State/BlogPostProvider.php

namespace App\State;

Expand Down Expand Up @@ -163,6 +163,7 @@ Even with service autowiring and autoconfiguration enabled, you must still confi

```yaml
# api/config/services.yaml

services:
# ...
App\State\BookRepresentationProvider:
Expand All @@ -176,6 +177,7 @@ And configure that you want to use this provider on the Book resource:

```php
<?php
// api/src/Entity/Book.php

namespace App\Entity;

Expand Down
3 changes: 0 additions & 3 deletions core/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,6 @@ final class AdminGroupsGenerator implements ValidationGroupsGeneratorInterface
$this->authorizationChecker = $authorizationChecker;
}

/**
* {@inheritdoc}
*/
public function __invoke($book): array
{
assert($book instanceof Book);
Expand Down

0 comments on commit d2f5e74

Please sign in to comment.