Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 29705ed

Browse files
authored
Updated compatibility to PHP 7.4 (#75)
1 parent e75be14 commit 29705ed

11 files changed

+50
-52
lines changed

.travis.yml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
#######################################################
2-
# DO NOT EDIT THIS FILE! #
3-
# #
4-
# It's auto-generated by symfony-cmf/dev-kit package. #
5-
#######################################################
6-
71
############################################################################
82
# This file is part of the Symfony CMF package. #
93
# #
@@ -16,7 +10,9 @@
1610
language: php
1711

1812
php:
19-
- 7.1
13+
- 7.2
14+
- 7.3
15+
- 7.4
2016

2117
sudo: false
2218

@@ -26,34 +22,24 @@ cache:
2622
- $HOME/.composer/cache/files
2723

2824
env:
29-
matrix: SYMFONY_VERSION=4.0.*
3025
global:
3126
- SYMFONY_DEPRECATIONS_HELPER="/.*each.*/"
3227
- SYMFONY_PHPUNIT_DIR=.phpunit SYMFONY_PHPUNIT_REMOVE="symfony/yaml"
3328
- KERNEL_CLASS=Symfony\Cmf\Bundle\ResourceRestBundle\Tests\Fixtures\App\Kernel
34-
- SYMFONY_PHPUNIT_VERSION=5.7
3529
- TEST_INSTALLATION=false
3630

3731
matrix:
3832
include:
39-
- php: 7.2
40-
env: STABILITY=dev SYMFONY_VERSION=4.0.*
41-
- php: 7.1
42-
env: STABILITY=dev COMPOSER_FLAGS="--prefer-lowest" SYMFONY_VERSION=2.8.* SYMFONY_DEPRECATIONS_HELPER=weak
43-
- php: 7.2
44-
env: STABILITY=dev SYMFONY_VERSION=3.3.*
45-
- php: 7.2
46-
env: STABILITY=dev SYMFONY_VERSION=3.4.*
33+
- PHP: 7.2
34+
env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_DEPRECATIONS_HELPER=weak
4735
- env: TEST_INSTALLATION=true
4836
fast_finish: true
4937
allow_failures:
5038
- env: TEST_INSTALLATION=true
5139

5240
before_install:
5341
- phpenv config-rm xdebug.ini || true
54-
- composer self-update
55-
- if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; composer config prefer-stable true; fi;
56-
- if [ "$SYMFONY_VERSION" != "" ]; then composer require symfony/symfony:${SYMFONY_VERSION} --no-update; fi
42+
- composer self-update --2
5743
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
5844

5945
install: COMPOSER_MEMORY_LIMIT=-1 travis_wait composer update --prefer-dist $COMPOSER_FLAGS

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
Changelog
22
=========
33

4+
1.2.0
5+
-----
6+
* Increased minimum version PHP to 7.2.
7+
* Updated several packages
8+
* Added support for PHP 7.4
9+
410
1.0.0
511
-----
612

7-
Released.
13+
* Released.

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ KERNEL_CLASS="Symfony\Cmf\Bundle\ResourceRestBundle\Tests\Fixtures\App\Kernel" .
3030

3131

3232
## Requirements
33-
34-
* PHP 7.1 / 7.2
35-
* Symfony 2.8 / 3.3 / 3.4 / 4.0
3633
* See also the `require` section of [composer.json](composer.json)
3734

3835
## Documentation

composer.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,29 @@
1010
}
1111
],
1212
"require": {
13-
"php": "^7.1",
13+
"php": "^7.2",
1414
"symfony-cmf/resource-bundle": "^1.0",
1515
"jms/serializer-bundle": "^1.0 | ^2.0 | ^3.0",
1616
"symfony/translation": "^2.8 || ^3.3 || ^4.0"
1717
},
1818
"require-dev": {
1919
"symfony-cmf/testing": "^2.1@dev",
20-
"symfony/phpunit-bridge": "^3.3 || ^4.0",
20+
"symfony/phpunit-bridge": "^5",
2121
"doctrine/phpcr-odm": "^1.4|^2.0",
2222
"jms/serializer": "^1.2",
2323
"behat/behat": "^3.0.6",
24-
"behat/web-api-extension": "^1.0@dev",
25-
"matthiasnoback/symfony-dependency-injection-test": "^1.1",
26-
"matthiasnoback/symfony-config-test": "^2.1",
24+
"imbo/behat-api-extension": "^2.1",
25+
"matthiasnoback/symfony-dependency-injection-test": "^4",
26+
"matthiasnoback/symfony-config-test": "^4",
2727
"symfony/twig-bundle": "^2.8 || ^3.3 || ^4.0",
2828
"symfony/validator": "^2.8 || ^3.3 || ^4.0",
2929
"symfony/security-bundle": "^2.8 || ^3.3 || ^4.0",
3030
"symfony/asset": "^2.8 || ^3.3 || ^4.0",
3131
"symfony/templating": "^2.8 || ^3.3 || ^4.0",
3232
"symfony/form": "^2.8 || ^3.3 || ^4.0",
3333
"symfony/web-server-bundle": "^2.8 || ^3.3 || ^4.0",
34-
"symfony/translation": "^2.8 || ^3.3 || ^4.0"
34+
"symfony/translation": "^2.8 || ^3.3 || ^4.0",
35+
"phpspec/prophecy": "^1.12"
3536
},
3637
"suggest": {
3738
"doctrine/phpcr-odm": "To enable support for the PHPCR ODM documents (^1.2)",

tests/Unit/DependencyInjection/CmfResourceRestExtensionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Cmf\Bundle\ResourceBundle\Tests\Unit\DependencyInjection;
12+
namespace Symfony\Cmf\Bundle\ResourceRestBundle\Tests\Unit\DependencyInjection;
1313

1414
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase;
1515
use Symfony\Cmf\Bundle\ResourceRestBundle\DependencyInjection\CmfResourceRestExtension;
1616

1717
class CmfResourceRestExtensionTest extends AbstractExtensionTestCase
1818
{
19-
protected function getContainerExtensions()
19+
protected function getContainerExtensions(): array
2020
{
2121
return [new CmfResourceRestExtension()];
2222
}

tests/Unit/DependencyInjection/ConfigurationTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@
1414
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionConfigurationTestCase;
1515
use Symfony\Cmf\Bundle\ResourceRestBundle\DependencyInjection\CmfResourceRestExtension;
1616
use Symfony\Cmf\Bundle\ResourceRestBundle\DependencyInjection\Configuration;
17+
use Symfony\Component\Config\Definition\ConfigurationInterface;
18+
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
1719

1820
class ConfigurationTest extends AbstractExtensionConfigurationTestCase
1921
{
20-
protected function getContainerExtension()
22+
protected function getContainerExtension(): ExtensionInterface
2123
{
2224
return new CmfResourceRestExtension();
2325
}
2426

25-
protected function getConfiguration()
27+
protected function getConfiguration(): ConfigurationInterface
2628
{
2729
return new Configuration();
2830
}

tests/Unit/Registry/PayloadAliasRegistryTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,20 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Cmf\Bundle\ResourceRestBundle\Tests\Registry;
12+
namespace Symfony\Cmf\Bundle\ResourceRestBundle\Tests\Unit\Registry;
1313

14+
use PHPUnit\Framework\TestCase;
1415
use Symfony\Cmf\Bundle\ResourceRestBundle\Registry\PayloadAliasRegistry;
1516

16-
class PayloadAliasRegistryTest extends \PHPUnit_Framework_TestCase
17+
class PayloadAliasRegistryTest extends TestCase
1718
{
1819
private $repositoryRegistry;
1920

2021
private $resource;
2122

2223
private $repository;
2324

24-
public function setUp()
25+
public function setUp(): void
2526
{
2627
$this->repositoryRegistry = $this->prophesize('Symfony\Cmf\Component\Resource\RepositoryRegistryInterface');
2728
$this->resource = $this->prophesize('Symfony\Cmf\Component\Resource\Repository\Resource\CmfResource');
@@ -61,7 +62,7 @@ public function testRegistry($aliases, $resource, $expectedAlias)
6162
$this->resource->getRepository()->willReturn($this->repository);
6263

6364
$alias = $registry->getPayloadAlias($this->resource->reveal());
64-
$this->assertEquals($expectedAlias, $alias);
65+
self::assertEquals($expectedAlias, $alias);
6566
}
6667

6768
private function createRegistry($aliases)

tests/Unit/Security/ResourcePathVoterTest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,20 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Cmf\Bundle\ResourceRestBundle\Tests\Security;
12+
namespace Symfony\Cmf\Bundle\ResourceRestBundle\Tests\Unit\Security;
1313

14+
use PHPUnit\Framework\TestCase;
15+
use stdClass;
1416
use Symfony\Cmf\Bundle\ResourceRestBundle\Security\ResourcePathVoter;
1517
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
1618
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
1719
use Symfony\Component\Security\Core\Authorization\Voter\Voter as V;
1820

19-
class ResourcePathVoterTest extends \PHPUnit_Framework_TestCase
21+
class ResourcePathVoterTest extends TestCase
2022
{
2123
private $accessDecisionManager;
2224

23-
protected function setUp()
25+
protected function setUp(): void
2426
{
2527
$this->accessDecisionManager = $this->prophesize(AccessDecisionManagerInterface::class);
2628
}
@@ -37,7 +39,7 @@ public function testVote($rules, $subject, array $attributes, $result)
3739

3840
$voter = new ResourcePathVoter($this->accessDecisionManager->reveal(), $rules);
3941

40-
$this->assertSame($result, $voter->vote($token, $subject, $attributes));
42+
self::assertSame($result, $voter->vote($token, $subject, $attributes));
4143
}
4244

4345
public function provideVoteData()
@@ -61,7 +63,7 @@ public function provideVoteData()
6163
// Unsupported attributes or subjects
6264
[[], $this->buildSubject('/cms/articles'), ['CMF_RESOURCE_READ'], V::ACCESS_DENIED],
6365
[[$this->buildRule('^/')], $this->buildSubject('/cms/articles'), ['ROLE_USER'], V::ACCESS_ABSTAIN],
64-
[[$this->buildRule('^/')], new \stdClass(), ['CMF_RESOURCE_READ'], V::ACCESS_ABSTAIN],
66+
[[$this->buildRule('^/')], new stdClass(), ['CMF_RESOURCE_READ'], V::ACCESS_ABSTAIN],
6567

6668
// Repository name matching
6769
[[$this->buildRule('^/')], $this->buildSubject('/cms/articles', 'other_repo'), ['CMF_RESOURCE_READ'], V::ACCESS_DENIED],

tests/Unit/Serializer/Jms/EventSubscriber/PhpcrNodeSubscriberTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,20 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Cmf\Bundle\ResourceRestBundle\Tests\Serializer\Jms\EventSubscriber;
12+
namespace Symfony\Cmf\Bundle\ResourceRestBundle\Tests\Unit\Serializer\Jms\EventSubscriber;
1313

14+
use PHPUnit\Framework\TestCase;
1415
use Symfony\Cmf\Bundle\ResourceRestBundle\Serializer\Jms\EventSubscriber\PhpcrNodeSubscriber;
1516

16-
class PhpcrNodeSubscriberTest extends \PHPUnit_Framework_TestCase
17+
class PhpcrNodeSubscriberTest extends TestCase
1718
{
1819
private $node;
1920

2021
private $event;
2122

2223
private $subscriber;
2324

24-
public function setUp()
25+
public function setUp(): void
2526
{
2627
parent::setUp();
2728

tests/Unit/Serializer/Jms/Handler/PhpcrNodeHandlerTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,20 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Cmf\Bundle\ResourceRestBundle\Tests\Serializer\Handler;
12+
namespace Symfony\Cmf\Bundle\ResourceRestBundle\Tests\Unit\Serializer\Jms\Handler;
1313

14+
use PHPUnit\Framework\TestCase;
1415
use Symfony\Cmf\Bundle\ResourceRestBundle\Serializer\Jms\Handler\PhpcrNodeHandler;
1516

16-
class PhpcrNodeHandlerTest extends \PHPUnit_Framework_TestCase
17+
class PhpcrNodeHandlerTest extends TestCase
1718
{
1819
private $handler;
1920

2021
private $property1;
2122

2223
private $property2;
2324

24-
public function setUp()
25+
public function setUp(): void
2526
{
2627
parent::setUp();
2728

tests/Unit/Serializer/Jms/Handler/ResourceHandlerTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Cmf\Bundle\ResourceRestBundle\Tests\Serializer\Handler;
12+
namespace Symfony\Cmf\Bundle\ResourceRestBundle\Tests\Unit\Serializer\Jms\Handler;
1313

1414
use JMS\Serializer\Context;
1515
use JMS\Serializer\JsonSerializationVisitor;
16+
use PHPUnit\Framework\TestCase;
1617
use Prophecy\Argument;
1718
use Symfony\Cmf\Bundle\ResourceRestBundle\Registry\PayloadAliasRegistry;
1819
use Symfony\Cmf\Bundle\ResourceRestBundle\Serializer\Jms\Handler\ResourceHandler;
@@ -22,7 +23,7 @@
2223
use Symfony\Cmf\Component\Resource\Repository\Resource\CmfResource;
2324
use Symfony\Cmf\Component\Resource\RepositoryRegistryInterface;
2425

25-
class ResourceHandlerTest extends \PHPUnit_Framework_TestCase
26+
class ResourceHandlerTest extends TestCase
2627
{
2728
private $repositoryRegistry;
2829

@@ -44,7 +45,7 @@ class ResourceHandlerTest extends \PHPUnit_Framework_TestCase
4445

4546
private $description;
4647

47-
protected function setUp()
48+
protected function setUp(): void
4849
{
4950
$this->repositoryRegistry = $this->prophesize(RepositoryRegistryInterface::class);
5051
$this->payloadAliasRegistry = $this->prophesize(PayloadAliasRegistry::class);

0 commit comments

Comments
 (0)