Skip to content

Commit 18f821f

Browse files
committed
fix: ignore platform reqs on low php
1 parent 48fd597 commit 18f821f

File tree

3 files changed

+24
-14
lines changed

3 files changed

+24
-14
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,11 @@ jobs:
140140
doctrine/mongodb-odm \
141141
doctrine/mongodb-odm-bundle
142142
- name: Update project dependencies
143+
if: (!startsWith(matrix.php, '7.1'))
143144
run: composer update --no-interaction --no-progress --ansi
145+
- name: Update project dependencies (7.1)
146+
if: (startsWith(matrix.php, '7.1') || startsWith(matrix.php, '7.2'))
147+
run: composer update --no-interaction --no-progress --ansi --ignore-platform-reqs
144148
- name: Require Symfony components
145149
if: (!startsWith(matrix.php, '7.1'))
146150
run: composer require symfony/uid --dev --no-interaction --no-progress --ansi
@@ -228,7 +232,11 @@ jobs:
228232
doctrine/mongodb-odm \
229233
doctrine/mongodb-odm-bundle
230234
- name: Update project dependencies
235+
if: (!startsWith(matrix.php, '7.1'))
231236
run: composer update --no-interaction --no-progress --ansi
237+
- name: Update project dependencies (7.1)
238+
if: (startsWith(matrix.php, '7.1') || startsWith(matrix.php, '7.2'))
239+
run: composer update --no-interaction --no-progress --ansi --ignore-platform-reqs
232240
- name: Require Symfony components
233241
if: (!startsWith(matrix.php, '7.1'))
234242
run: composer require symfony/uid --dev --no-interaction --no-progress --ansi

tests/Fixtures/TestBundle/Entity/AlternateResource.php

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,22 @@
1616
use ApiPlatform\Core\Annotation\ApiProperty;
1717
use ApiPlatform\Metadata\Get;
1818

19-
#[Get]
20-
#[Get('/alternate/{id}', uriVariables: ['id' => ['from_class' => AlternateResource::class, 'identifiers' => ['id']]])]
21-
final class AlternateResource
22-
{
23-
#[ApiProperty(identifier: true)]
24-
public string $id;
25-
26-
public function __construct(string $id)
19+
if (\PHP_VERSION_ID > 80000) {
20+
#[Get]
21+
#[Get('/alternate/{id}', uriVariables: ['id' => ['from_class' => AlternateResource::class, 'identifiers' => ['id']]])]
22+
final class AlternateResource
2723
{
28-
$this->id = $id;
29-
}
24+
#[ApiProperty(identifier: true)]
25+
public string $id;
3026

31-
public function getId()
32-
{
33-
return $this->id;
27+
public function __construct(string $id)
28+
{
29+
$this->id = $id;
30+
}
31+
32+
public function getId()
33+
{
34+
return $this->id;
35+
}
3436
}
3537
}

tests/Fixtures/TestBundle/Entity/UserResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ final class UserResource
3434
/**
3535
* @Assert\NotBlank
3636
*/
37-
public string $username;
37+
public $username;
3838
}

0 commit comments

Comments
 (0)