diff --git a/composer.json b/composer.json index 9d085cd1..749932a1 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "require": { "php": "8.3.*", "aws/aws-sdk-php": "3.288.1", - "clue/block-react": "^1.1", + "beberlei/assert": "^3.3", "doctrine/annotations": "^1.4", "doctrine/cache": "^1.6", "elasticsearch/elasticsearch": "^7.11", @@ -32,21 +32,26 @@ "jms/serializer": "^3.0", "justinrainbow/json-schema": "^5.1", "mindplay/composer-locator": "^2.1", - "monolog/monolog": "^1.22", "nyholm/psr7": "^1.1", + "psr/log": "^1.1", "silexandfriends/silex": "^2.4", "symfony/console": "4.4.49", - "symfony/finder": "5.4.43", - "symfony/monolog-bridge": "^4.4", + "symfony/http-foundation": "^4.4", + "symfony/http-kernel": "^4.4", + "symfony/monolog-bridge": "^5.1", "symfony/psr-http-message-bridge": "^2.0", + "symfony/serializer": "^3.4", "symfony/yaml": "^4.4", "willdurand/negotiation": "^3.1" }, "require-dev": { + "guzzlehttp/promises": "^1.5", "mockery/mockery": "^1.0", "phpunit/phpunit": "^9.6", + "shipmonk/composer-dependency-analyser": "^1.8", "squizlabs/php_codesniffer": "^3.5", "symfony/browser-kit": "^4.4", + "symfony/finder": "5.4.43", "symfony/var-dumper": "^4.4" }, "config": { diff --git a/composer.lock b/composer.lock index 68d3a445..44773881 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4fdb4d8e99284c0fae2452e12da5c63e", + "content-hash": "40ce0e29074b2949de10cb4952f34405", "packages": [ { "name": "aws/aws-crt-php", @@ -222,75 +222,6 @@ }, "time": "2024-07-15T13:18:35+00:00" }, - { - "name": "clue/block-react", - "version": "v1.5.0", - "source": { - "type": "git", - "url": "https://github.com/clue/reactphp-block.git", - "reference": "718b0571a94aa693c6fffc72182e87257ac900f3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/clue/reactphp-block/zipball/718b0571a94aa693c6fffc72182e87257ac900f3", - "reference": "718b0571a94aa693c6fffc72182e87257ac900f3", - "shasum": "" - }, - "require": { - "php": ">=5.3", - "react/event-loop": "^1.2", - "react/promise": "^3.0 || ^2.7 || ^1.2.1", - "react/promise-timer": "^1.5" - }, - "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", - "react/http": "^1.4" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering" - } - ], - "description": "Lightweight library that eases integrating async components built for ReactPHP in a traditional, blocking environment.", - "homepage": "https://github.com/clue/reactphp-block", - "keywords": [ - "async", - "await", - "blocking", - "event loop", - "promise", - "reactphp", - "sleep", - "synchronous" - ], - "support": { - "issues": "https://github.com/clue/reactphp-block/issues", - "source": "https://github.com/clue/reactphp-block/tree/v1.5.0" - }, - "funding": [ - { - "url": "https://clue.engineering/support", - "type": "custom" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "abandoned": "react/async", - "time": "2021-10-20T14:07:33+00:00" - }, { "name": "composer/package-versions-deprecated", "version": "1.11.99.2", @@ -2723,78 +2654,6 @@ }, "time": "2019-03-08T08:55:37+00:00" }, - { - "name": "react/event-loop", - "version": "v1.5.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/event-loop.git", - "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", - "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" - }, - "suggest": { - "ext-pcntl": "For signal handling support when using the StreamSelectLoop" - }, - "type": "library", - "autoload": { - "psr-4": { - "React\\EventLoop\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", - "keywords": [ - "asynchronous", - "event-loop" - ], - "support": { - "issues": "https://github.com/reactphp/event-loop/issues", - "source": "https://github.com/reactphp/event-loop/tree/v1.5.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2023-11-13T13:48:05+00:00" - }, { "name": "react/promise", "version": "v2.11.0", @@ -2867,85 +2726,6 @@ ], "time": "2023-11-16T16:16:50+00:00" }, - { - "name": "react/promise-timer", - "version": "v1.11.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise-timer.git", - "reference": "4f70306ed66b8b44768941ca7f142092600fafc1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise-timer/zipball/4f70306ed66b8b44768941ca7f142092600fafc1", - "reference": "4f70306ed66b8b44768941ca7f142092600fafc1", - "shasum": "" - }, - "require": { - "php": ">=5.3", - "react/event-loop": "^1.2", - "react/promise": "^3.2 || ^2.7.0 || ^1.2.1" - }, - "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "React\\Promise\\Timer\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "A trivial implementation of timeouts for Promises, built on top of ReactPHP.", - "homepage": "https://github.com/reactphp/promise-timer", - "keywords": [ - "async", - "event-loop", - "promise", - "reactphp", - "timeout", - "timer" - ], - "support": { - "issues": "https://github.com/reactphp/promise-timer/issues", - "source": "https://github.com/reactphp/promise-timer/tree/v1.11.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2024-06-04T14:27:45+00:00" - }, { "name": "silexandfriends/silex", "version": "v2.4.5", @@ -3499,69 +3279,6 @@ ], "time": "2022-07-20T09:59:04+00:00" }, - { - "name": "symfony/finder", - "version": "v5.4.43", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "ae25a9145a900764158d439653d5630191155ca0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/ae25a9145a900764158d439653d5630191155ca0", - "reference": "ae25a9145a900764158d439653d5630191155ca0", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.43" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-08-13T14:03:51+00:00" - }, { "name": "symfony/http-client-contracts", "version": "v2.5.3", @@ -3897,34 +3614,35 @@ }, { "name": "symfony/monolog-bridge", - "version": "v4.4.43", + "version": "v5.1.11", "source": { "type": "git", "url": "https://github.com/symfony/monolog-bridge.git", - "reference": "ad09c9980b912e757c4ecd8363cebf3039d1d471" + "reference": "ce37f72dd09e38d65dd6d57a0c17e874c4c689a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/ad09c9980b912e757c4ecd8363cebf3039d1d471", - "reference": "ad09c9980b912e757c4ecd8363cebf3039d1d471", + "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/ce37f72dd09e38d65dd6d57a0c17e874c4c689a5", + "reference": "ce37f72dd09e38d65dd6d57a0c17e874c4c689a5", "shasum": "" }, "require": { - "monolog/monolog": "^1.25.1", - "php": ">=7.1.3", - "symfony/http-kernel": "^4.3", - "symfony/polyfill-php80": "^1.16", + "monolog/monolog": "^1.25.1|^2", + "php": ">=7.2.5", + "symfony/http-kernel": "^4.4|^5.0", "symfony/service-contracts": "^1.1|^2" }, "conflict": { - "symfony/console": "<3.4", - "symfony/http-foundation": "<3.4" + "symfony/console": "<4.4", + "symfony/http-foundation": "<4.4" }, "require-dev": { - "symfony/console": "^3.4|^4.0|^5.0", + "symfony/console": "^4.4|^5.0", "symfony/http-client": "^4.4|^5.0", - "symfony/security-core": "^3.4|^4.0|^5.0", - "symfony/var-dumper": "^3.4|^4.0|^5.0" + "symfony/mailer": "^4.4|^5.0", + "symfony/mime": "^4.4|^5.0", + "symfony/security-core": "^4.4|^5.0", + "symfony/var-dumper": "^4.4|^5.0" }, "suggest": { "symfony/console": "For the possibility to show log messages in console commands depending on verbosity settings.", @@ -3957,7 +3675,7 @@ "description": "Provides integration for Monolog with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/monolog-bridge/tree/v4.4.43" + "source": "https://github.com/symfony/monolog-bridge/tree/v5.1.11" }, "funding": [ { @@ -3973,7 +3691,7 @@ "type": "tidelift" } ], - "time": "2022-06-16T12:12:11+00:00" + "time": "2021-01-27T10:01:46+00:00" }, { "name": "symfony/polyfill-ctype", @@ -6843,6 +6561,72 @@ ], "time": "2020-09-28T06:39:44+00:00" }, + { + "name": "shipmonk/composer-dependency-analyser", + "version": "1.8.1", + "source": { + "type": "git", + "url": "https://github.com/shipmonk-rnd/composer-dependency-analyser.git", + "reference": "0acd9d94be4d9397055ff012d0abf2ae88072e99" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/shipmonk-rnd/composer-dependency-analyser/zipball/0acd9d94be4d9397055ff012d0abf2ae88072e99", + "reference": "0acd9d94be4d9397055ff012d0abf2ae88072e99", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "editorconfig-checker/editorconfig-checker": "^10.6.0", + "ergebnis/composer-normalize": "^2.19.0", + "ext-dom": "*", + "ext-libxml": "*", + "phpcompatibility/php-compatibility": "^9.3.5", + "phpstan/phpstan": "^1.12.3", + "phpstan/phpstan-phpunit": "^1.4.0", + "phpstan/phpstan-strict-rules": "^1.6.0", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", + "shipmonk/name-collision-detector": "^2.1.1", + "slevomat/coding-standard": "^8.15.0" + }, + "bin": [ + "bin/composer-dependency-analyser" + ], + "type": "library", + "autoload": { + "psr-4": { + "ShipMonk\\ComposerDependencyAnalyser\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Fast detection of composer dependency issues (dead dependencies, shadow dependencies, misplaced dependencies)", + "keywords": [ + "analyser", + "composer", + "composer dependency", + "dead code", + "dead dependency", + "detector", + "dev", + "misplaced dependency", + "shadow dependency", + "static analysis", + "unused code", + "unused dependency" + ], + "support": { + "issues": "https://github.com/shipmonk-rnd/composer-dependency-analyser/issues", + "source": "https://github.com/shipmonk-rnd/composer-dependency-analyser/tree/1.8.1" + }, + "time": "2024-11-18T12:58:21+00:00" + }, { "name": "squizlabs/php_codesniffer", "version": "3.10.3", @@ -7070,6 +6854,69 @@ ], "time": "2024-10-22T13:05:35+00:00" }, + { + "name": "symfony/finder", + "version": "v5.4.43", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "ae25a9145a900764158d439653d5630191155ca0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/ae25a9145a900764158d439653d5630191155ca0", + "reference": "ae25a9145a900764158d439653d5630191155ca0", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v5.4.43" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-08-13T14:03:51+00:00" + }, { "name": "theseer/tokenizer", "version": "1.2.3", diff --git a/tests/src/Search/InMemoryStorageAdapter.php b/tests/src/Search/InMemoryStorageAdapter.php deleted file mode 100644 index 4808d008..00000000 --- a/tests/src/Search/InMemoryStorageAdapter.php +++ /dev/null @@ -1,66 +0,0 @@ -requestHeadersBlacklist = $requestHeadersBlacklist; - } - if (!empty($responseHeadersBlacklist)) { - $this->responseHeadersBlacklist = $responseHeadersBlacklist; - } - } - - public function fetch(RequestInterface $request) - { - $key = $this->getKey($request); - - if (empty($this->array[$key])) { - return null; - } - - return $this->array[$key]; - } - - public function save(RequestInterface $request, ResponseInterface $response) - { - $key = $this->getKey($request); - - foreach ($this->responseHeadersBlacklist as $header) { - $response = $response->withoutHeader($header); - } - - $this->array[$key] = $response; - } - - private function getKey(RequestInterface $request) - { - return md5(serialize([ - 'method' => $request->getMethod(), - 'path' => $request->getUri()->getPath(), - 'query' => $request->getUri()->getQuery(), - 'user_info' => $request->getUri()->getUserInfo(), - 'port' => $request->getUri()->getPort(), - 'scheme' => $request->getUri()->getScheme(), - 'headers' => array_diff_key($request->getHeaders(), array_flip($this->requestHeadersBlacklist)), - ])); - } -} diff --git a/tests/src/Search/Web/ElasticTestCase.php b/tests/src/Search/Web/ElasticTestCase.php index c4fd8d31..f1934d07 100644 --- a/tests/src/Search/Web/ElasticTestCase.php +++ b/tests/src/Search/Web/ElasticTestCase.php @@ -7,7 +7,7 @@ use eLife\Search\Console; use eLife\Search\IndexMetadata; use eLife\Search\Kernel; -use eLife\Search\KeyValueStore\ElasticSearchKeyValueStore; +use eLife\Search\KeyValueStore\ElasticsearchKeyValueStore; use Psr\Log\NullLogger; use Symfony\Component\Console\Application; use Symfony\Component\Console\Input\StringInput; @@ -363,7 +363,7 @@ public function setUp(): void $this->plainClient = new PlainElasticsearchClient( $this->kernel->get('elastic.elasticsearch.plain'), - $indexName ?? ElasticSearchKeyValueStore::INDEX_NAME + $indexName ?? ElasticsearchKeyValueStore::INDEX_NAME ); $this->mappedClient = $this->kernel->get('elastic.client.read');