Skip to content

Commit

Permalink
chore: remove safe, test against es 8 and os 2.11
Browse files Browse the repository at this point in the history
  • Loading branch information
alekitto committed Oct 19, 2023
1 parent 6846483 commit 732772f
Show file tree
Hide file tree
Showing 35 changed files with 54 additions and 48 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
es_version:
- { image: 'elasticsearch:6.8.13', lib: '^6.0', proto: http, endpoint: 'http://localhost:9200/' }
- { image: 'elasticsearch:7.10.1', lib: '^7.0', proto: http, endpoint: 'http://localhost:9200/' }
- { image: 'opensearchproject/opensearch:1.2.4', lib: '^7.0', proto: https, endpoint: 'https://admin:admin@localhost:9200/' }
- { image: 'docker.elastic.co/elasticsearch/elasticsearch:6.8.13', lib: '^6.0', proto: http, endpoint: 'http://localhost:9200/' }
- { image: 'docker.elastic.co/elasticsearch/elasticsearch:7.10.1', lib: '^7.0', proto: http, endpoint: 'http://localhost:9200/' }
- { image: 'docker.elastic.co/elasticsearch/elasticsearch:8.10.4', lib: '^7.0', proto: https, endpoint: 'https://elastic:admin@localhost:9200/' }
- { image: 'public.ecr.aws/opensearchproject/opensearch:1.2.4', lib: '^7.0', proto: https, endpoint: 'https://admin:admin@localhost:9200/' }
- { image: 'public.ecr.aws/opensearchproject/opensearch:2.11.0', lib: '^7.0', proto: https, endpoint: 'https://admin:admin@localhost:9200/' }

php_version:
- '7.4'
- '8.0'
# Currently disabled as proxy-manager for php8.1 is not released yet.
# - '8.1'
- '8.1'
- '8.2'

name: PHP ${{ matrix.php_version }} against ${{ matrix.es_version.image }}
services:
Expand All @@ -27,9 +30,10 @@ jobs:
- '9200:9200'
options: >-
--env discovery.type=single-node
--env ELASTIC_PASSWORD=admin
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup PHP with pecl extension
uses: shivammathur/setup-php@v2
with:
Expand All @@ -39,7 +43,7 @@ jobs:
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
- name: Cache dependencies installed with composer
uses: actions/cache@v1
Expand All @@ -53,7 +57,10 @@ jobs:
- run: composer install

- name: Waiting for ES server to become available
run: ./wait-for-it.sh -p ${{ matrix.es_version.proto }} localhost:9200
run: ./wait-for-it.sh -p ${{ matrix.es_version.proto }} localhost:9200 && sleep 30

- run: |
curl -X PUT "${{ matrix.es_version.endpoint }}_cluster/settings?pretty" -k -H 'Content-Type: application/json' -d'{"persistent" : {"action.destructive_requires_name" : false}}' || true
- run: vendor/bin/phpunit --coverage-clover coverage.xml
env:
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
"psr/cache-implementation": "^1.0 || ^2.0 || ^3.0",
"psr/log": "^1.0",
"ruflin/elastica": "^5.0 || ^6.0 || ^7.0",
"symfony/polyfill-php80": "^1.0",
"thecodingmachine/safe": "^1.0 || ^2.0"
"symfony/polyfill-php80": "^1.0"
},
"require-dev": {
"aws/aws-sdk-php": "^3.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/Analyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use function get_debug_type;
use function is_array;
use function is_string;
use function Safe\sprintf;
use function sprintf;

/**
* @Annotation
Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/DiscriminatorField.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use function get_debug_type;
use function is_array;
use function is_string;
use function Safe\sprintf;
use function sprintf;

/**
* @Annotation
Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/DiscriminatorMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Doctrine\Common\Annotations\Annotation\Target;
use Kcs\Metadata\Exception\InvalidMetadataException;

use function Safe\sprintf;
use function sprintf;

/**
* @Annotation
Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use function get_debug_type;
use function is_array;
use function is_string;
use function Safe\sprintf;
use function sprintf;
use function trigger_error;

use const E_USER_DEPRECATED;
Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/DocumentId.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use function get_debug_type;
use function is_array;
use function is_string;
use function Safe\sprintf;
use function sprintf;

/**
* @Annotation
Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use function get_debug_type;
use function is_array;
use function is_string;
use function Safe\sprintf;
use function sprintf;

/**
* @Annotation
Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use function get_debug_type;
use function is_array;
use function is_string;
use function Safe\sprintf;
use function sprintf;

/**
* @Annotation
Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/InheritanceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use function get_debug_type;
use function is_array;
use function is_string;
use function Safe\sprintf;
use function sprintf;

/**
* @Annotation
Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/JoinField.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use function get_debug_type;
use function is_array;
use function is_string;
use function Safe\sprintf;
use function sprintf;

/**
* @Annotation
Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use function in_array;
use function is_array;
use function is_string;
use function Safe\sprintf;
use function sprintf;

/**
* @Annotation
Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/Tokenizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use function get_debug_type;
use function is_array;
use function is_string;
use function Safe\sprintf;
use function sprintf;

/**
* @Annotation
Expand Down
2 changes: 1 addition & 1 deletion src/Annotation/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use function get_debug_type;
use function is_array;
use function is_string;
use function Safe\sprintf;
use function sprintf;

/**
* @Annotation
Expand Down
2 changes: 1 addition & 1 deletion src/Collection/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
use function implode;
use function in_array;
use function is_array;
use function Safe\preg_match;
use function preg_match;
use function strlen;

class Collection implements CollectionInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Command/UpdateSchemaCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;

use function Safe\preg_match;
use function preg_match;

class UpdateSchemaCommand extends Command
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/BadResponseException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

use function is_string;
use function json_encode;
use function Safe\sprintf;
use function sprintf;

use const JSON_THROW_ON_ERROR;

Expand Down
2 changes: 1 addition & 1 deletion src/Exception/CannotDropAnAliasException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Elastica\Response;
use Throwable;

use function Safe\sprintf;
use function sprintf;

class CannotDropAnAliasException extends ResponseException
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/DocumentNotManagedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Throwable;

use function Safe\sprintf;
use function sprintf;

class DocumentNotManagedException extends InvalidArgumentException
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/ReadOnlyRequiresManagedDocumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Throwable;

use function Safe\sprintf;
use function sprintf;

class ReadOnlyRequiresManagedDocumentException extends InvalidArgumentException
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/UnexpectedDocumentStateException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Refugis\ODM\Elastica\UnitOfWork;
use Throwable;

use function Safe\sprintf;
use function sprintf;

class UnexpectedDocumentStateException extends InvalidArgumentException
{
Expand Down
2 changes: 1 addition & 1 deletion src/Geotools/Coordinate/Coordinate.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use function is_string;
use function max;
use function min;
use function Safe\preg_match;
use function preg_match;
use function strtoupper;

class Coordinate implements CoordinateInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Hydrator/ObjectHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use function array_keys;
use function array_map;
use function assert;
use function Safe\sort;
use function sort;

class ObjectHydrator implements HydratorInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Internal/DocumentGraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use IteratorAggregate;

use function iterator_to_array;
use function Safe\uasort;
use function uasort;

/**
* Represents a document dependency graph.
Expand Down
4 changes: 2 additions & 2 deletions src/Metadata/DocumentMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
use function array_merge;
use function array_unique;
use function reset;
use function Safe\sort;
use function Safe\sprintf;
use function sort;
use function sprintf;

/**
* @template T of object
Expand Down
2 changes: 1 addition & 1 deletion src/Metadata/Loader/AnnotationLoaderTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use TypeError;

use function get_debug_type;
use function Safe\sprintf;
use function sprintf;

trait AnnotationLoaderTrait
{
Expand Down
4 changes: 2 additions & 2 deletions src/Metadata/MetadataFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
use function get_parent_class;
use function is_array;
use function method_exists;
use function Safe\preg_replace;
use function Safe\sprintf;
use function preg_replace;
use function sprintf;
use function str_replace;

class MetadataFactory extends AbstractMetadataFactory implements ClassMetadataFactory
Expand Down
2 changes: 1 addition & 1 deletion src/Metadata/Processor/DocumentProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

use function class_exists;
use function explode;
use function Safe\sprintf;
use function sprintf;
use function str_contains;
use function strpos;
use function trigger_error;
Expand Down
2 changes: 1 addition & 1 deletion src/Metadata/Processor/InheritanceTypeProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Refugis\ODM\Elastica\Annotation\InheritanceType;
use Refugis\ODM\Elastica\Metadata\DocumentMetadata;

use function Safe\sprintf;
use function sprintf;

/** @Processor(annotation=InheritanceType::class) */
class InheritanceTypeProcessor implements ProcessorInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Persister/DocumentPersister.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
use function count;
use function implode;
use function is_array;
use function Safe\sprintf;
use function sprintf;
use function str_replace;

/** @template T of object */
Expand Down
2 changes: 1 addition & 1 deletion src/Tools/MappingGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use function assert;
use function class_exists;
use function is_array;
use function Safe\sprintf;
use function sprintf;

final class MappingGenerator
{
Expand Down
4 changes: 2 additions & 2 deletions src/Tools/Schema/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

use Refugis\ODM\Elastica\Exception\RuntimeException;

use function Safe\sprintf;
use function sprintf;

/**
* Holds the informations about the schema of collections.
* Holds information about the schema of collections.
*/
class Schema
{
Expand Down
6 changes: 3 additions & 3 deletions src/Type/AbstractDateTimeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
use Refugis\ODM\Elastica\Exception\ConversionFailedException;

use function assert;
use function preg_match;
use function preg_replace_callback;
use function Safe\preg_match;
use function Safe\sprintf;
use function Safe\substr;
use function sprintf;
use function substr;

abstract class AbstractDateTimeType extends AbstractType
{
Expand Down
2 changes: 1 addition & 1 deletion src/Type/AbstractDoctrineType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

use function array_values;
use function count;
use function Safe\sprintf;
use function sprintf;

abstract class AbstractDoctrineType extends AbstractType
{
Expand Down
2 changes: 1 addition & 1 deletion src/Type/BinaryType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace Refugis\ODM\Elastica\Type;

use function base64_decode;
use function base64_encode;
use function Safe\base64_decode;

final class BinaryType extends AbstractType
{
Expand Down

0 comments on commit 732772f

Please sign in to comment.