Skip to content

Commit

Permalink
Add support for Symfony 7 (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
stof authored Dec 18, 2023
1 parent fdaddb7 commit df5db0f
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 49 deletions.
7 changes: 3 additions & 4 deletions BazingaJsTranslationBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@

/**
* @author William DURAND <[email protected]>
*
* @final
*/
class BazingaJsTranslationBundle extends Bundle
{
/**
* @return void
*/
public function build(ContainerBuilder $container)
public function build(ContainerBuilder $container): void
{
parent::build($container);

Expand Down
17 changes: 5 additions & 12 deletions Command/DumpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
/**
* @author Adrien Russo <[email protected]>
* @author Hugo Monteiro <[email protected]>
*
* @final
*/
class DumpCommand extends Command
{
Expand Down Expand Up @@ -42,10 +44,7 @@ public function __construct(TranslationDumper $dumper, $projectDir)
parent::__construct();
}

/**
* @return void
*/
protected function configure()
protected function configure(): void
{
$this
->setName('bazinga:js-translation:dump')
Expand Down Expand Up @@ -79,20 +78,14 @@ protected function configure()
);
}

/**
* @return void
*/
protected function initialize(InputInterface $input, OutputInterface $output)
protected function initialize(InputInterface $input, OutputInterface $output): void
{
parent::initialize($input, $output);

$this->targetPath = $input->getArgument('target') ?: sprintf('%s/../web/js', $this->kernelRootDir);
}

/**
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$formats = $input->getOption('format');
$merge = (object) array(
Expand Down
2 changes: 2 additions & 0 deletions Controller/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

/**
* @author William DURAND <[email protected]>
*
* @final
*/
class Controller
{
Expand Down
9 changes: 3 additions & 6 deletions DependencyInjection/BazingaJsTranslationExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,12 @@
/**
* @author William DURAND <[email protected]>
* @author Hugo Monteiro <[email protected]>
*
* @final
*/
class BazingaJsTranslationExtension extends Extension
{
/**
* Load configuration.
*
* @return void
*/
public function load(array $configs, ContainerBuilder $container)
public function load(array $configs, ContainerBuilder $container): void
{
$processor = new Processor();
$configuration = new Configuration($container->getParameter('kernel.debug'));
Expand Down
7 changes: 3 additions & 4 deletions DependencyInjection/Compiler/AddLoadersPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@

/**
* @author William DURAND <[email protected]>
*
* @internal
*/
class AddLoadersPass implements CompilerPassInterface
{
/**
* @return void
*/
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
if (!$container->hasDefinition('bazinga.jstranslation.controller')) {
return;
Expand Down
7 changes: 3 additions & 4 deletions DependencyInjection/Compiler/TranslationResourceFilesPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@

/**
* @author Hugo MONTEIRO <[email protected]>
*
* @internal
*/
class TranslationResourceFilesPass implements CompilerPassInterface
{
/**
* @return void
*/
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
if (!$container->has('translator.default')) {
return;
Expand Down
9 changes: 3 additions & 6 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@

/**
* @author William DURAND <[email protected]>
*
* @final
*/
class Configuration implements ConfigurationInterface
{
/**
* Generates the configuration tree builder.
*
* @return TreeBuilder The tree builder
*/
public function getConfigTreeBuilder()
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('bazinga_js_translation');

Expand Down
2 changes: 2 additions & 0 deletions Dumper/TranslationDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
/**
* @author Adrien Russo <[email protected]>
* @author Hugo Monteiro <[email protected]>
*
* @internal
*/
class TranslationDumper
{
Expand Down
2 changes: 2 additions & 0 deletions Finder/TranslationFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* @author William DURAND <[email protected]>
* @author Markus Poerschke <[email protected]>
* @author Hugo MONTEIRO <[email protected]>
*
* @internal
*/
class TranslationFinder
{
Expand Down
25 changes: 12 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,19 @@
],
"require": {
"php": ">=7.2.5",
"symfony/framework-bundle": "~4.4|~5.0|~6.0",
"symfony/finder": "~4.4|~5.0|~6.0",
"symfony/console": "~4.4|~5.0|~6.0",
"symfony/intl": "~4.4|~5.0|~6.0",
"symfony/translation": "~4.4|~5.0|~6.0",
"symfony/twig-bundle": "~4.4|~5.0|~6.0"
"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"
},
"require-dev": {
"symfony/asset": "~4.4|~5.0|~6.0",
"symfony/filesystem": "~4.4|~5.0|~6.0",
"symfony/yaml": "~4.4|~5.0|~6.0",
"symfony/browser-kit": "~4.4|~5.0|~6.0",
"symfony/twig-bundle": "~4.4|~5.0|~6.0",
"symfony/phpunit-bridge": "^5.0|^6.0",
"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",
"phpunit/phpunit": "^4.8|~5.7|~6.5|~8"
},
"replace": {
Expand All @@ -36,7 +35,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.7-dev"
"dev-master": "3.x-dev"
}
}
}

0 comments on commit df5db0f

Please sign in to comment.