Skip to content

Commit

Permalink
Merge branch '7.1' into 7.2
Browse files Browse the repository at this point in the history
* 7.1:
  [TwigBridge] Remove `VersionAwareTest` from `AbstractLayoutTestCase`
  [DependencyInjection] Add coverage for error cases of `LazyClosure` and `AutowireLocator`
  [TwigBridge] Fixed a parameterized choice label translation
  Fix extracting of message from ->trans() method with named params
  [TwigBridge] Remove usage of Node() instantiations
  Update security.bg.xlf
  [Dotenv] Default value can be empty
  [Emoji] Update data to support emoji 16
  Add missing Albanian translations for Security and Validator components
  [HttpClient] Add `crypto_method` to scoped client options
  suppress proc_open errors
  [DependencyInjection] Fix `XmlFileLoader` not respecting when env for services
  • Loading branch information
xabbuh committed Sep 28, 2024
2 parents 8474944 + 56a10f3 commit 07b2c58
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dotenv.php
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ private function resolveVariables(string $value, array $loadedVars): string
(?!\() # no opening parenthesis
(?P<opening_brace>\{)? # optional brace
(?P<name>'.self::VARNAME_REGEX.')? # var name
(?P<default_value>:[-=][^\}]++)? # optional default value
(?P<default_value>:[-=][^\}]*+)? # optional default value
(?P<closing_brace>\})? # optional closing brace
/x';

Expand Down
8 changes: 8 additions & 0 deletions Tests/DotenvTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ public static function getEnvData()
["FOO=BAR\nBAR=\${NOTDEFINED:=TEST}", ['FOO' => 'BAR', 'NOTDEFINED' => 'TEST', 'BAR' => 'TEST']],
["FOO=\nBAR=\${FOO:=TEST}", ['FOO' => 'TEST', 'BAR' => 'TEST']],
["FOO=\nBAR=\$FOO:=TEST}", ['FOO' => 'TEST', 'BAR' => 'TEST}']],
["FOO=BAR\nBAR=\${FOO:-}", ['FOO' => 'BAR', 'BAR' => 'BAR']],
["FOO=BAR\nBAR=\${NOTDEFINED:-}", ['FOO' => 'BAR', 'BAR' => '']],
["FOO=\nBAR=\${FOO:-}", ['FOO' => '', 'BAR' => '']],
["FOO=\nBAR=\$FOO:-}", ['FOO' => '', 'BAR' => '}']],
["FOO=BAR\nBAR=\${FOO:=}", ['FOO' => 'BAR', 'BAR' => 'BAR']],
["FOO=BAR\nBAR=\${NOTDEFINED:=}", ['FOO' => 'BAR', 'NOTDEFINED' => '', 'BAR' => '']],
["FOO=\nBAR=\${FOO:=}", ['FOO' => '', 'BAR' => '']],
["FOO=\nBAR=\$FOO:=}", ['FOO' => '', 'BAR' => '}']],
["FOO=foo\nFOOBAR=\${FOO}\${BAR}", ['FOO' => 'foo', 'FOOBAR' => 'foo']],

// underscores
Expand Down

0 comments on commit 07b2c58

Please sign in to comment.