diff --git a/Makefile b/Makefile index 2f3d354..03460bd 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,10 @@ install: phpcs: ./vendor/bin/phpcs --standard=./vendor/spryker/code-sniffer/Spryker/ruleset.xml ./src/FondOfCodeception/* ./src/Propel/ ./tests/FondOfCodeception/* ./tests/Propel/ +.PHONY: phpcbf +phpcbf: + ./vendor/bin/phpcbf --standard=./vendor/spryker/code-sniffer/Spryker/ruleset.xml ./src/FondOfCodeception/* ./src/Propel/ ./tests/FondOfCodeception/* ./tests/Propel/ + .PHONY: codeception codeception: ./vendor/bin/codecept run --coverage --coverage-xml --coverage-html diff --git a/src/FondOfCodeception/Lib/SearchFacadeFactory.php b/src/FondOfCodeception/Lib/SearchFacadeFactory.php index 5ddcf4b..959e6d2 100644 --- a/src/FondOfCodeception/Lib/SearchFacadeFactory.php +++ b/src/FondOfCodeception/Lib/SearchFacadeFactory.php @@ -225,6 +225,13 @@ protected function createSearchElasticsearchBusinessFactory(): AbstractBusinessF protected function createSearchElasticsearchConfig(): SearchElasticsearchConfig { $searchElasticsearchConfig = new class extends SearchElasticsearchConfig { + /** @var array */ + protected const POSSIBLE_DIRECTORY_PATTERNS = [ + '%s/vendor/*/*/src/*/Shared/*/Schema/', + '%s/*/*/src/*/Shared/*/Schema/', + '%s/src/*/Shared/*/Schema/', + ]; + /** * @return array */ @@ -232,14 +239,11 @@ public function getJsonSchemaDefinitionDirectories(): array { $directories = []; - $directory = sprintf('%s/vendor/*/*/src/*/Shared/*/Schema/', APPLICATION_ROOT_DIR); - if (glob($directory, GLOB_NOSORT | GLOB_ONLYDIR)) { - $directories[] = $directory; - } - - $directory = sprintf('%s/*/*/src/*/Shared/*/Schema/', APPLICATION_ROOT_DIR); - if (glob($directory, GLOB_NOSORT | GLOB_ONLYDIR)) { - $directories[] = $directory; + foreach (static::POSSIBLE_DIRECTORY_PATTERNS as $possibleDirectoryPattern) { + $directory = sprintf($possibleDirectoryPattern, APPLICATION_ROOT_DIR); + if (glob($directory, GLOB_NOSORT | GLOB_ONLYDIR)) { + $directories[] = $directory; + } } return $directories;