Skip to content

Commit

Permalink
Nette\DI\Definitions\Statement is now acceptable type for option `bas…
Browse files Browse the repository at this point in the history
…e_urls` and `packages[].base_urls`
  • Loading branch information
tg666 committed Mar 24, 2023
1 parent a045a32 commit 9e5731f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Bridge/Nette/DI/AssetExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion tests/Bridge/Nette/DI/fullFeatured.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9e5731f

Please sign in to comment.