Skip to content

Commit

Permalink
Allow Symfony 7
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean85 committed Jan 15, 2024
1 parent 5be946b commit 696deac
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 22 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
"php": "^7.4 || ^8.0",
"ext-mongodb": "^1.6",
"mongodb/mongodb": "^1.5",
"symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0"
"symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0 || ^7.0"
},
"require-dev": {
"matthiasnoback/symfony-dependency-injection-test": "^4",
"symfony/web-profiler-bundle": "^4.4 || ^5.0 || ^6.0",
"symfony/console": "^4.4 || ^5.0 || ^6.0",
"symfony/web-profiler-bundle": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/console": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"phpunit/phpunit": "^9.6.13",
"symfony/phpunit-bridge": "^7.0",
"facile-it/facile-coding-standard": "^1.0.1",
Expand Down
4 changes: 2 additions & 2 deletions src/Command/AbstractCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected function getContainer(): ContainerInterface
/**
* @inheritDoc
*/
protected function configure()
protected function configure(): void
{
parent::configure();
$this
Expand All @@ -53,7 +53,7 @@ protected function configure()
/**
* @inheritDoc
*/
protected function initialize(InputInterface $input, OutputInterface $output)
protected function initialize(InputInterface $input, OutputInterface $output): void
{
parent::initialize($input, $output);
$this->io = new SymfonyStyle($input, $output);
Expand Down
2 changes: 1 addition & 1 deletion src/Command/DropCollectionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class DropCollectionCommand extends AbstractCommand
/**
* @inheritDoc
*/
protected function configure()
protected function configure(): void
{
parent::configure();
$this
Expand Down
2 changes: 1 addition & 1 deletion src/Command/DropDatabaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class DropDatabaseCommand extends AbstractCommand
/**
* @inheritDoc
*/
protected function configure()
protected function configure(): void
{
parent::configure();
$this
Expand Down
8 changes: 4 additions & 4 deletions src/Command/LoadFixturesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class LoadFixturesCommand extends AbstractCommand
/**
* @inheritDoc
*/
protected function configure()
protected function configure(): void
{
parent::configure();
$this
Expand All @@ -33,7 +33,7 @@ protected function configure()
->setDescription('Load fixtures and applies them');
}

protected function initialize(InputInterface $input, OutputInterface $output)
protected function initialize(InputInterface $input, OutputInterface $output): void
{
parent::initialize($input, $output);
$this->loader = new MongoFixturesLoader($this->getContainer());
Expand Down Expand Up @@ -68,7 +68,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
return 0;
}

private function loadFixture(MongoFixtureInterface $indexList)
private function loadFixture(MongoFixtureInterface $indexList): void
{
$indexList->loadData();
$indexList->loadIndexes();
Expand All @@ -90,7 +90,7 @@ private function prepareSearchPaths(InputInterface $input, KernelInterface $kern
return $paths;
}

private function loadPaths(array $paths)
private function loadPaths(array $paths): void
{
foreach ($paths as $path) {
if (is_dir($path)) {
Expand Down
11 changes: 4 additions & 7 deletions src/DataCollector/MongoDbDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,12 @@ class MongoDbDataCollector extends DataCollector
/** @var DataCollectorLoggerInterface */
private $logger;

/** @var array */
protected $data;

public function __construct()
{
$this->reset();
}

public function reset()
public function reset(): void
{
$this->data = [
self::QUERY_KEYWORD => [],
Expand All @@ -43,12 +40,12 @@ public function reset()
];
}

public function setLogger(DataCollectorLoggerInterface $logger)
public function setLogger(DataCollectorLoggerInterface $logger): void
{
$this->logger = $logger;
}

public function collect(Request $request, Response $response, $exception = null)
public function collect(Request $request, Response $response, $exception = null): void
{
if ($exception && ! $exception instanceof \Throwable) {
throw new \InvalidArgumentException('Expecting \Throwable, got ' . get_debug_type($exception));
Expand Down Expand Up @@ -101,7 +98,7 @@ public function getConnections(): array
/**
* @inheritDoc
*/
public function getName()
public function getName(): string
{
return 'mongodb';
}
Expand Down
4 changes: 1 addition & 3 deletions src/DependencyInjection/MongoDbBundleExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class MongoDbBundleExtension extends Extension
/** @var ContainerBuilder */
private $containerBuilder;

public function load(array $configs, ContainerBuilder $container)
public function load(array $configs, ContainerBuilder $container): void
{
$this->containerBuilder = $container;
$config = $this->processConfiguration(new Configuration(), $configs);
Expand All @@ -42,8 +42,6 @@ public function load(array $configs, ContainerBuilder $container)
$loader->load('profiler.xml');
$this->attachDataCollectionListenerToEventManager();
}

return $config;
}

private function mustCollectData(array $config): bool
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/Command/AbstractCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private function addCommandToApplication()

class FakeCommand extends AbstractCommand
{
protected function configure()
protected function configure(): void
{
parent::configure();
$this
Expand Down

0 comments on commit 696deac

Please sign in to comment.