Skip to content

Commit 1dcfba2

Browse files
committed
Declare most classes as final
Most of our classes are not meant to be extended, and to prevent possible future breaking change we prefer to prevent extending from them and instead promote the discussion about use cases and potential extension points.
1 parent 3022ce2 commit 1dcfba2

File tree

70 files changed

+81
-81
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+81
-81
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ use GraphQL\Doctrine\Annotation as API;
414414
* @API\Filter(field="custom", operator="GraphQLTests\Doctrine\Blog\Filtering\Search", type="string")
415415
* })
416416
*/
417-
class Post extends AbstractModel
417+
final class Post extends AbstractModel
418418
```
419419

420420
#### Custom sorting
@@ -435,7 +435,7 @@ use GraphQL\Doctrine\Annotation as API;
435435
* @ORM\Entity
436436
* @API\Sorting({"GraphQLTests\Doctrine\Blog\Sorting\UserName"})
437437
*/
438-
class Post extends AbstractModel
438+
final class Post extends AbstractModel
439439
```
440440
## Limitations
441441

src/Annotation/Argument.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
* @Attribute("defaultValue", required=false, type="mixed"),
2222
* })
2323
*/
24-
class Argument extends AbstractAnnotation
24+
final class Argument extends AbstractAnnotation
2525
{
2626
}

src/Annotation/Exclude.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
* @Annotation
1313
* @Target({"METHOD"})
1414
*/
15-
class Exclude
15+
final class Exclude
1616
{
1717
}

src/Annotation/Field.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* @Annotation
1414
* @Target({"METHOD"})
1515
*/
16-
class Field
16+
final class Field
1717
{
1818
/**
1919
* @var string

src/Annotation/Filter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* @Annotation
1616
* @Target({"ANNOTATION"})
1717
*/
18-
class Filter
18+
final class Filter
1919
{
2020
/**
2121
* Name of the field on which to apply the operator

src/Annotation/Filters.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @Annotation
1111
* @Target({"CLASS"})
1212
*/
13-
class Filters
13+
final class Filters
1414
{
1515
/**
1616
* List of all custom filters

src/Annotation/Input.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@
2222
* @Attribute("defaultValue", required=false, type="mixed"),
2323
* })
2424
*/
25-
class Input extends AbstractAnnotation
25+
final class Input extends AbstractAnnotation
2626
{
2727
}

src/Annotation/Sorting.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @Annotation
1111
* @Target({"CLASS"})
1212
*/
13-
class Sorting
13+
final class Sorting
1414
{
1515
/**
1616
* FQCN of PHP class implementing `SortingInterface`

src/DefaultFieldResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* A field resolver that will allow access to public properties and getter.
1616
* Arguments, if any, will be forwarded as is to the method.
1717
*/
18-
class DefaultFieldResolver
18+
final class DefaultFieldResolver
1919
{
2020
public function __invoke($source, $args, $context, ResolveInfo $info)
2121
{

src/Definition/EntityIDType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/**
1212
* A specialized ID type that allows to fetch entity from DB
1313
*/
14-
class EntityIDType extends IDType
14+
final class EntityIDType extends IDType
1515
{
1616
/**
1717
* @var EntityManager

0 commit comments

Comments
 (0)