Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symfony 5 support #4

Merged
merged 5 commits into from
Jan 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .coke

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ vendor/
composer.lock
bin/*
!bin/.gitkeep
.php_cs.cache
28 changes: 28 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('var')
;

return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'array_syntax' => [
'syntax' => 'short',
],
'binary_operator_spaces' => [
'align_double_arrow' => true,
'align_equals' => true
],
'no_unreachable_default_argument_value' => false,
'braces' => [
'allow_single_line_closure' => true,
],
'heredoc_to_nowdoc' => false,
'phpdoc_summary' => false,
'declare_strict_types' => true,
])
->setFinder($finder)
;
56 changes: 45 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,59 @@
dist: bionic

language: php
sudo: false

cache:
directories:
- vendor
- ~/.composer/cache/files

env:
global:
- COMPOSER_MEMORY_LIMIT=-1

matrix:
fast_finish: true
include:
- php: 7.0
- php: 7.1
- php: 7.2
# Minimum supported dependencies with the latest and oldest PHP version
- php: 7.3
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="max[self]=0"
- php: 7.4
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="max[self]=0"

# Test the latest stable release
- php: 7.3
- php: 7.4

# Test specific Symfony versions
- php: 7.4
env: SYMFONY_VERSION="4.3.5" # LTS
- php: 7.4
env: SYMFONY_VERSION="4.*" # Last 4.x version
- php: 7.4
env: SYMFONY_VERSION="5.*" # Last 5.x version

# Latest commit to master
- php: 7.4
env: STABILITY="dev"

allow_failures:
# Dev-master is allowed to fail.
- env: STABILITY="dev"
- env: SYMFONY_VERSION="5.*"

before_install:
- echo "" > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
- phpenv config-rm xdebug.ini
- if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi;
- composer require --no-update symfony/flex ${DEPENDENCIES}
- if ! [ -z "$SYMFONY_VERSION" ]; then composer config extra.symfony.require "${SYMFONY_VERSION}"; fi;

before_script:
- if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi;
- composer install --no-interaction --prefer-dist

cache:
directories:
- bin
- vendor
- ~/.composer/cache/files
install:
- composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction

script:
- bin/coke
- bin/php-cs-fixer fix --verbose --diff --dry-run src/
- bin/phpspec run -f dot -n
12 changes: 5 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@
}
],
"require": {
"php": "^7.0",
"symfony/framework-bundle": "~3.0|^4.0",
"yproximite/ekomi-api": "^2.1.0"
"php": "^7.3",
"symfony/framework-bundle": "^4.0||^5.0",
"yproximite/ekomi-api": "^3.0.0"
},
"require-dev": {
"phpspec/phpspec": "^3.2",
"m6web/Symfony2-coding-standard": "^3.3.0",
"m6web/coke": "^2.1"
"phpspec/phpspec": "^6.1",
"friendsofphp/php-cs-fixer": "^2.16.1"
},
"minimum-stability": "dev",
"config": {
"bin-dir": "bin"
},
Expand Down
13 changes: 7 additions & 6 deletions spec/DependencyInjection/YproximiteEkomiApiExtensionSpec.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
<?php

declare(strict_types=1);

namespace spec\Yproximite\Bundle\EkomiApiBundle\DependencyInjection;

use PhpSpec\ObjectBehavior;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\ContainerBuilder;

use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use Yproximite\Bundle\EkomiApiBundle\DependencyInjection\YproximiteEkomiApiExtension;
use Yproximite\Ekomi\Api\Client\Client;
use Yproximite\Ekomi\Api\Service\ServiceAggregator;
use Yproximite\Bundle\EkomiApiBundle\DependencyInjection\YproximiteEkomiApiExtension;

class YproximiteEkomiApiExtensionSpec extends ObjectBehavior
{
function it_is_initializable()
public function it_is_initializable()
{
$this->shouldHaveType(YproximiteEkomiApiExtension::class);
}

function it_should_load(ContainerBuilder $container)
public function it_should_load(ContainerBuilder $container)
{
$configs = [
'yproximite_ekomi_api' => [
Expand Down
6 changes: 4 additions & 2 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace Yproximite\Bundle\EkomiApiBundle\DependencyInjection;
Expand All @@ -16,9 +17,10 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$treeBuilder = new TreeBuilder('yproximite_ekomi_api');

$rootNode = \method_exists($treeBuilder, 'getRootNode') ? $treeBuilder->getRootNode() : $treeBuilder->root('yproximite_ekomi_api');

$rootNode = $treeBuilder->root('yproximite_ekomi_api');
$rootNode
->children()
->scalarNode('http_client')
Expand Down
6 changes: 3 additions & 3 deletions src/DependencyInjection/YproximiteEkomiApiExtension.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

declare(strict_types=1);

namespace Yproximite\Bundle\EkomiApiBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Processor;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

use Yproximite\Ekomi\Api\Client\Client;
use Yproximite\Ekomi\Api\Service\ServiceAggregator;

Expand Down
1 change: 1 addition & 0 deletions src/YproximiteEkomiApiBundle.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace Yproximite\Bundle\EkomiApiBundle;
Expand Down