Skip to content

Commit

Permalink
Allow Symfony 7 versions of packages (#172)
Browse files Browse the repository at this point in the history
* Allow Symfony 7 versions of packages

* Add more PHP versions to test matrix

* Fix compatibility to Symfony 7
  • Loading branch information
alexander-schranz authored Apr 7, 2024
1 parent 320ac89 commit 4ea3670
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 29 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,17 @@ jobs:
php-cs-fixer: false
max-phpunit-version: '8'

- php-version: '8.1'
- php-version: '8.2'
elasticsearch-version: '7.11.1'
elasticsearch-package-constraint: '~7.11.0'
minimum-stability: 'stable'
dependency-versions: 'highest'
tools: 'composer:v2'
php-cs-fixer: false

- php-version: '8.3'
elasticsearch-version: '7.17.19'
elasticsearch-package-constraint: '~7.17.0'
minimum-stability: 'dev'
dependency-versions: 'highest'
tools: 'composer:v2'
Expand Down
2 changes: 1 addition & 1 deletion Command/IndexRebuildCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function configure()
$this->setName(self::$defaultName);
}

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$formatterHelper = new FormatterHelper();
$output->writeln(
Expand Down
4 changes: 3 additions & 1 deletion Command/InitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

/**
* Initializes the search adapter.
*
* @final
*/
class InitCommand extends Command
{
Expand All @@ -41,7 +43,7 @@ public function configure()
$this->setHelp('This command will simply call the initialize method of the currently active search adapter.');
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->adapter->initialize();

Expand Down
5 changes: 4 additions & 1 deletion Command/OptimizeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
* @final
*/
class OptimizeCommand extends Command
{
protected static $defaultName = 'massive:search:optimize';
Expand All @@ -38,7 +41,7 @@ public function configure()
$this->setDescription('Optimize all search indices. Affects only indices that are managed with the zend_lucene adapter at the moment.');
}

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
if (!$this->adapter instanceof OptimizeableAdapterInterface) {
$output->writeln(\sprintf('Adapter "%s" does not support index optimization.', \get_class($this->adapter)));
Expand Down
4 changes: 3 additions & 1 deletion Command/PurgeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

/**
* Command to purge search indexes.
*
* @final
*/
class PurgeCommand extends Command
{
Expand Down Expand Up @@ -65,7 +67,7 @@ public function configure()
$this->addOption('force', null, InputOption::VALUE_NONE, 'Do not ask for confirmation.');
}

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$indexes = $input->getOption('index');
$all = $input->getOption('all');
Expand Down
4 changes: 3 additions & 1 deletion Command/QueryCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

/**
* Command to execute a query on the configured search engine.
*
* @final
*/
class QueryCommand extends Command
{
Expand Down Expand Up @@ -54,7 +56,7 @@ public function configure()
);
}

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$query = $input->getArgument('query');
$indexes = $input->getOption('index');
Expand Down
4 changes: 3 additions & 1 deletion Command/ReindexCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

/**
* Command to build (or rebuild) the search index.
*
* @final
*/
class ReindexCommand extends Command
{
Expand Down Expand Up @@ -89,7 +91,7 @@ public function configure()
$this->addOption('provider', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Provider name');
}

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$formatterHelper = new FormatterHelper();

Expand Down
4 changes: 3 additions & 1 deletion Command/StatusCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
/**
* This command returns some vendor specific information about
* the currently configured search implementation.
*
* @final
*/
class StatusCommand extends Command
{
Expand Down Expand Up @@ -48,7 +50,7 @@ public function configure()
);
}

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$status = $this->searchManager->getStatus();

Expand Down
4 changes: 1 addition & 3 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ class Configuration implements ConfigurationInterface
{
/**
* Returns the config tree builder.
*
* @return TreeBuilder
*/
public function getConfigTreeBuilder()
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('massive_search');
$treeBuilder->getRootNode()
Expand Down
36 changes: 18 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@
],
"require": {
"jms/metadata": "^2.6",
"symfony/config": "^4.3 || ^5.0 || ^6.0",
"symfony/console": "^4.3 || ^5.0 || ^6.0",
"symfony/event-dispatcher": "^4.3 || ^5.0 || ^6.0",
"symfony/expression-language": "^4.3 || ^5.0 || ^6.0",
"symfony/dependency-injection": "^4.3 || ^5.0 || ^6.0",
"symfony/property-access": "^4.3 || ^5.0 || ^6.0",
"symfony/config": "^4.3 || ^5.0 || ^6.0 || ^7.0",
"symfony/console": "^4.3 || ^5.0 || ^6.0 || ^7.0",
"symfony/event-dispatcher": "^4.3 || ^5.0 || ^6.0 || ^7.0",
"symfony/expression-language": "^4.3 || ^5.0 || ^6.0 || ^7.0",
"symfony/dependency-injection": "^4.3 || ^5.0 || ^6.0 || ^7.0",
"symfony/property-access": "^4.3 || ^5.0 || ^6.0 || ^7.0",
"php": "^7.2 || ^8.0"
},
"require-dev": {
"handcraftedinthealps/zendsearch": "^2.0",
"elasticsearch/elasticsearch": "^2.1 || ^5.0 || ^7.0",
"symfony-cmf/testing": "^3.0 || ^4.0@dev",
"symfony/filesystem": "^4.3.2 || ^5.0 || ^6.0",
"symfony/finder": "^4.3 || ^5.0 || ^6.0",
"symfony/http-kernel": "^4.3 || ^5.0 || ^6.0",
"symfony/framework-bundle": "^4.3 || ^5.0 || ^6.0",
"symfony/form": "^4.3 || ^5.0 || ^6.0",
"symfony/monolog-bridge": "^4.3 || ^5.0 || ^6.0",
"symfony-cmf/testing": "^3.0 || ^4.0 || ^5.0",
"symfony/filesystem": "^4.3.2 || ^5.0 || ^6.0 || ^7.0",
"symfony/finder": "^4.3 || ^5.0 || ^6.0 || ^7.0",
"symfony/http-kernel": "^4.3 || ^5.0 || ^6.0 || ^7.0",
"symfony/framework-bundle": "^4.3 || ^5.0 || ^6.0 || ^7.0",
"symfony/form": "^4.3 || ^5.0 || ^6.0 || ^7.0",
"symfony/monolog-bridge": "^4.3 || ^5.0 || ^6.0 || ^7.0",
"symfony/monolog-bundle": "^3.1",
"symfony/security-bundle": "^4.3 || ^5.0 || ^6.0",
"symfony/twig-bundle": "^4.3 || ^5.0 || ^6.0",
"symfony/validator": "^4.3 || ^5.0 || ^6.0",
"symfony/phpunit-bridge": "^5.0.4 || ^6.0",
"matthiasnoback/symfony-dependency-injection-test": "^4.0",
"symfony/security-bundle": "^4.3 || ^5.0 || ^6.0 || ^7.0",
"symfony/twig-bundle": "^4.3 || ^5.0 || ^6.0 || ^7.0",
"symfony/validator": "^4.3 || ^5.0 || ^6.0 || ^7.0",
"symfony/phpunit-bridge": "^5.0.4 || ^6.0 || ^7.0",
"matthiasnoback/symfony-dependency-injection-test": "^4.0 || ^5.0",
"doctrine/doctrine-bundle": "^1.10 || ^2.0",
"doctrine/orm": "^2.5",

Expand Down

0 comments on commit 4ea3670

Please sign in to comment.