Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 7 additions & 7 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
env:
fail-fast: true
PHPUNIT_FLAGS: "-v"
SYMFONY_REQUIRE: ">=4.4"
SYMFONY_REQUIRE: ">=5.4"
XDEBUG_MODE: "coverage"

jobs:
Expand All @@ -21,21 +21,21 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
php-version: ['8.1', '8.2', '8.3', '8.4', '8.5']
dependencies: [highest]
allowed-to-fail: [false]
symfony-version: [latest]
include:
- php-version: nightly
- php-version: '8.5'
dependencies: highest
allowed-to-fail: true
symfony-version: latest
steps:
- name: "Checkout code"
uses: actions/checkout@v4.1.7
uses: actions/checkout@v4

- name: "Install PHP with extensions"
uses: shivammathur/setup-php@2.7.0
uses: shivammathur/setup-php@v2
with:
coverage: xdebug
php-version: ${{ matrix.php-version }}
Expand Down Expand Up @@ -63,10 +63,10 @@ jobs:

steps:
- name: "Checkout code"
uses: actions/checkout@v4.1.7
uses: actions/checkout@v4

- name: "Setup node"
uses: actions/setup-node@v4.0.3
uses: actions/setup-node@v4
with:
node-version: 'lts/*'

Expand Down
8 changes: 4 additions & 4 deletions DependencyInjection/BazingaJsTranslationExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Definition\Processor;

Expand All @@ -22,9 +22,9 @@ public function load(array $configs, ContainerBuilder $container): void
$configuration = new Configuration($container->getParameter('kernel.debug'));
$config = $processor->processConfiguration($configuration, $configs);

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

$container
->getDefinition('bazinga.jstranslation.controller')
Expand Down
23 changes: 23 additions & 0 deletions Resources/config/controllers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

return static function (ContainerConfigurator $container) {
$parameters = $container->parameters();
$parameters->set('bazinga.jstranslation.controller.class', \Bazinga\Bundle\JsTranslationBundle\Controller\Controller::class);

$services = $container->services();

$services->set('bazinga.jstranslation.controller', '%bazinga.jstranslation.controller.class%')
->public()
->args([
service('translator'),
service('twig'),
service('bazinga.jstranslation.translation_finder'),
'%kernel.cache_dir%/bazinga-js-translation',
'%kernel.debug%',
abstract_arg('fallback locale'),
abstract_arg('default domain'),
abstract_arg('http cache time'),
]);
};
22 changes: 0 additions & 22 deletions Resources/config/controllers.xml

This file was deleted.

35 changes: 35 additions & 0 deletions Resources/config/services.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

return static function (ContainerConfigurator $container) {
$parameters = $container->parameters();
$parameters->set('bazinga.jstranslation.translation_finder.class', \Bazinga\Bundle\JsTranslationBundle\Finder\TranslationFinder::class);
$parameters->set('bazinga.jstranslation.translation_dumper.class', \Bazinga\Bundle\JsTranslationBundle\Dumper\TranslationDumper::class);

$services = $container->services();

$services->set('bazinga.jstranslation.translation_finder', '%bazinga.jstranslation.translation_finder.class%')
->public()
->args([[]]);

$services->set('bazinga.jstranslation.translation_dumper', '%bazinga.jstranslation.translation_dumper.class%')
->public()
->args([
service('twig'),
service('bazinga.jstranslation.translation_finder'),
service('filesystem'),
abstract_arg('fallback locale'),
abstract_arg('default domain'),
abstract_arg('active locales'),
abstract_arg('active domains'),
]);

$services->set('bazinga.jstranslation.dump_command', \Bazinga\Bundle\JsTranslationBundle\Command\DumpCommand::class)
->public()
->args([
service('bazinga.jstranslation.translation_dumper'),
'%kernel.project_dir%',
])
->tag('console.command', ['command' => 'bazinga:js-translation:dump']);
};
30 changes: 0 additions & 30 deletions Resources/config/services.xml

This file was deleted.

3 changes: 1 addition & 2 deletions Tests/Fixtures/app/config/disable_annotations.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
framework:
annotations: { enabled: false }
# annotations config was removed in Symfony 8
23 changes: 12 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@
],
"require": {
"php": ">=7.4",
"symfony/framework-bundle": "~4.4|~5.0|~6.0|~7.0",
"symfony/finder": "~4.4|~5.0|~6.0|~7.0",
"symfony/console": "~4.4|~5.0|~6.0|~7.0",
"symfony/intl": "~4.4|~5.0|~6.0|~7.0",
"symfony/translation": "~4.4|~5.0|~6.0|~7.0",
"symfony/twig-bundle": "~4.4|~5.0|~6.0|~7.0"
"symfony/dependency-injection": "~5.4|~6.0|~7.0|~8.0",
"symfony/framework-bundle": "~5.4|~6.0|~7.0|~8.0",
"symfony/finder": "~5.4|~6.0|~7.0|~8.0",
"symfony/console": "~5.4|~6.0|~7.0|~8.0",
"symfony/intl": "~5.4|~6.0|~7.0|~8.0",
"symfony/translation": "~5.4|~6.0|~7.0|~8.0",
"symfony/twig-bundle": "~5.4|~6.0|~7.0|~8.0"
},
"require-dev": {
"symfony/asset": "~4.4|~5.0|~6.0|~7.0",
"symfony/filesystem": "~4.4|~5.0|~6.0|~7.0",
"symfony/yaml": "~4.4|~5.0|~6.0|~7.0",
"symfony/browser-kit": "~4.4|~5.0|~6.0|~7.0",
"symfony/phpunit-bridge": "^5.0|^6.0|~7.0",
"symfony/asset": "~5.4|~6.0|~7.0|~8.0",
"symfony/filesystem": "~5.4|~6.0|~7.0|~8.0",
"symfony/yaml": "~5.4|~6.0|~7.0|~8.0",
"symfony/browser-kit": "~5.4|~6.0|~7.0|~8.0",
"symfony/phpunit-bridge": "^5.4|^6.0|~7.0|~8.0",
"phpunit/phpunit": "^4.8|~5.7|~6.5|~8"
},
"replace": {
Expand Down