Skip to content

Commit 4bbc9f4

Browse files
committed
Support proper generic Collection
We incorrectly supported `Collection<Foo>`, while Doctrine collections should actually be `Collection<int, Foo>`. All type hints in user code must be adapted accordingly.
1 parent 807f4c0 commit 4bbc9f4

9 files changed

Lines changed: 18 additions & 18 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"ext-pdo": "*",
5959
"beberlei/doctrineextensions": "^1.5",
6060
"ecodev/felix": "^15.3",
61-
"ecodev/graphql-doctrine": "^10.0",
61+
"ecodev/graphql-doctrine": "^10.1",
6262
"ecodev/graphql-upload": "^7.0",
6363
"laminas/laminas-config-aggregator": "^1.15",
6464
"laminas/laminas-http": "^2.19",

composer.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/Application/Model/Event.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Event extends AbstractModel
2121
use HasName;
2222

2323
/**
24-
* @var Collection<Comment>
24+
* @var Collection<int, Comment>
2525
*/
2626
#[ORM\OneToMany(targetEntity: Comment::class, mappedBy: 'event')]
2727
private Collection $comments;

server/Application/Model/News.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class News extends AbstractModel
2929
private string $content = '';
3030

3131
/**
32-
* @var Collection<Comment>
32+
* @var Collection<int, Comment>
3333
*/
3434
#[ORM\OneToMany(targetEntity: Comment::class, mappedBy: 'news')]
3535
private Collection $comments;

server/Application/Model/Order.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Order extends AbstractModel implements HasBalanceInterface
3232
private OrderStatus $status = OrderStatus::Pending;
3333

3434
/**
35-
* @var Collection<OrderLine>
35+
* @var Collection<int, OrderLine>
3636
*/
3737
#[ORM\OneToMany(targetEntity: OrderLine::class, mappedBy: 'order')]
3838
private Collection $orderLines;

server/Application/Model/Product.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ class Product extends AbstractProduct
3838
private ?Product $review = null;
3939

4040
/**
41-
* @var Collection<ProductTag>
41+
* @var Collection<int, ProductTag>
4242
*/
4343
#[ORM\ManyToMany(targetEntity: ProductTag::class, mappedBy: 'products')]
4444
private Collection $productTags;
4545

4646
/**
47-
* @var Collection<Product>
47+
* @var Collection<int, Product>
4848
*/
4949
#[ORM\ManyToMany(targetEntity: self::class, inversedBy: 'inversedRelatedProducts')]
5050
private Collection $relatedProducts;
5151

5252
/**
53-
* @var Collection<Product>
53+
* @var Collection<int, Product>
5454
*/
5555
#[ORM\ManyToMany(targetEntity: self::class, mappedBy: 'relatedProducts')]
5656
private Collection $inversedRelatedProducts;

server/Application/Model/ProductTag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class ProductTag extends AbstractModel
2222
use HasName;
2323

2424
/**
25-
* @var Collection<Product>
25+
* @var Collection<int, Product>
2626
*/
2727
#[ORM\ManyToMany(targetEntity: Product::class, inversedBy: 'productTags')]
2828
private Collection $products;

server/Application/Model/Session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class Session extends AbstractModel
6262
private ChronosDate $endDate;
6363

6464
/**
65-
* @var Collection<User>
65+
* @var Collection<int, User>
6666
*/
6767
#[ORM\ManyToMany(targetEntity: User::class, inversedBy: 'sessions')]
6868
private Collection $facilitators;

server/Application/Model/User.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@ public static function getCurrent(): ?self
9898
private ?Chronos $lastLogin = null;
9999

100100
/**
101-
* @var Collection<Session>
101+
* @var Collection<int, Session>
102102
*/
103103
#[ORM\ManyToMany(targetEntity: Session::class, mappedBy: 'facilitators')]
104104
private Collection $sessions;
105105

106106
/**
107-
* @var Collection<User>
107+
* @var Collection<int, User>
108108
*/
109109
#[ORM\OneToMany(targetEntity: self::class, mappedBy: 'owner')]
110110
private Collection $users;

0 commit comments

Comments
 (0)