Skip to content

Commit

Permalink
refactor: [5.x] finalize class (#2394)
Browse files Browse the repository at this point in the history
## Description

Make classes marked with `@final` final

#2215

## What type of PR is this? (check all applicable)
- [ ] Bug Fix
- [ ] Feature
- [x] Refactor
- [ ] Deprecation
- [x] Breaking Change
- [ ] Documentation Update
- [ ] CI

## Checklist
- [ ] I have made corresponding changes to the documentation (`docs/`)
- [ ] I have made corresponding changes to the changelog
(`CHANGELOG.md`)
  • Loading branch information
DjordyKoert authored Nov 15, 2024
1 parent abd21f3 commit 006cba9
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 13 deletions.
14 changes: 13 additions & 1 deletion UPGRADE-5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,16 @@ Future proofing for potential future changes and keeping it consistent with `des
```diff
- public function supports(array $types): bool;
+ public function supports(array $types, array $context = []): bool;
```
```

## BC BREAK: `Nelmio\ApiDocBundle\Command` has been made final

## BC BREAK: Made classes implementing `Nelmio\ApiDocBundle\PropertyDescriber\PropertyDescriberInterface` final
`Nelmio\ApiDocBundle\PropertyDescriber\ArrayPropertyDescriber`
`Nelmio\ApiDocBundle\PropertyDescriber\BooleanPropertyDescriber`
`Nelmio\ApiDocBundle\PropertyDescriber\DateTimePropertyDescriber`
`Nelmio\ApiDocBundle\PropertyDescriber\CompoundPropertyDescriber`
`Nelmio\ApiDocBundle\PropertyDescriber\FloatPropertyDescriber`
`Nelmio\ApiDocBundle\PropertyDescriber\IntegerPropertyDescriber`
`Nelmio\ApiDocBundle\PropertyDescriber\ObjectPropertyDescriber`
`Nelmio\ApiDocBundle\PropertyDescriber\StringPropertyDescriber`
5 changes: 1 addition & 4 deletions src/Command/DumpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

/**
* @final
*/
class DumpCommand extends Command
final class DumpCommand extends Command
{
private RenderOpenApi $renderOpenApi;

Expand Down
2 changes: 1 addition & 1 deletion src/PropertyDescriber/ArrayPropertyDescriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use OpenApi\Annotations as OA;
use Symfony\Component\PropertyInfo\Type;

class ArrayPropertyDescriber implements PropertyDescriberInterface, ModelRegistryAwareInterface, PropertyDescriberAwareInterface
final class ArrayPropertyDescriber implements PropertyDescriberInterface, ModelRegistryAwareInterface, PropertyDescriberAwareInterface
{
use ModelRegistryAwareTrait;
use PropertyDescriberAwareTrait;
Expand Down
2 changes: 1 addition & 1 deletion src/PropertyDescriber/BooleanPropertyDescriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use OpenApi\Annotations as OA;
use Symfony\Component\PropertyInfo\Type;

class BooleanPropertyDescriber implements PropertyDescriberInterface
final class BooleanPropertyDescriber implements PropertyDescriberInterface
{
/**
* @param array<string, mixed> $context Context options for describing the property
Expand Down
2 changes: 1 addition & 1 deletion src/PropertyDescriber/CompoundPropertyDescriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use OpenApi\Annotations as OA;
use OpenApi\Generator;

class CompoundPropertyDescriber implements PropertyDescriberInterface, ModelRegistryAwareInterface, PropertyDescriberAwareInterface
final class CompoundPropertyDescriber implements PropertyDescriberInterface, ModelRegistryAwareInterface, PropertyDescriberAwareInterface
{
use ModelRegistryAwareTrait;
use PropertyDescriberAwareTrait;
Expand Down
2 changes: 1 addition & 1 deletion src/PropertyDescriber/DateTimePropertyDescriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use OpenApi\Annotations as OA;
use Symfony\Component\PropertyInfo\Type;

class DateTimePropertyDescriber implements PropertyDescriberInterface
final class DateTimePropertyDescriber implements PropertyDescriberInterface
{
/**
* @param array<string, mixed> $context Context options for describing the property
Expand Down
2 changes: 1 addition & 1 deletion src/PropertyDescriber/FloatPropertyDescriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use OpenApi\Annotations as OA;
use Symfony\Component\PropertyInfo\Type;

class FloatPropertyDescriber implements PropertyDescriberInterface
final class FloatPropertyDescriber implements PropertyDescriberInterface
{
/**
* @param array<string, mixed> $context Context options for describing the property
Expand Down
2 changes: 1 addition & 1 deletion src/PropertyDescriber/IntegerPropertyDescriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use OpenApi\Annotations as OA;
use Symfony\Component\PropertyInfo\Type;

class IntegerPropertyDescriber implements PropertyDescriberInterface
final class IntegerPropertyDescriber implements PropertyDescriberInterface
{
/**
* @param array<string, mixed> $context Context options for describing the property
Expand Down
2 changes: 1 addition & 1 deletion src/PropertyDescriber/ObjectPropertyDescriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use OpenApi\Annotations as OA;
use Symfony\Component\PropertyInfo\Type;

class ObjectPropertyDescriber implements PropertyDescriberInterface, ModelRegistryAwareInterface
final class ObjectPropertyDescriber implements PropertyDescriberInterface, ModelRegistryAwareInterface
{
use ModelRegistryAwareTrait;

Expand Down
2 changes: 1 addition & 1 deletion src/PropertyDescriber/StringPropertyDescriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use OpenApi\Annotations as OA;
use Symfony\Component\PropertyInfo\Type;

class StringPropertyDescriber implements PropertyDescriberInterface
final class StringPropertyDescriber implements PropertyDescriberInterface
{
/**
* @param array<string, mixed> $context Context options for describing the property
Expand Down

0 comments on commit 006cba9

Please sign in to comment.