Skip to content

Commit 3e1b564

Browse files
committed
Merge branch '2.x' into 3.x
2 parents 1483a69 + d60e0ba commit 3e1b564

24 files changed

+88
-126
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# from doctrine/instantiator:
22
# https://github.com/doctrine/instantiator/blob/97aa11bb71ad6259a8c5a1161b4de2d6cdcc5501/.github/workflows/continuous-integration.yml
33

4-
name: "Continuous Integration"
4+
name: "CI"
55

66
on:
77
pull_request:
@@ -37,6 +37,7 @@ jobs:
3737
coverage: yes
3838
- php-version: 8.0
3939
composer-flags: "--ignore-platform-reqs"
40+
symfony-deprecations: "max[self]=0"
4041

4142
steps:
4243
- name: "Checkout"
@@ -68,7 +69,9 @@ jobs:
6869
- name: "Install dependencies with composer"
6970
env:
7071
SYMFONY_REQUIRE: "${{ matrix.symfony-require }}"
71-
run: "composer update --no-interaction --no-progress ${{ matrix.composer-flags }}"
72+
run: |
73+
composer global require --no-progress --no-scripts --no-plugins symfony/flex
74+
composer update --no-interaction --no-progress ${{ matrix.composer-flags }}
7275
7376
- name: "Run PHPUnit"
7477
if: "${{ matrix.coverage != '' }}"
@@ -78,5 +81,7 @@ jobs:
7881
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
7982
8083
- name: "Run PHPUnit"
84+
env:
85+
SYMFONY_DEPRECATIONS_HELPER: "${{ matrix.symfony-deprecations }}"
8186
if: "${{ matrix.coverage == '' }}"
8287
run: "./phpunit"

.phpunit.result.cache

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

.travis.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

Negotiation/FormatNegotiator.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
use Symfony\Component\HttpFoundation\RequestStack;
2121

2222
/**
23-
* @author Ener-Getick <[email protected]>
23+
* @author Guilhem Niot <[email protected]>
24+
*
25+
* @final since 2.8
2426
*/
2527
final class FormatNegotiator extends BaseNegotiator
2628
{
@@ -39,7 +41,7 @@ public function add(RequestMatcherInterface $requestMatcher, array $options = []
3941
$this->map[] = [$requestMatcher, $options];
4042
}
4143

42-
public function getBest($header, array $priorities = []): ?AcceptHeader
44+
public function getBest($header, array $priorities = [], $strict = false)
4345
{
4446
$request = $this->getRequest();
4547
$header = $header ?: $request->headers->get('Accept');

Tests/Decoder/JsonToFormDecoderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ public function testDecodeWithRemovingFalseData()
3737
$decoder = new JsonToFormDecoder();
3838
$decoded = $decoder->decode(json_encode($data));
3939

40-
$this->assertInternalType('array', $decoded);
41-
$this->assertInternalType('array', $decoded['arrayKey']);
40+
$this->assertIsArray($decoded);
41+
$this->assertIsArray($decoded['arrayKey']);
4242
$this->assertNull($decoded['arrayKey']['falseKey']);
4343
$this->assertEquals('foo', $decoded['arrayKey']['stringKey']);
4444
$this->assertNull($decoded['falseKey']);

Tests/DependencyInjection/Compiler/ConfigurationCheckPassTest.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@
2222
*/
2323
class ConfigurationCheckPassTest extends TestCase
2424
{
25-
/**
26-
* @expectedException \RuntimeException
27-
* @expectedExceptionMessage You need to enable the parameter converter listeners in SensioFrameworkExtraBundle when using the FOSRestBundle RequestBodyParamConverter
28-
*/
2925
public function testShouldThrowRuntimeExceptionWhenBodyConverterIsEnabledButParamConvertersAreNotEnabled()
3026
{
27+
$this->expectException(\RuntimeException::class);
28+
$this->expectExceptionMessage('You need to enable the parameter converter listeners in SensioFrameworkExtraBundle when using the FOSRestBundle RequestBodyParamConverter');
29+
3130
$container = new ContainerBuilder();
3231

3332
$container->register('fos_rest.converter.request_body');
@@ -36,12 +35,11 @@ public function testShouldThrowRuntimeExceptionWhenBodyConverterIsEnabledButPara
3635
$compiler->process($container);
3736
}
3837

39-
/**
40-
* @expectedException \RuntimeException
41-
* @expectedExceptionMessage SensioFrameworkExtraBundle view annotations
42-
*/
4338
public function testExceptionWhenViewAnnotationsAreNotEnabled()
4439
{
40+
$this->expectException(\RuntimeException::class);
41+
$this->expectExceptionMessage('SensioFrameworkExtraBundle view annotations');
42+
4543
$container = new ContainerBuilder();
4644

4745
$container->register('fos_rest.view_response_listener');

Tests/DependencyInjection/Compiler/SerializerConfigurationPassTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class SerializerConfigurationPassTest extends TestCase
2828
*/
2929
private $container;
3030

31-
protected function setUp()
31+
protected function setUp(): void
3232
{
3333
$this->container = new ContainerBuilder();
3434
}
@@ -44,11 +44,10 @@ public function testShouldDoNothingIfSerializerIsFound()
4444
$this->assertSame(get_class($serializer), $this->container->getDefinition('fos_rest.serializer')->getClass());
4545
}
4646

47-
/**
48-
* @expectedException \InvalidArgumentException
49-
*/
5047
public function testShouldThrowInvalidArgumentExceptionWhenNoSerializerIsFound()
5148
{
49+
$this->expectException(\InvalidArgumentException::class);
50+
5251
$compiler = new SerializerConfigurationPass();
5352
$compiler->process($this->container);
5453
}

Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public function incorrectExceptionCodeProvider()
219219
/**
220220
* {@inheritdoc}
221221
*/
222-
protected function setUp()
222+
protected function setUp(): void
223223
{
224224
parent::setUp();
225225
$this->configuration = new Configuration(false);

Tests/ErrorRenderer/SerializerErrorRendererTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
class SerializerErrorRendererTest extends TestCase
2626
{
27-
protected function setUp()
27+
protected function setUp(): void
2828
{
2929
if (!interface_exists(ErrorRendererInterface::class)) {
3030
$this->markTestSkipped();

Tests/EventListener/ViewResponseListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public function getDataForDefaultVarsCopy()
159159
];
160160
}
161161

162-
protected function setUp()
162+
protected function setUp(): void
163163
{
164164
$this->router = $this->getMockBuilder(RouterInterface::class)->getMock();
165165
$this->serializer = $this->getMockBuilder(Serializer::class)->getMock();

0 commit comments

Comments
 (0)