Skip to content

Commit

Permalink
Clearing deprecation notices
Browse files Browse the repository at this point in the history
  • Loading branch information
pmishev committed Nov 11, 2024
1 parent 50fffdd commit afc63a4
Show file tree
Hide file tree
Showing 18 changed files with 26 additions and 48 deletions.
4 changes: 2 additions & 2 deletions src/CacheWarmer/MetadataCacheWarmer.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public function isOptional(): bool
return true;
}

public function warmUp(string $cacheDir): array
public function warmUp(string $cacheDir, ?string $buildDir = null): array
{
return $this->metadataCollector->warmUp($cacheDir);
return $this->metadataCollector->warmUp($cacheDir, $buildDir);
}
}
5 changes: 2 additions & 3 deletions src/Command/IndexBuildCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Sineflow\ElasticsearchBundle\Command;

use Sineflow\ElasticsearchBundle\Manager\IndexManagerRegistry;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -12,10 +13,9 @@
/**
* Command for (re)building elasticsearch index.
*/
#[AsCommand('sineflow:es:index:build', '(Re)builds elasticsearch index.')]
class IndexBuildCommand extends Command
{
protected static $defaultName = 'sineflow:es:index:build';

public function __construct(private readonly IndexManagerRegistry $indexManagerRegistry)
{
parent::__construct();
Expand All @@ -29,7 +29,6 @@ protected function configure(): void
parent::configure();

$this
->setDescription('(Re)builds elasticsearch index.')
->addArgument(
'index',
InputArgument::REQUIRED,
Expand Down
5 changes: 2 additions & 3 deletions src/Command/IndexCreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Sineflow\ElasticsearchBundle\Command;

use Sineflow\ElasticsearchBundle\Manager\IndexManagerRegistry;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -11,10 +12,9 @@
/**
* Command for creating elasticsearch index.
*/
#[AsCommand('sineflow:es:index:create', 'Creates elasticsearch index.')]
class IndexCreateCommand extends Command
{
protected static $defaultName = 'sineflow:es:index:create';

public function __construct(private readonly IndexManagerRegistry $indexManagerRegistry)
{
parent::__construct();
Expand All @@ -28,7 +28,6 @@ protected function configure(): void
parent::configure();

$this
->setDescription('Creates elasticsearch index.')
->addArgument(
'index',
InputArgument::REQUIRED,
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/DocumentMetadataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function __construct(
*
* @throws InvalidArgumentException
*/
public function warmUp(string $cacheDir): array
public function warmUp(string $cacheDir, ?string $buildDir = null): array
{
// force cache generation
foreach ($this->documentClassToIndexManagerNames as $documentClass => $indexManagerName) {
Expand Down
2 changes: 1 addition & 1 deletion src/SineflowElasticsearchBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SineflowElasticsearchBundle extends Bundle
/**
* {@inheritdoc}
*/
public function build(ContainerBuilder $container)
public function build(ContainerBuilder $container): void
{
parent::build($container);

Expand Down
5 changes: 1 addition & 4 deletions tests/AbstractContainerAwareTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ abstract class AbstractContainerAwareTestCase extends KernelTestCase
*/
abstract class AbstractContainerAwareTestCase extends KernelTestCase
{
/**
* @var ContainerInterface
*/
private $cachedContainer;
private ?ContainerInterface $cachedContainer;

/**
* {@inheritDoc}
Expand Down
4 changes: 1 addition & 3 deletions tests/AbstractElasticsearchTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ abstract class AbstractElasticsearchTestCase extends AbstractContainerAwareTestC
* ]
* ]
* ]
*
* @return array
*/
protected function getDataArray()
protected function getDataArray(): array
{
return [];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ElasticsearchProviderTest extends AbstractElasticsearchTestCase
/**
* {@inheritdoc}
*/
protected function getDataArray()
protected function getDataArray(): array
{
return [
'bar' => [
Expand Down
7 changes: 2 additions & 5 deletions tests/Functional/Document/Provider/ProviderRegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@

class ProviderRegistryTest extends AbstractElasticsearchTestCase
{
/**
* @var ProviderRegistry
*/
private $providerRegistry;
private ProviderRegistry $providerRegistry;

/**
* {@inheritdoc}
*/
protected function getDataArray()
protected function getDataArray(): array
{
return [
'bar' => [
Expand Down
22 changes: 5 additions & 17 deletions tests/Functional/Document/RepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,18 @@ class RepositoryTest extends AbstractElasticsearchTestCase
{
use AssertThrows;

/**
* @var Repository
*/
private $repository;
private Repository $repository;

/**
* @var IndexManager
*/
private $indexManager;
private IndexManager $indexManager;

/**
* @var Finder
*/
private $finder;
private Finder $finder;

/**
* @var DocumentMetadataCollector
*/
private $metadataCollector;
private DocumentMetadataCollector $metadataCollector;

/**
* {@inheritdoc}
*/
protected function getDataArray()
protected function getDataArray(): array
{
return [
'bar' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class KnpPaginatorAdapterTest extends AbstractElasticsearchTestCase
/**
* {@inheritdoc}
*/
protected function getDataArray()
protected function getDataArray(): array
{
return [
'bar' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/Finder/Adapter/ScrollAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ScrollAdapterTest extends AbstractElasticsearchTestCase
/**
* {@inheritdoc}
*/
protected function getDataArray()
protected function getDataArray(): array
{
return [
'bar' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/Finder/FinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class FinderTest extends AbstractElasticsearchTestCase
/**
* {@inheritdoc}
*/
protected function getDataArray()
protected function getDataArray(): array
{
return [
'bar' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/Manager/IndexManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class IndexManagerTest extends AbstractElasticsearchTestCase
/**
* {@inheritdoc}
*/
protected function getDataArray()
protected function getDataArray(): array
{
return [
'bar' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/Profiler/ElasticsearchProfilerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ElasticsearchProfilerTest extends AbstractElasticsearchTestCase
/**
* {@inheritdoc}
*/
protected function getDataArray()
protected function getDataArray(): array
{
return [
'default' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/Result/DocumentIteratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class DocumentIteratorTest extends AbstractElasticsearchTestCase
/**
* {@inheritdoc}
*/
protected function getDataArray()
protected function getDataArray(): array
{
return [
'bar' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Annotation/DocumentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function testDump(): void
{
$doc = new Document();

$doc->type = 'product';
$doc->repositoryClass = 'some class name';
$doc->options = [
'dynamic' => 'strict',
'foo' => 'bar',
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Annotation/PropertyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function testDump(): void
'analyzer' => 'standard',
'foo' => 'bar',
];
$type->foo = 'bar';
$type->enumType = 'bar';

$this->assertEquals(
[
Expand Down

0 comments on commit afc63a4

Please sign in to comment.