Skip to content

Commit

Permalink
Support for php8.0 (paysera#7)
Browse files Browse the repository at this point in the history
* Add support for PHP 8
* Drop support for PHP 7.0
* Temporarily remove `paysera/lib-php-cs-fixer-config`

Co-authored-by: Desislava Georgieva <[email protected]>
  • Loading branch information
zbpopova9292 and desislavaggeorgieva authored Mar 22, 2022
1 parent 4283fde commit 95484c1
Show file tree
Hide file tree
Showing 15 changed files with 60 additions and 178 deletions.
141 changes: 0 additions & 141 deletions .php_cs

This file was deleted.

7 changes: 2 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@ env:

matrix:
include:
- php: "7.0"
- php: "7.1"
- php: "7.2"
- php: "7.3"
- php: "7.4"
env: WITH_CS="true"
- php: "8.0"

- php: "7.0"
env: LOWER_CONSTRAINTS="true"
- php: "7.1"
env: LOWER_CONSTRAINTS="true"
- php: "7.2"
Expand All @@ -26,6 +23,7 @@ matrix:
- php: "7.4"
env: LOWER_CONSTRAINTS="true"


cache:
directories:
- $HOME/.composer/cache
Expand All @@ -40,4 +38,3 @@ before_script:

script:
- bin/phpunit
- if [[ "$WITH_CS" == "true" ]]; then bin/paysera-php-cs-fixer fix --config=.php_cs -v --dry-run --stop-on-violation --path-mode=intersection "${COMMIT_SCA_FILES[@]}"; fi
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.3.0]
### Added
- support for PHP 8
- `doctrine/persistence` added

### Changed
- `paysera/lib-normalization-bundle` bumped to `^1.1.0`
- `paysera/lib-normalization` bumped to `^1.2.0`
- `paysera/lib-dependency-injection` bumped to `^1.3.0`
- `doctrine/doctrine-bundle` bumped to `^1.4|^2.0`
- `doctrine/orm` bumped to `^2.5.14|^2.6`

### Removed
- support for PHP 7.0
- `paysera/lib-php-cs-fixer-config`
- `doctrine/common`



## [1.2.0]
### Changed
- `paysera_api.listener.locale` listener priority changed.
Expand Down
25 changes: 11 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,31 @@
}
},
"require": {
"php": ">=7.0",
"php": "^7.1 || ^8.0",
"ext-json": "*",
"symfony/framework-bundle": "^3.4.34|^4.3",
"symfony/security-bundle": "^3.4.34|^4.3",
"symfony/validator": "^3.4.34|^4.3",
"doctrine/common": "^2.1",
"paysera/lib-normalization-bundle": "^1.0",
"paysera/lib-normalization": "^1.1",
"paysera/lib-object-wrapper": "^0.1.0|^0.2.0",
"paysera/lib-normalization-bundle": "^1.1.0",
"paysera/lib-normalization": "^1.2.0",
"paysera/lib-object-wrapper": "^0.1.0|^0.2.0|^0.3.0",
"paysera/lib-pagination": "^1.0",
"paysera/lib-dependency-injection": "^1.1.0",
"psr/log": "^1.0"
"paysera/lib-dependency-injection": "^1.3.0",
"psr/log": "^1.0",
"doctrine/persistence": "^1.3.8 || ^2.0.1"
},
"require-dev": {
"phpunit/phpunit": "^6.5",
"phpunit/phpunit": "^6.5 || ^9.0",
"mockery/mockery": "^1.2.4",
"paysera/lib-php-cs-fixer-config": "^2.2.2",
"symfony/yaml": "^3.4.34|^4.3",
"doctrine/doctrine-bundle": "^1.4",
"doctrine/orm": "^2.5.14"
"doctrine/doctrine-bundle": "^1.4|^2.0",
"doctrine/orm": "^2.5.14|^2.6"
},
"config": {
"bin-dir": "bin"
},
"scripts": {
"phpunit": "phpunit",
"fix-cs": "paysera-php-cs-fixer fix",
"test-cs": "paysera-php-cs-fixer fix --dry-run -v",
"test": ["@phpunit", "@test-cs"]
"test": ["@phpunit"]
}
}
15 changes: 9 additions & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
convertWarningsToExceptions = "true"
processIsolation = "false"
stopOnFailure = "false"
syntaxCheck = "false"
bootstrap = "vendor/autoload.php" >

<testsuites>
Expand All @@ -19,9 +18,13 @@
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory>./src</directory>
</whitelist>
</filter>
<coverage>
<include>
<directory>./</directory>
</include>
<exclude>
<directory>./tests</directory>
<directory>./vendor</directory>
</exclude>
</coverage>
</phpunit>
7 changes: 5 additions & 2 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('paysera_api');
$treeBuilder = new TreeBuilder('paysera_api');
$rootNode = method_exists($treeBuilder, 'getRootNode')
? $treeBuilder->getRootNode()
: $treeBuilder->root('paysera_api')
;

$children = $rootNode->children();
$children->arrayNode('locales')->defaultValue([])->prototype('scalar');
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/PayseraApiExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Paysera\Bundle\ApiBundle\DependencyInjection;

use Doctrine\Common\Persistence\ObjectRepository;
use Doctrine\Persistence\ObjectRepository;
use Paysera\Bundle\ApiBundle\Service\PathAttributeResolver\DoctrinePathAttributeResolver;
use RuntimeException;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Paysera\Bundle\ApiBundle\Service\PathAttributeResolver;

use Doctrine\Common\Persistence\ObjectRepository;
use Doctrine\Persistence\ObjectRepository;

class DoctrinePathAttributeResolver implements PathAttributeResolverInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$treeBuilder->root('paysera_fixture_test');
$treeBuilder = new TreeBuilder('paysera_fixture_test');

if (!method_exists($treeBuilder, 'getRootNode')) {
$treeBuilder->root('paysera_fixture_test');
}

return $treeBuilder;
}
}
2 changes: 1 addition & 1 deletion tests/Functional/FunctionalAnnotationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class FunctionalAnnotationsTest extends FunctionalTestCase
{
protected function setUp()
protected function setUp(): void
{
parent::setUp();
$this->setUpContainer('basic');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class FunctionalCustomPropertyPathConverterTest extends FunctionalTestCase
{
protected function setUp()
protected function setUp(): void
{
parent::setUp();
$this->setUpContainer('custom_converter');
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/FunctionalFindDenormalizersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class FunctionalFindDenormalizersTest extends FunctionalTestCase
{
protected function setUp()
protected function setUp(): void
{
parent::setUp();
$this->setUpContainer('basic');
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/FunctionalRestBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class FunctionalRestBundleTest extends FunctionalTestCase
{
protected function setUp()
protected function setUp(): void
{
parent::setUp();
$this->setUpContainer('basic');
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/FunctionalTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected function setUpContainer($testCase, $commonFile = 'common.yml')
return $this->kernel->getContainer();
}

protected function tearDown()
protected function tearDown(): void
{
$container = $this->kernel->getContainer();
$this->kernel->shutdown();
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Normalizer/DenormalizerTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class DenormalizerTestCase extends MockeryTestCase
*/
protected $context;

protected function setUp()
protected function setUp(): void
{
parent::setUp();
$this->context = Mockery::mock(DenormalizationContext::class);
Expand Down

0 comments on commit 95484c1

Please sign in to comment.