Skip to content

Commit 43417f2

Browse files
vincentchalamonalanpoulain
authored andcommitted
fix: Behat
1 parent 0ad3439 commit 43417f2

Some content is hidden

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

50 files changed

+116
-147
lines changed

features/main/operation_resource.feature

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ Feature: Resource operations
2626
"""
2727
{"name": "Patched"}
2828
"""
29-
Then print last JSON response
3029
Then the response status code should be 200
3130
And the response should be in JSON
3231
And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"

src/Doctrine/Odm/Filter/SearchFilter.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,9 @@ private function addEqualityMatchStrategy(string $strategy, Builder $aggregation
159159
/**
160160
* Get equality match value according to the strategy.
161161
*
162-
* @param mixed $value
163-
*
164162
* @throws InvalidArgumentException If strategy does not exist
165163
*/
166-
private function getEqualityMatchStrategyValue(string $strategy, string $field, $value, bool $caseSensitive, ClassMetadata $metadata): Regex|string
164+
private function getEqualityMatchStrategyValue(string $strategy, string $field, mixed $value, bool $caseSensitive, ClassMetadata $metadata): Regex|string|int
167165
{
168166
$type = $metadata->getTypeOfField($field);
169167

tests/Fixtures/TestBundle/Document/AbsoluteUrlRelationDummy.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use ApiPlatform\Api\UrlGeneratorInterface;
1717
use ApiPlatform\Metadata\ApiResource;
1818
use Doctrine\Common\Collections\ArrayCollection;
19-
use Doctrine\Common\Collections\Collection;
2019
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
2120

2221
#[ApiResource(urlGenerationStrategy: UrlGeneratorInterface::ABS_URL)]
@@ -26,7 +25,7 @@ class AbsoluteUrlRelationDummy
2625
#[ODM\Id(strategy: 'INCREMENT', type: 'int')]
2726
private $id;
2827
#[ODM\ReferenceMany(targetDocument: AbsoluteUrlDummy::class, mappedBy: 'absoluteUrlRelationDummy')]
29-
public Collection $absoluteUrlDummies;
28+
public $absoluteUrlDummies;
3029

3130
public function __construct()
3231
{

tests/Fixtures/TestBundle/Document/Answer.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
use ApiPlatform\Metadata\Patch;
2222
use ApiPlatform\Metadata\Put;
2323
use Doctrine\Common\Collections\ArrayCollection;
24-
use Doctrine\Common\Collections\Collection;
2524
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
2625
use Symfony\Component\Serializer\Annotation as Serializer;
2726

@@ -45,7 +44,7 @@ class Answer
4544
private ?Question $question = null;
4645
#[Serializer\Groups(['foobar'])]
4746
#[ODM\ReferenceMany(targetDocument: Question::class, mappedBy: 'answer')]
48-
private Collection $relatedQuestions;
47+
private $relatedQuestions;
4948

5049
public function __construct()
5150
{
@@ -99,7 +98,7 @@ public function getQuestion(): ?Question
9998
/**
10099
* Get related question.
101100
*/
102-
public function getRelatedQuestions(): Collection
101+
public function getRelatedQuestions(): iterable
103102
{
104103
return $this->relatedQuestions;
105104
}

tests/Fixtures/TestBundle/Document/CircularReference.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
use ApiPlatform\Metadata\ApiResource;
1717
use Doctrine\Common\Collections\ArrayCollection;
18-
use Doctrine\Common\Collections\Collection;
1918
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
2019
use Symfony\Component\Serializer\Annotation\Groups;
2120

@@ -35,7 +34,7 @@ class CircularReference
3534
public $parent;
3635
#[Groups(['circular'])]
3736
#[ODM\ReferenceMany(targetDocument: self::class, mappedBy: 'parent')]
38-
public Collection $children;
37+
public $children;
3938

4039
public function __construct()
4140
{

tests/Fixtures/TestBundle/Document/CompositeItem.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
use ApiPlatform\Metadata\ApiResource;
1717
use Doctrine\Common\Collections\ArrayCollection;
18-
use Doctrine\Common\Collections\Collection;
1918
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
2019
use Symfony\Component\Serializer\Annotation\Groups;
2120

@@ -33,7 +32,7 @@ class CompositeItem implements \Stringable
3332
private ?string $field1 = null;
3433
#[Groups(['default'])]
3534
#[ODM\ReferenceMany(targetDocument: CompositeRelation::class, mappedBy: 'compositeItem')]
36-
private Collection $compositeValues;
35+
private $compositeValues;
3736

3837
public function __construct()
3938
{
@@ -67,7 +66,7 @@ public function setField1(?string $field1 = null): void
6766
/**
6867
* Gets compositeValues.
6968
*/
70-
public function getCompositeValues(): Collection
69+
public function getCompositeValues(): iterable
7170
{
7271
return $this->compositeValues;
7372
}

tests/Fixtures/TestBundle/Document/Content.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Content implements \JsonSerializable
3232
* @var Collection<Field>
3333
*/
3434
#[ODM\ReferenceMany(targetDocument: Field::class, mappedBy: 'content', strategy: 'set', cascade: ['persist'])]
35-
private Collection $fields;
35+
private $fields;
3636
#[ODM\Field(type: 'string')]
3737
private string $status = ContentStatus::DRAFT;
3838

tests/Fixtures/TestBundle/Document/Customer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
use ApiPlatform\Metadata\ApiResource;
1717
use Doctrine\Common\Collections\ArrayCollection;
18-
use Doctrine\Common\Collections\Collection;
1918
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
2019
use Symfony\Component\Serializer\Annotation\Groups;
2120

@@ -31,7 +30,7 @@ class Customer
3130
public $name;
3231
#[Groups(['order_read'])]
3332
#[ODM\ReferenceMany(targetDocument: Address::class)]
34-
public Collection $addresses;
33+
public $addresses;
3534

3635
public function __construct()
3736
{

tests/Fixtures/TestBundle/Document/Dummy.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use ApiPlatform\Metadata\Get;
1919
use ApiPlatform\Metadata\Link;
2020
use Doctrine\Common\Collections\ArrayCollection;
21-
use Doctrine\Common\Collections\Collection;
2221
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
2322
use Symfony\Component\Validator\Constraints as Assert;
2423

@@ -88,7 +87,7 @@ class Dummy
8887
#[ODM\ReferenceOne(targetDocument: RelatedDummy::class, storeAs: 'id', nullable: true)]
8988
public ?RelatedDummy $relatedDummy = null;
9089
#[ODM\ReferenceMany(targetDocument: RelatedDummy::class, storeAs: 'id', nullable: true)]
91-
public Collection $relatedDummies;
90+
public $relatedDummies;
9291
#[ODM\Field(type: 'hash', nullable: true)]
9392
public array $jsonData = [];
9493
#[ODM\Field(type: 'collection', nullable: true)]

tests/Fixtures/TestBundle/Document/DummyAggregateOffer.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use ApiPlatform\Metadata\GetCollection;
1818
use ApiPlatform\Metadata\Link;
1919
use Doctrine\Common\Collections\ArrayCollection;
20-
use Doctrine\Common\Collections\Collection;
2120
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
2221

2322
/**
@@ -39,7 +38,7 @@ class DummyAggregateOffer
3938
#[ODM\Id(strategy: 'INCREMENT', type: 'int')]
4039
private ?int $id = null;
4140
#[ODM\ReferenceMany(targetDocument: DummyOffer::class, mappedBy: 'aggregate', cascade: ['persist'])]
42-
private Collection $offers;
41+
private $offers;
4342
/**
4443
* @var DummyProduct The dummy product
4544
*/
@@ -56,12 +55,12 @@ public function __construct()
5655
$this->offers = new ArrayCollection();
5756
}
5857

59-
public function getOffers(): Collection
58+
public function getOffers(): iterable
6059
{
6160
return $this->offers;
6261
}
6362

64-
public function setOffers(Collection $offers): void
63+
public function setOffers($offers): void
6564
{
6665
$this->offers = $offers;
6766
}

0 commit comments

Comments
 (0)