Skip to content

Commit

Permalink
Support Symfony 6 (#1278)
Browse files Browse the repository at this point in the history
* allow up to symfony 6

* set branch alias

* prepare for symfony 6 removing deprecations

* reformat annotations to workin in php7 and 8

* deprecation fix

* update readme

* revert branch alias

* added missing return

* remove extra line

* sort alphabetically

Co-authored-by: ychadwick <ychadwick>
  • Loading branch information
ychadwick authored Sep 29, 2022
1 parent 76b7bf1 commit d8ba5a0
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 11 deletions.
6 changes: 4 additions & 2 deletions Command/BaseBootstrapSymlinkCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ abstract protected function getTwitterBootstrapName();
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->input = $input;
$this->output = $output;
Expand All @@ -179,7 +179,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
} else {
$this->output->writeln('<error>Could not find composer and manual option not specified!</error>');

return;
return 0;
}

// Automatically detect if on Win XP where symlink will allways fail
Expand All @@ -205,6 +205,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

$this->output->writeln(' ... <info>OK</info>');

return 0;
}

protected function getBootstrapPathsFromUser()
Expand Down
3 changes: 3 additions & 0 deletions Command/BootstrapSymlinkLessCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@

namespace Mopa\Bundle\BootstrapBundle\Command;

use Symfony\Component\Console\Attribute\AsCommand;

/**
* Command to create Bootstrap symlink to MopaBootstrapBundle.
*/
#[AsCommand(name: 'mopa:bootstrap:symlink:less')]
class BootstrapSymlinkLessCommand extends BaseBootstrapSymlinkCommand
{
public static $mopaBootstrapBundleName = 'mopa/bootstrap-bundle';
Expand Down
3 changes: 3 additions & 0 deletions Command/BootstrapSymlinkSassCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@

namespace Mopa\Bundle\BootstrapBundle\Command;

use Symfony\Component\Console\Attribute\AsCommand;

/**
* Command to create Bootstrap (SASS) symlink to MopaBootstrapBundle.
*/
#[AsCommand(name: 'mopa:bootstrap:symlink:sass')]
class BootstrapSymlinkSassCommand extends BaseBootstrapSymlinkCommand
{
public static $twitterBootstrapName = 'twbs/bootstrap-sass';
Expand Down
6 changes: 5 additions & 1 deletion Command/InstallFontCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Mopa\Bridge\Composer\Adapter\ComposerAdapter;
use Mopa\Bridge\Composer\Util\ComposerPathFinder;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
Expand All @@ -23,6 +24,7 @@
/**
* Command to create Bootstrap symlink to MopaBootstrapBundle.
*/
#[AsCommand(name: 'mopa:bootstrap:install:font')]
class InstallFontCommand extends Command
{
public static $iconSetsPaths = [
Expand Down Expand Up @@ -70,7 +72,7 @@ protected function configure()
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$finder = new Finder();
$iconWebPath = $this->kernel->getProjectDir().\DIRECTORY_SEPARATOR.'web'.\DIRECTORY_SEPARATOR.'fonts';
Expand Down Expand Up @@ -98,6 +100,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

$output->writeln('Font: '.$this->iconSet.' Installed... <info>OK</info>');

return 0;
}

public static function installFonts()
Expand Down
2 changes: 1 addition & 1 deletion DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Configuration implements ConfigurationInterface
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder(self::KEY);
$rootNode = $treeBuilder->getRootNode();
Expand Down
2 changes: 1 addition & 1 deletion Form/Type/TabType.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function buildView(FormView $view, FormInterface $form, array $options)
/**
* {@inheritdoc}
*/
public function getBlockPrefix()
public function getBlockPrefix(): string
{
return 'tab';
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Versions and dependencies

| MopaBootstrapBundle | Bootstrap | Symfony | PHP |
| -------------------------- | --------- | ------------------------ | -------------- |
| [**3.4**] (**master**) | ^3.0 | ^4.4 \|\| ^5.1 | ^7.2 \|\| ^8.0 |
| [**3.4**] (**master**) | ^3.0 | ^4.4 \|\| ^5.1 \|\| ^6.1 | ^7.2 \|\| ^8.0 |
| [**3.3**] (**3.3**) | ^3.0 | ^2.3 \|\| ^3.0 \|\| ^4.0 | |
| [**3.2**] (*unmaintained*) | ^3.0 | ^2.3 \|\| ^3.0 | |
| [**3.1**] (*unmaintained*) | ^3.0 | ^2.3 \|\| ^3.0 | |
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
"require": {
"php": "^7.2 || ^8.0",
"mopa/composer-bridge": "^1.3",
"symfony/console": "^4.4 || ^5.1",
"symfony/form": "^4.4 || ^5.1",
"symfony/framework-bundle": "^4.4 || ^5.1",
"symfony/twig-bundle": "^4.4 || ^5.1",
"symfony/console": "^4.4 || ^5.1 || ^6.0",
"symfony/form": "^4.4 || ^5.1 || ^6.0",
"symfony/framework-bundle": "^4.4 || ^5.1 || ^6.0",
"symfony/twig-bundle": "^4.4 || ^5.1 || ^6.0",
"twig/twig": "^2.9 || ^3.0"
},
"require-dev": {
"phpunit/phpunit": "^8.5 || ^9.4",
"symfony/security-bundle": "^4.4 || ^5.1",
"symfony/security-bundle": "^4.4 || ^5.1 || ^6.0",
"symfony/translation-contracts": "^2.0"
},
"suggest": {
Expand Down

0 comments on commit d8ba5a0

Please sign in to comment.