Skip to content
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
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ 7.4 ]
php: [ 7.4, 8.0, 8.1 ]
version: [ lowest, standard ]
elastic: [ 7.12.1 ]

Expand Down Expand Up @@ -51,7 +51,6 @@ jobs:
name: PHPStan standard
run: make phpstan

- if: matrix.php == '7.4'
name: Tests
- name: Tests
run: make tests

44 changes: 0 additions & 44 deletions .travis.yml

This file was deleted.

25 changes: 15 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,25 @@
"php": ">=7.4",
"ext-json": "*",
"ext-curl": "*",
"spameri/elastic-query": "^v1.0.0-alpha.10",
"elasticsearch/elasticsearch": "^2.4.0 || ^7.12.0",
"nette/di": "^2.4.17 || ^3.0",
"nette/utils": "^2.5.7 || ^3.0",
"kdyby/console": "^2.7.1 || ^2.8.0",
"symfony/console": "^4",
"spameri/elastic-query": "^v1.0.0-alpha.13",
"elasticsearch/elasticsearch": "^7.12.0",
"nette/di": "^3.0.5",
"nette/utils": "^3.2.5",
"symfony/console": "^4.4.26",
"tracy/tracy": "^2.6.7",
"monolog/monolog": "^2.0.2",
"ezimuel/ringphp": "^1.1.2"
"ezimuel/ringphp": "^1.2"
},
"require-dev": {
"spameri/coding-standard": "dev-master",
"spameri/dependency-mocker": "^1.3",
"nette/tester": "^2.4",
"phpstan/phpstan": "0.12.84",
"php-coveralls/php-coveralls": "^2.1",
"nette/bootstrap": "~2.4.6 || ^3.0",
"nette/http": "^2.4.12 || ^3.0",
"mockery/mockery": "^1.2"
"nette/bootstrap": "^3.0",
"nette/http": "^3.0.7",
"kdyby/console": "^4.0.0",
"mockery/mockery": "^1.5"
},
"autoload": {
"psr-4": {
Expand All @@ -56,5 +56,10 @@
"psr-4": {
"SpameriTests\\": "tests/SpameriTests"
}
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
9 changes: 0 additions & 9 deletions phpstan-low.neon
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@ parameters:
ignoreErrors:
- '#PHPDoc tag \@throws with type Elasticsearch\\Common\\Exceptions\\ElasticsearchException is not subtype of Throwable#'
- '#Call to function array_key_exists\(\) with string and array<int, mixed> will always evaluate to false.#'
-
message: "#^Call to method addSetup\\(\\) on an unknown class Nette\\\\DI\\\\Definitions\\\\ServiceDefinition\\.$#"
count: 1
path: src/DI/SpameriElasticSearchExtension.php

-
message: "#^PHPDoc tag @var for variable \\$definition contains unknown class Nette\\\\DI\\\\Definitions\\\\ServiceDefinition\\.$#"
count: 1
path: src/DI/SpameriElasticSearchExtension.php

-
message: "#^Method Spameri\\\\Elastic\\\\Diagnostics\\\\PanelLogger\\:\\:emergency\\(\\) should return null but return statement is missing\\.$#"
Expand Down
6 changes: 3 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ parameters:
path: src/Model/TypeToNewIndex/Migrate.php

-
message: "#^Static method Nette\\\\DI\\\\Compiler\\:\\:loadDefinitions\\(\\) invoked with 3 parameters, 0 required\\.$#"
count: 1
path: src/DI/SpameriElasticSearchExtension.php
message: "#^Unable to resolve the template type T in call to method Nette\\\\DI\\\\Container\\:\\:getByType\\(\\)$#"
count: 2
path: src/Model/ServiceLocator.php


checkGenericClassInNonGenericObjectType: false
Expand Down
49 changes: 7 additions & 42 deletions src/DI/SpameriElasticSearchExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,17 @@ public function loadConfiguration(): void

$services = $this->toggleDebugBar($config, $services);

if ( ! \class_exists(\Symfony\Component\Console\Command\Command::class)) {
$services = $this->removeCommandDefinitions($services);
}

$services = $this->setConfigOptions($services, $config);

if (\method_exists($this->compiler, 'loadDefinitionsFromConfig')) {
$aliasedServices = [];
foreach ($services['services'] as $key => $service) {
$aliasedServices['spameriElasticSearch.' . $key] = $service;
}
$aliasedServices = [];
foreach ($services['services'] as $key => $service) {
$aliasedServices['spameriElasticSearch.' . $key] = $service;
}

$this->compiler->loadDefinitionsFromConfig(
$aliasedServices
);
$this->compiler->loadDefinitionsFromConfig(
$aliasedServices
);

} else {
$this->compiler::loadDefinitions(
$this->getContainerBuilder(),
$services['services'],
$this->name
);
}
}


Expand Down Expand Up @@ -104,27 +92,4 @@ public function toggleDebugBar(
return $services;
}


/**
* @param array<mixed> $services
* @return array<mixed>
*/
public function removeCommandDefinitions(
array $services
): array
{
$iterableServices = $services['services'];
foreach ($iterableServices as $serviceKey => $serviceArray) {
if (isset($serviceArray['tags'])) {
foreach ($serviceArray['tags'] as $tag) {
if ($tag === 'kdyby.console.command') {
unset($services[$serviceKey]);
}
}
}
}

return $services;
}

}
1 change: 1 addition & 0 deletions src/Entity/Collection/AbstractElasticEntityCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public function initialize(): void
$entities = $this->service->getAllBy(
new \Spameri\ElasticQuery\ElasticQuery(
new \Spameri\ElasticQuery\Query\QueryCollection(
NULL,
new \Spameri\ElasticQuery\Query\MustCollection(
new \Spameri\ElasticQuery\Query\Terms(
'_id',
Expand Down
1 change: 1 addition & 0 deletions src/Entity/DateTimeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
interface DateTimeInterface extends \DateTimeInterface
{

#[\ReturnTypeWillChange]
public function format($format = NULL);

}
1 change: 1 addition & 0 deletions src/Entity/Property/DateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class DateTime extends \Nette\Utils\DateTime implements \Spameri\Elastic\Entity\
* @param string|null $format
* @return string
*/
#[\ReturnTypeWillChange]
public function format($format = NULL)
{
if (\is_null($format)) {
Expand Down
2 changes: 0 additions & 2 deletions src/Model/Indices/GetFieldMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ class GetFieldMapping

private \Spameri\Elastic\ClientProvider $clientProvider;

private \Spameri\Elastic\Model\VersionProvider $versionProvider;


public function __construct(
\Spameri\Elastic\ClientProvider $clientProvider
Expand Down