From 9e5731f7cad5efea018034fed8e06adab3d2db21 Mon Sep 17 00:00:00 2001 From: tg666 Date: Fri, 24 Mar 2023 01:42:02 +0100 Subject: [PATCH] Nette\DI\Definitions\Statement is now acceptable type for option `base_urls` and `packages[].base_urls` --- src/Bridge/Nette/DI/AssetExtension.php | 4 ++-- tests/Bridge/Nette/DI/fullFeatured.neon | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Bridge/Nette/DI/AssetExtension.php b/src/Bridge/Nette/DI/AssetExtension.php index 76b45d5..8a387c0 100644 --- a/src/Bridge/Nette/DI/AssetExtension.php +++ b/src/Bridge/Nette/DI/AssetExtension.php @@ -39,7 +39,7 @@ public function getConfigSchema(): Schema $packageStructure = Expect::structure([ 'base_path' => Expect::string() ->nullable(), - 'base_urls' => Expect::anyOf(Expect::string(), Expect::listOf('string')) + 'base_urls' => Expect::anyOf(Expect::type(Statement::class), Expect::string(), Expect::listOf('string|' . Statement::class)) ->default([]) ->before(static fn ($val): array => !is_array($val) ? [$val] : $val), 'version' => Expect::anyOf(Expect::string(), Expect::int(), Expect::float()) @@ -61,7 +61,7 @@ public function getConfigSchema(): Schema return Expect::structure([ 'base_path' => Expect::string(''), - 'base_urls' => Expect::anyOf(Expect::string(), Expect::listOf('string')) + 'base_urls' => Expect::anyOf(Expect::type(Statement::class), Expect::string(), Expect::listOf('string|' . Statement::class)) ->default([]) ->before(static fn ($val): array => !is_array($val) ? [$val] : $val), 'version' => Expect::anyOf(Expect::string(), Expect::int(), Expect::float()) diff --git a/tests/Bridge/Nette/DI/fullFeatured.neon b/tests/Bridge/Nette/DI/fullFeatured.neon index 5695a98..4d3f036 100644 --- a/tests/Bridge/Nette/DI/fullFeatured.neon +++ b/tests/Bridge/Nette/DI/fullFeatured.neon @@ -19,7 +19,7 @@ asset: version_format: '%%s-%%s' bar: base_urls: - - https://bar2.example.com + - ::implode('', ['https://', 'bar2.example', '.com']) bar_version_strategy: base_urls: - https://bar_version_strategy.example.com