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

feat: support Symfony 7 and modernize code base #35

Merged
merged 1 commit into from
Nov 2, 2023
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
27 changes: 10 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ 7.4, 8.0 ]
symfony: [ 4.4.*, 5.3.*, 5.4.* ]
deps: [ hightest ]
php: [ 8.1, 8.2, 8.3 ]
symfony: [ 6.3.*, 6.4.*, 7.0.* ]
deps: [ highest ]
include:
- php: 7.2
- php: 7.4
deps: lowest
symfony: '*'
- php: 8.0
deps: highest
symfony: 6.0.*
exclude:
- php: 8.1
symfony: 7.0.*

steps:
- name: Checkout code
Expand All @@ -40,15 +40,8 @@ jobs:
env:
SYMFONY_REQUIRE: ${{ matrix.symfony }}

- name: Install phpspec
run: composer bin phpspec install

- name: Run tests
run: vendor/bin/simple-phpunit -v

- name: Run phpspec
run: vendor/bin/phpspec run --format=pretty
if: matrix.symfony != '6.0.*'
run: vendor/bin/phpunit -v

code-coverage:
name: Code Coverage
Expand All @@ -60,7 +53,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.1
coverage: xdebug

- name: Install dependencies
Expand All @@ -69,7 +62,7 @@ jobs:
composer-options: --prefer-dist

- name: Run code coverage
run: vendor/bin/simple-phpunit -v --coverage-text
run: vendor/bin/phpunit -v --coverage-text

composer-validate:
name: Validate composer.json
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/composer.lock
/.phpunit.result.cache
/vendor
/tests/fixtures/app/cache
/tests/fixtures/app/logs
Expand Down
5 changes: 0 additions & 5 deletions bin/tools/phpspec/composer.json

This file was deleted.

15 changes: 6 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
}
],
"require": {
"php": "^7.2|^8.0",
"symfony/framework-bundle": "^4.4|^5.0|^6.0"
"php": "^7.4|^8.0",
"symfony/framework-bundle": "^5.4|^6.0|^7.0"
},
"require-dev": {
"symfony/var-dumper": "^4.4|^5.0|^6.0",
"symfony/phpunit-bridge": "^5.3",
"bamarni/composer-bin-plugin": "^1.4",
"symfony/yaml": "^4.4|^5.0|^6.0"
"symfony/var-dumper": "^5.4|^6.0|^7.0",
"symfony/phpunit-bridge": "^6.0|^7.0",
"symfony/yaml": "^5.0|^6.0|^7.0",
"phpunit/phpunit": "^9.6.13"
},
"autoload": {
"psr-4": { "Umpirsky\\I18nRoutingBundle\\": "src/" }
Expand All @@ -29,9 +29,6 @@
"extra": {
"branch-alias": {
"dev-master": "0.0.1-dev"
},
"bamarni-bin": {
"target-directory": "bin/tools"
}
},
"minimum-stability": "dev",
Expand Down
File renamed without changes.
29 changes: 16 additions & 13 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true" bootstrap="vendor/autoload.php">

<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
failOnRisky="true"
failOnWarning="true"
>
<php>
<server name="KERNEL_DIR" value="tests/fixtures/app" />
<server name="KERNEL_CLASS" value="AppKernel" />
<server name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0"/>
<server name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0&amp;quiet[]=indirect&amp;quiet[]=other"/>
</php>

<testsuites>
<testsuite name="UmpirskyI18nRoutingBundle Test Suite">
<directory suffix="Test.php">tests</directory>
<directory>tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory>src/</directory>
<exclude>
<directory>src/Resources</directory>
<directory>tests</directory>
<directory>vendor</directory>
</exclude>
</whitelist>
</filter>
<coverage>
<include>
<directory>src</directory>
</include>
</coverage>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
Expand Down
18 changes: 0 additions & 18 deletions spec/Routing/Generator/LocaleRequirementGeneratorSpec.php

This file was deleted.

32 changes: 0 additions & 32 deletions spec/Routing/Loader/I18nRouteLoaderSpec.php

This file was deleted.

34 changes: 0 additions & 34 deletions spec/Routing/RouterSpec.php

This file was deleted.

25 changes: 0 additions & 25 deletions spec/Routing/Strategy/PrefixExceptDefaultStrategySpec.php

This file was deleted.

25 changes: 0 additions & 25 deletions spec/Routing/Strategy/PrefixStrategySpec.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/DependencyInjection/UmpirskyI18nRoutingExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function load(array $configs, ContainerBuilder $container): void
$processor = new Processor();
$config = $processor->processConfiguration(new Configuration(), $configs);

$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../../config'));
$loader->load('services.xml');

$container->getDefinition('umpirsky_i18n_routing.routing.loader.i18n_route_loader')->addArgument(
Expand Down
2 changes: 1 addition & 1 deletion src/Routing/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function matchRequest(Request $request): array
return $this->normalizeI18nMatch($this->router->matchRequest($request));
}

public function warmUp($cacheDir): array
public function warmUp($cacheDir, $buildDir = null): array
{
if ($this->router instanceof WarmableInterface) {
return $this->router->warmUp($cacheDir);
Expand Down
Loading