Skip to content

Add Symfony 7.3 support #382

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

Merged
merged 1 commit into from
May 15, 2025
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
11 changes: 10 additions & 1 deletion .github/workflows/pre-release-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,24 @@ jobs:
strategy:
matrix:
php-version: ['7.4', '8.1', '8.2', '8.3', '8.4']
sf-version: ['5.4', '6.4', '7.0', '7.1', '7.2']
sf-version: ['5.4', '6.4', '7.0', '7.1', '7.2', '7.3']
exclude:
- php-version: '7.4'
sf-version: '6.4'
- php-version: '7.4'
sf-version: '7.0'
- php-version: '7.4'
sf-version: '7.1'
- php-version: '7.4'
sf-version: '7.3'
- php-version: '8.1'
sf-version: '5.4'
- php-version: '8.1'
sf-version: '7.0'
- php-version: '8.1'
sf-version: '7.1'
- php-version: '8.1'
sf-version: '7.3'
- php-version: '8.2'
sf-version: '5.4'
- php-version: '8.3'
Expand All @@ -78,6 +82,11 @@ jobs:
php-version: ${{ matrix.php-version }}
tools: composer, flex

- name: Configure minimum stability
if: matrix.sf-version == '7.3'
# Currently Symfony 7.3 release is in beta, which means we need to configure this flag to be able to use it.
run: composer config minimum-stability beta

- name: Validate composer.json and composer.lock
run: composer validate

Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,24 @@ jobs:
strategy:
matrix:
php-version: ['7.4', '8.1', '8.2', '8.3', '8.4']
sf-version: ['5.4', '6.4', '7.0', '7.1', '7.2']
sf-version: ['5.4', '6.4', '7.0', '7.1', '7.2', '7.3']
exclude:
- php-version: '7.4'
sf-version: '6.4'
- php-version: '7.4'
sf-version: '7.0'
- php-version: '7.4'
sf-version: '7.1'
- php-version: '7.4'
sf-version: '7.3'
- php-version: '8.1'
sf-version: '5.4'
- php-version: '8.1'
sf-version: '7.0'
- php-version: '8.1'
sf-version: '7.1'
- php-version: '8.1'
sf-version: '7.3'
- php-version: '8.2'
sf-version: '5.4'
- php-version: '8.3'
Expand All @@ -67,6 +71,11 @@ jobs:
php-version: ${{ matrix.php-version }}
tools: composer, flex

- name: Configure minimum stability
if: matrix.sf-version == '7.3'
# Currently Symfony 7.3 release is in beta, which means we need to configure this flag to be able to use it.
run: composer config minimum-stability beta

- name: Validate composer.json and composer.lock
run: composer validate

Expand Down
10 changes: 5 additions & 5 deletions config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,20 @@

<service id="Meilisearch\Bundle\Command\MeilisearchClearCommand">
<argument type="service" id="meilisearch.service" />
<tag name="console.command" />
<tag name="console.command" command="meilisearch:clear|meili:clear" description="Clear the index documents" />
</service>

<service id="Meilisearch\Bundle\Command\MeilisearchCreateCommand">
<argument type="service" id="meilisearch.service" />
<argument type="service" id="meilisearch.client" />
<argument type="service" id="meilisearch.settings_updater" />
<argument type="service" id="event_dispatcher" />
<tag name="console.command" />
<tag name="console.command" command="meilisearch:create|meili:create" description="Create indexes" />
</service>

<service id="Meilisearch\Bundle\Command\MeilisearchDeleteCommand">
<argument type="service" id="meilisearch.service" />
<tag name="console.command" />
<tag name="console.command" command="meilisearch:delete|meili:delete" description="Delete the indexes" />
</service>

<service id="Meilisearch\Bundle\Command\MeilisearchImportCommand">
Expand All @@ -76,14 +76,14 @@
<argument type="service" id="meilisearch.client" />
<argument type="service" id="meilisearch.settings_updater" />
<argument type="service" id="event_dispatcher" />
<tag name="console.command" />
<tag name="console.command" command="meilisearch:import|meili:import" description="Import given entity into search engine" />
</service>

<service id="Meilisearch\Bundle\Command\MeilisearchUpdateSettingsCommand">
<argument type="service" id="meilisearch.service" />
<argument type="service" id="meilisearch.settings_updater" />
<argument type="service" id="event_dispatcher" />
<tag name="console.command" />
<tag name="console.command" command="meilisearch:update-settings" description="Push settings to meilisearch" />
</service>

<service id="Meilisearch\Bundle\Services\UnixTimestampNormalizer">
Expand Down
13 changes: 2 additions & 11 deletions src/Command/MeilisearchClearCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,17 @@

namespace Meilisearch\Bundle\Command;

use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'meilisearch:clear', description: 'Clear the index documents', aliases: ['meili:clear'])]
final class MeilisearchClearCommand extends IndexCommand
{
public static function getDefaultName(): string
{
return 'meilisearch:clear|meili:clear';
}

public static function getDefaultDescription(): string
{
return 'Clear the index documents';
}

protected function configure(): void
{
$this
->setDescription(self::getDefaultDescription())
->addOption('indices', 'i', InputOption::VALUE_OPTIONAL, 'Comma-separated list of index names');
}

Expand Down
13 changes: 2 additions & 11 deletions src/Command/MeilisearchCreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
use Meilisearch\Bundle\SearchService;
use Meilisearch\Bundle\Services\SettingsUpdater;
use Meilisearch\Client;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

#[AsCommand(name: 'meilisearch:create', description: 'Create indexes', aliases: ['meili:create'])]
final class MeilisearchCreateCommand extends IndexCommand
{
private Client $searchClient;
Expand All @@ -31,20 +33,9 @@ public function __construct(SearchService $searchService, Client $searchClient,
$this->eventDispatcher = $eventDispatcher;
}

public static function getDefaultName(): string
{
return 'meilisearch:create|meili:create';
}

public static function getDefaultDescription(): string
{
return 'Create indexes';
}

protected function configure(): void
{
$this
->setDescription(self::getDefaultDescription())
->addOption('indices', 'i', InputOption::VALUE_OPTIONAL, 'Comma-separated list of index names')
->addOption(
'update-settings',
Expand Down
13 changes: 2 additions & 11 deletions src/Command/MeilisearchDeleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,17 @@

use Meilisearch\Bundle\Collection;
use Meilisearch\Exceptions\ApiException;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'meilisearch:delete', description: 'Delete the indexes', aliases: ['meili:delete'])]
final class MeilisearchDeleteCommand extends IndexCommand
{
public static function getDefaultName(): string
{
return 'meilisearch:delete|meili:delete';
}

public static function getDefaultDescription(): string
{
return 'Delete the indexes';
}

protected function configure(): void
{
$this
->setDescription(self::getDefaultDescription())
->addOption('indices', 'i', InputOption::VALUE_OPTIONAL, 'Comma-separated list of index names');
}

Expand Down
13 changes: 2 additions & 11 deletions src/Command/MeilisearchImportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
use Meilisearch\Bundle\Services\SettingsUpdater;
use Meilisearch\Client;
use Meilisearch\Exceptions\TimeOutException;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

#[AsCommand(name: 'meilisearch:import', description: 'Import given entity into search engine', aliases: ['meili:import'])]
final class MeilisearchImportCommand extends IndexCommand
{
private const TEMP_INDEX_PREFIX = '_tmp_';
Expand All @@ -38,20 +40,9 @@ public function __construct(SearchService $searchService, ManagerRegistry $manag
$this->eventDispatcher = $eventDispatcher;
}

public static function getDefaultName(): string
{
return 'meilisearch:import|meili:import';
}

public static function getDefaultDescription(): string
{
return 'Import given entity into search engine';
}

protected function configure(): void
{
$this
->setDescription(self::getDefaultDescription())
->addOption('indices', 'i', InputOption::VALUE_OPTIONAL, 'Comma-separated list of index names')
->addOption(
'update-settings',
Expand Down
13 changes: 2 additions & 11 deletions src/Command/MeilisearchUpdateSettingsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
use Meilisearch\Bundle\Model\Aggregator;
use Meilisearch\Bundle\SearchService;
use Meilisearch\Bundle\Services\SettingsUpdater;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

#[AsCommand(name: 'meilisearch:update-settings', description: 'Push settings to meilisearch')]
final class MeilisearchUpdateSettingsCommand extends IndexCommand
{
private SettingsUpdater $settingsUpdater;
Expand All @@ -28,20 +30,9 @@ public function __construct(SearchService $searchService, SettingsUpdater $setti
$this->eventDispatcher = $eventDispatcher;
}

public static function getDefaultName(): string
{
return 'meilisearch:update-settings';
}

public static function getDefaultDescription(): string
{
return 'Push settings to meilisearch';
}

protected function configure(): void
{
$this
->setDescription(self::getDefaultDescription())
->addOption('indices', 'i', InputOption::VALUE_OPTIONAL, 'Comma-separated list of index names')
->addOption(
'response-timeout',
Expand Down
6 changes: 6 additions & 0 deletions tests/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,11 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
'php_errors' => ['log' => true],
]);
}
// @phpstan-ignore-next-line
if (Kernel::VERSION_ID >= 70300) {
$container->prependExtensionConfig('framework', [
'property_info' => ['with_constructor_extractor' => false],
]);
}
}
}
2 changes: 2 additions & 0 deletions tests/baseline-ignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
%Method "ArrayAccess::offsetGet\(\)" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Meilisearch\\Contracts\\Data" now to avoid errors or add an explicit @return annotation to suppress this message.%
%Since symfony/var-exporter 7.3: The "Symfony\\Component\\VarExporter\\LazyGhostTrait" trait is deprecated, use native lazy objects instead.%
%Since symfony/var-exporter 7.3: Using ProxyHelper::generateLazyGhost\(\) is deprecated, use native lazy objects instead.%
Loading