create-berna-stencil 1.0.21 → 1.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/.eleventy.js +1 -1
  2. package/bin/create.js +1 -1
  3. package/package.json +71 -71
  4. package/src/api/core/vendor/composer/autoload_static.php +10 -10
  5. package/src/api/core/vendor/composer/installed.json +6 -6
  6. package/src/api/core/vendor/composer/installed.php +2 -2
  7. package/src/api/core/vendor/graham-campbell/result-type/LICENSE +21 -21
  8. package/src/api/core/vendor/graham-campbell/result-type/composer.json +33 -33
  9. package/src/api/core/vendor/graham-campbell/result-type/src/Error.php +121 -121
  10. package/src/api/core/vendor/graham-campbell/result-type/src/Result.php +69 -69
  11. package/src/api/core/vendor/graham-campbell/result-type/src/Success.php +120 -120
  12. package/src/api/core/vendor/phpoption/phpoption/LICENSE +200 -200
  13. package/src/api/core/vendor/phpoption/phpoption/composer.json +50 -50
  14. package/src/api/core/vendor/phpoption/phpoption/src/PhpOption/LazyOption.php +175 -175
  15. package/src/api/core/vendor/phpoption/phpoption/src/PhpOption/None.php +136 -136
  16. package/src/api/core/vendor/phpoption/phpoption/src/PhpOption/Option.php +434 -434
  17. package/src/api/core/vendor/phpoption/phpoption/src/PhpOption/Some.php +169 -169
  18. package/src/api/core/vendor/symfony/polyfill-ctype/Ctype.php +232 -232
  19. package/src/api/core/vendor/symfony/polyfill-ctype/LICENSE +19 -19
  20. package/src/api/core/vendor/symfony/polyfill-ctype/README.md +12 -12
  21. package/src/api/core/vendor/symfony/polyfill-ctype/bootstrap.php +50 -50
  22. package/src/api/core/vendor/symfony/polyfill-ctype/bootstrap80.php +46 -46
  23. package/src/api/core/vendor/symfony/polyfill-ctype/composer.json +38 -38
  24. package/src/api/core/vendor/symfony/polyfill-mbstring/LICENSE +19 -19
  25. package/src/api/core/vendor/symfony/polyfill-mbstring/Mbstring.php +1077 -1077
  26. package/src/api/core/vendor/symfony/polyfill-mbstring/README.md +13 -13
  27. package/src/api/core/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php +119 -119
  28. package/src/api/core/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +1397 -1397
  29. package/src/api/core/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php +5 -5
  30. package/src/api/core/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php +1489 -1489
  31. package/src/api/core/vendor/symfony/polyfill-mbstring/bootstrap.php +171 -171
  32. package/src/api/core/vendor/symfony/polyfill-mbstring/bootstrap80.php +167 -167
  33. package/src/api/core/vendor/symfony/polyfill-mbstring/composer.json +39 -39
  34. package/src/api/core/vendor/symfony/polyfill-php80/LICENSE +19 -19
  35. package/src/api/core/vendor/symfony/polyfill-php80/Php80.php +115 -115
  36. package/src/api/core/vendor/symfony/polyfill-php80/PhpToken.php +106 -106
  37. package/src/api/core/vendor/symfony/polyfill-php80/README.md +25 -25
  38. package/src/api/core/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php +31 -31
  39. package/src/api/core/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php +16 -16
  40. package/src/api/core/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php +20 -20
  41. package/src/api/core/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php +16 -16
  42. package/src/api/core/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php +16 -16
  43. package/src/api/core/vendor/symfony/polyfill-php80/bootstrap.php +42 -42
  44. package/src/api/core/vendor/symfony/polyfill-php80/composer.json +37 -37
  45. package/src/api/core/vendor/vlucas/phpdotenv/LICENSE +30 -30
  46. package/src/api/core/vendor/vlucas/phpdotenv/composer.json +60 -60
  47. package/src/api/core/vendor/vlucas/phpdotenv/src/Dotenv.php +267 -267
  48. package/src/api/core/vendor/vlucas/phpdotenv/src/Exception/ExceptionInterface.php +12 -12
  49. package/src/api/core/vendor/vlucas/phpdotenv/src/Exception/InvalidEncodingException.php +12 -12
  50. package/src/api/core/vendor/vlucas/phpdotenv/src/Exception/InvalidFileException.php +12 -12
  51. package/src/api/core/vendor/vlucas/phpdotenv/src/Exception/InvalidPathException.php +12 -12
  52. package/src/api/core/vendor/vlucas/phpdotenv/src/Exception/ValidationException.php +12 -12
  53. package/src/api/core/vendor/vlucas/phpdotenv/src/Loader/Loader.php +48 -48
  54. package/src/api/core/vendor/vlucas/phpdotenv/src/Loader/LoaderInterface.php +20 -20
  55. package/src/api/core/vendor/vlucas/phpdotenv/src/Loader/Resolver.php +65 -65
  56. package/src/api/core/vendor/vlucas/phpdotenv/src/Parser/Entry.php +59 -59
  57. package/src/api/core/vendor/vlucas/phpdotenv/src/Parser/EntryParser.php +299 -299
  58. package/src/api/core/vendor/vlucas/phpdotenv/src/Parser/Lexer.php +58 -58
  59. package/src/api/core/vendor/vlucas/phpdotenv/src/Parser/Lines.php +127 -127
  60. package/src/api/core/vendor/vlucas/phpdotenv/src/Parser/Parser.php +53 -53
  61. package/src/api/core/vendor/vlucas/phpdotenv/src/Parser/ParserInterface.php +19 -19
  62. package/src/api/core/vendor/vlucas/phpdotenv/src/Parser/Value.php +88 -88
  63. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/AdapterInterface.php +15 -15
  64. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ApacheAdapter.php +89 -89
  65. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ArrayAdapter.php +80 -80
  66. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/EnvConstAdapter.php +88 -88
  67. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/GuardedWriter.php +85 -85
  68. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ImmutableWriter.php +110 -110
  69. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiReader.php +48 -48
  70. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiWriter.php +64 -64
  71. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/PutenvAdapter.php +91 -91
  72. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ReaderInterface.php +17 -17
  73. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ReplacingWriter.php +104 -104
  74. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ServerConstAdapter.php +88 -88
  75. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/WriterInterface.php +27 -27
  76. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/AdapterRepository.php +107 -107
  77. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/RepositoryBuilder.php +272 -272
  78. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/RepositoryInterface.php +51 -51
  79. package/src/api/core/vendor/vlucas/phpdotenv/src/Store/File/Paths.php +44 -44
  80. package/src/api/core/vendor/vlucas/phpdotenv/src/Store/File/Reader.php +81 -81
  81. package/src/api/core/vendor/vlucas/phpdotenv/src/Store/FileStore.php +72 -72
  82. package/src/api/core/vendor/vlucas/phpdotenv/src/Store/StoreBuilder.php +141 -141
  83. package/src/api/core/vendor/vlucas/phpdotenv/src/Store/StoreInterface.php +17 -17
  84. package/src/api/core/vendor/vlucas/phpdotenv/src/Store/StringStore.php +37 -37
  85. package/src/api/core/vendor/vlucas/phpdotenv/src/Util/Regex.php +112 -112
  86. package/src/api/core/vendor/vlucas/phpdotenv/src/Util/Str.php +108 -108
  87. package/src/api/core/vendor/vlucas/phpdotenv/src/Validator.php +207 -207
  88. package/src/api/web.config +41 -0
  89. package/src/web.config +39 -0
  90. package/src/api/core/vendor/graham-campbell/result-type/.gitattributes +0 -9
  91. package/src/api/core/vendor/graham-campbell/result-type/.github/CODE_OF_CONDUCT.md +0 -132
  92. package/src/api/core/vendor/graham-campbell/result-type/.github/CONTRIBUTING.md +0 -31
  93. package/src/api/core/vendor/graham-campbell/result-type/.github/FUNDING.yml +0 -2
  94. package/src/api/core/vendor/graham-campbell/result-type/.github/SECURITY.md +0 -14
  95. package/src/api/core/vendor/graham-campbell/result-type/.github/workflows/stale.yml +0 -11
  96. package/src/api/core/vendor/graham-campbell/result-type/.github/workflows/tests.yml +0 -40
  97. package/src/api/core/vendor/graham-campbell/result-type/CHANGELOG.md +0 -53
  98. package/src/api/core/vendor/graham-campbell/result-type/README.md +0 -42
  99. package/src/api/core/vendor/graham-campbell/result-type/phpunit.xml.dist +0 -13
  100. package/src/api/core/vendor/graham-campbell/result-type/tests/ResultTest.php +0 -95
  101. package/src/api/core/vendor/phpoption/phpoption/.gitattributes +0 -13
  102. package/src/api/core/vendor/phpoption/phpoption/.github/CODE_OF_CONDUCT.md +0 -132
  103. package/src/api/core/vendor/phpoption/phpoption/.github/CONTRIBUTING.md +0 -30
  104. package/src/api/core/vendor/phpoption/phpoption/.github/FUNDING.yml +0 -2
  105. package/src/api/core/vendor/phpoption/phpoption/.github/SECURITY.md +0 -14
  106. package/src/api/core/vendor/phpoption/phpoption/.github/workflows/static.yml +0 -40
  107. package/src/api/core/vendor/phpoption/phpoption/.github/workflows/tests.yml +0 -40
  108. package/src/api/core/vendor/phpoption/phpoption/Makefile +0 -17
  109. package/src/api/core/vendor/phpoption/phpoption/README.md +0 -201
  110. package/src/api/core/vendor/phpoption/phpoption/phpstan-baseline.neon +0 -44
  111. package/src/api/core/vendor/phpoption/phpoption/phpstan.neon.dist +0 -7
  112. package/src/api/core/vendor/phpoption/phpoption/phpunit.xml.dist +0 -13
  113. package/src/api/core/vendor/phpoption/phpoption/tests/PhpOption/Tests/EnsureTest.php +0 -72
  114. package/src/api/core/vendor/phpoption/phpoption/tests/PhpOption/Tests/LazyOptionTest.php +0 -357
  115. package/src/api/core/vendor/phpoption/phpoption/tests/PhpOption/Tests/NoneTest.php +0 -153
  116. package/src/api/core/vendor/phpoption/phpoption/tests/PhpOption/Tests/OptionTest.php +0 -166
  117. package/src/api/core/vendor/phpoption/phpoption/tests/PhpOption/Tests/SomeTest.php +0 -194
  118. package/src/api/core/vendor/phpoption/phpoption/tests/bootstrap.php +0 -8
  119. package/src/api/core/vendor/phpoption/phpoption/vendor-bin/phpstan/composer.json +0 -8
  120. package/src/api/core/vendor/vlucas/phpdotenv/.editorconfig +0 -15
  121. package/src/api/core/vendor/vlucas/phpdotenv/.gitattributes +0 -15
  122. package/src/api/core/vendor/vlucas/phpdotenv/.github/CODE_OF_CONDUCT.md +0 -132
  123. package/src/api/core/vendor/vlucas/phpdotenv/.github/CONTRIBUTING.md +0 -30
  124. package/src/api/core/vendor/vlucas/phpdotenv/.github/FUNDING.yml +0 -2
  125. package/src/api/core/vendor/vlucas/phpdotenv/.github/SECURITY.md +0 -14
  126. package/src/api/core/vendor/vlucas/phpdotenv/.github/workflows/static.yml +0 -40
  127. package/src/api/core/vendor/vlucas/phpdotenv/.github/workflows/tests.yml +0 -70
  128. package/src/api/core/vendor/vlucas/phpdotenv/Makefile +0 -17
  129. package/src/api/core/vendor/vlucas/phpdotenv/README.md +0 -370
  130. package/src/api/core/vendor/vlucas/phpdotenv/UPGRADING.md +0 -196
  131. package/src/api/core/vendor/vlucas/phpdotenv/phpstan-baseline.neon +0 -157
  132. package/src/api/core/vendor/vlucas/phpdotenv/phpstan.neon.dist +0 -7
  133. package/src/api/core/vendor/vlucas/phpdotenv/phpunit.xml.dist +0 -13
  134. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/DotenvTest.php +0 -387
  135. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/Loader/LoaderTest.php +0 -86
  136. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/EntryParserTest.php +0 -234
  137. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/LexerTest.php +0 -40
  138. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/LinesTest.php +0 -53
  139. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/ParserTest.php +0 -98
  140. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/ArrayAdapterTest.php +0 -57
  141. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/EnvConstAdapterTest.php +0 -75
  142. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/PutenvAdapterTest.php +0 -52
  143. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/ServerConstAdapterTest.php +0 -75
  144. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/RepositoryTest.php +0 -305
  145. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/Store/StoreTest.php +0 -141
  146. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/ValidatorTest.php +0 -479
  147. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/.env +0 -5
  148. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/assertions.env +0 -18
  149. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/booleans.env +0 -33
  150. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/commented.env +0 -15
  151. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/empty.env +0 -1
  152. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/example.env +0 -1
  153. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/exported.env +0 -7
  154. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/immutable.env +0 -1
  155. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/integers.env +0 -17
  156. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/large.env +0 -2
  157. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/multibyte.env +0 -3
  158. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/multiline.env +0 -14
  159. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/multiple.env +0 -4
  160. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/mutable.env +0 -1
  161. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/nested.env +0 -15
  162. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/quoted.env +0 -11
  163. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/specialchars.env +0 -8
  164. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/unicodevarnames.env +0 -2
  165. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/utf8-with-bom-encoding.env +0 -3
  166. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/windows.env +0 -1
  167. package/src/api/core/vendor/vlucas/phpdotenv/vendor-bin/phpstan/composer.json +0 -15
@@ -1,196 +0,0 @@
1
- # Upgrading Guide
2
-
3
- ## V5.5 to V5.6
4
-
5
- Bumping the minimum required PHP version is not a breaking change, however it is notable. Since version 5.6.0, we now require PHP 7.2.5 or higher. Installation metrics show that for some time, PHP 7.1 has represented only around 0.1% of installs of V5.
6
-
7
- Release notes for 5.6.0 are available [here](https://github.com/vlucas/phpdotenv/releases/tag/v5.6.0).
8
-
9
- ## V4 to V5
10
-
11
- ### Introduction
12
-
13
- Version 5 bumps to PHP 7.1+, and adds some additional parameter typing. There have been some internal changes and refactorings too, but nothing that changes the overall feel and usage of the package. The Dotenv class itself is largely unchanged from V4.
14
-
15
- Release notes for 5.0.0 are available [here](https://github.com/vlucas/phpdotenv/releases/tag/v5.0.0).
16
-
17
- ### Details
18
-
19
- 1. The `Dotenv\Dotenv::createImmutable` and `Dotenv\Dotenv::createMutable` methods no longer call will result in `getenv` and `putenv` being called. One should instead use `Dotenv\Dotenv::createUnsafeImmutable` and `Dotenv\Dotenv::createUnsafeMutable` methods, if one really needs these functions.
20
- 2. The `Dotenv\Dotenv` constructor has been modified to expect exactly 4 parameters: a store, a parser, a loader, and a repository. This likely won't affect many people, since it is more common to construct this class via the public static create methods. Those methods have not changed.
21
- 3. Scalar typehints have been added to the public interface.
22
- 4. The parser now returns a result type instead of raising an exception. This change is strictly internal, and most users won't notice a difference. The responsibility for raising an exception has simply been shifted up to the caller.
23
- 5. Adapters have been refactored again, with changes to the repositories. In particular, the repository builder has been tweaked. It now expects to be explicitly told if you want to use the default adapters or not, and expects individual readers and writers to be added, one by one. Similar changes have been applied to the store factory. Moreover, the `ApacheAdapter` has been changed so that it behaves much like the other adapters. The old behaviour can be simulated by composing it with the new `ReplacingWriter` (see below). We will no longer include this adapter in our default setup, so that people can enable exactly what they need. Finally, by default, we will no longer be using the `PutenvAdapter`. It can be added, as required.
24
- 6. Variable whitelisting has been replaced with allow listing, and the responsibility has moved from the loader to a new adapter `GuardedWriter`.
25
- 7. The parser has been moved to its own namespace and parses entire files now. This change is expected to have little impact when upgrading. The `Lines` class has also moved to the parser namespace.
26
- 8. The loader now only returns the variables that were actually loaded into the repository, and not all the variables from the file. Moreover, it now expects as input the result of running the new parser (an array of entries), rather than raw file content.
27
-
28
- The changes listed in (4) mean that instead of:
29
-
30
- ```php
31
- $repository = Dotenv\Repository\RepositoryBuilder::create()
32
- ->withReaders([
33
- new Dotenv\Repository\Adapter\EnvConstAdapter(),
34
- ])
35
- ->withWriters([
36
- new Dotenv\Repository\Adapter\EnvConstAdapter(),
37
- new Dotenv\Repository\Adapter\PutenvAdapter(),
38
- ])
39
- ->make();
40
- ```
41
-
42
- one would now write:
43
-
44
- ```php
45
- $repository = Dotenv\Repository\RepositoryBuilder::createWithNoAdapters()
46
- ->addAdapter(Dotenv\Repository\Adapter\EnvConstAdapter::class)
47
- ->addWriter(Dotenv\Repository\Adapter\PutenvAdapter::class)
48
- ->make();
49
- ```
50
-
51
- Instead of passing class names, one can also pass actual adapter instances. Note that it is not possible to directly construct any of the adapters. One has to go via their static `create` method which returns an optional. This is to strictly encapsulate the fact that not all adapters are capable of running on all systems, and so those that cannot be run, cannot be created. For example, the apache adapter can only be run within an apache web server context. Passing the class names as in the above example will handle this for you, by adding the adapter only if it can be created (the optional has a value set).
52
-
53
- To add an apache environment variable writer that only writes to existing apache environment variables, as was the default in v4, one should do the following:
54
-
55
- ```php
56
- $builder = Dotenv\Repository\RepositoryBuilder::createWithDefaultAdapters();
57
-
58
- Dotenv\Repository\Adapter\ApacheAdapter::create()->map(function ($adapter) {
59
- return new Dotenv\Repository\Adapter\ReplacingWriter($adapter, $adapter);
60
- })->map([$builder, 'addWriter'])->getOrElse($builder);
61
-
62
- $repository = $builder->make();
63
- ```
64
-
65
- The use of optionals handles the case where the apache environment functions are not available (such as in a CLI environment).
66
-
67
- ## V4.0 to V4.1
68
-
69
- ### Introduction
70
-
71
- Version 4.1 is a minor release, and as such, there are no breaking changes. There is, however a deprecation to be noted.
72
-
73
- ### Details
74
-
75
- The `Dotenv\Dotenv` constructor now expects either an array of file paths as the third parameter, or an instance of `Dotenv\Store\StoreInterface`. Passing an array is deprecated, and will be removed in V5.
76
-
77
- ## V3 to V4
78
-
79
- ### Introduction
80
-
81
- Version 4 sees some refactoring, and support for escaping dollars in values (https://github.com/vlucas/phpdotenv/pull/380). It is no longer possible to change immutability on the fly, and the `Loader` no longer is responsible for tracking immutability. It is now the responsibility of "repositories" to track this. One must explicitly decide if they want (im)mutability when constructing an instance of `Dotenv\Dotenv`.
82
-
83
- Release notes for 4.0.0 are available [here](https://github.com/vlucas/phpdotenv/releases/tag/v4.0.0).
84
-
85
- ### Details
86
-
87
- V4 has again changed the way you initialize the `Dotenv` class. If you want immutable loading of environment variables, then replace `Dotenv::create` with `Dotenv::createImmutable`, and if you want mutable loading, replace `Dotenv::create` with `Dotenv::createMutable` and `->overload()` with `->load()`. The `overload` method has been removed in favour of specifying mutability at object construction.
88
-
89
- The behaviour when parsing single quoted strings has now changed, to mimic the behaviour of bash. It is no longer possible to escape characters in single quoted strings, and everything is treated literally. As soon as the first single quote character is read, after the initial one, then the variable is treated as ending immediately at that point. When parsing unquoted or double quoted strings, it is now possible to escape dollar signs, to forcefully avoid variable interpolation. Escaping dollars is not mandated, in the sense that if a dollar is present, and not following by variable interpolation syntax, this is allowed, and the dollar will be treated as a literal dollar. Finally, interpolation of variables is now performed right to left, instead of left to right, so it is possible to nest interpolations to allow using the value of a variable as the name of another for further interpolation.
90
-
91
- The `getEnvironmentVariableNames` method is no longer available. This is because calls to `load()` (since v3.0.0) return an associative array of what was loaded, so `$dotenv->getEnvironmentVariableNames()` can be replaced with `array_keys($dotenv->load())`.
92
-
93
- There have been various internal refactorings. Apart from what has already been mentioned, the only other changes likely to affect developers is:
94
-
95
- 1. The `Dotenv\Environment` namespace has been moved to `Dotenv\Repository`, the `Dotenv\Environment\Adapter\AdapterInterface` interface has been replaced by `Dotenv\Repository\Adapter\ReaderInterface` and `Dotenv\Repository\Adapter\WriterInterface`.
96
- 2. The `Dotenv\Environment\DotenvFactory` has been (roughly) replaced by `Dotenv\Repository\RepositoryBuilder`, and `Dotenv\Environment\FactoryInterface` has been deleted.
97
- 3. `Dotenv\Environment\AbstractVariables` has been replaced by `Dotenv\Repository\AbstractRepository`, `Dotenv\Environment\DotenvVariables` has been replaced by `Dotenv\Repository\AdapterRepository`, and `Dotenv\Environment\VariablesInterface` has been replaced by `Dotenv\Repository\RepositoryInterface`.
98
- 4. The `Dotenv\Loader` class has been moved to `Dotenv\Loader\Loader`, and now has a different public interface. It no longer expects any parameters at construction, and implements only the new interface `Dotenv\Loader\LoaderInterface`. Its responsibility has changed to purely taking raw env file content, and handing it off to the parser, dealing with variable interpolation, and sending off instructions to the repository to set variables. No longer can it be used as a way to read the environment by callers, and nor does it track immutability.
99
- 5. The `Dotenv\Parser` and `Dotenv\Lines` classes have moved to `Dotenv\Loader\Parser` and `Dotenv\Loader\Lines`, respectively. `Dotenv\Loader\Parser::parse` now return has either `null` or `Dotenv\Loader\Value` objects as values, instead of `string`s. This is to support the new variable interpolation and dollar escaping features.
100
- 6. The `Dotenv\Validator` constructor has changed from `__construct(array $variables, Loader $loader, $required = true)` to `__construct(RepositoryInterface $repository, array $variables, $required = true)`.
101
-
102
- The example at the bottom of the below upgrading guide, in V4 now looks like:
103
-
104
- ```php
105
- <?php
106
-
107
- use Dotenv\Dotenv;
108
- use Dotenv\Repository\Adapter\EnvConstAdapter;
109
- use Dotenv\Repository\Adapter\ServerConstAdapter;
110
- use Dotenv\Repository\RepositoryBuilder;
111
-
112
- $adapters = [
113
- new EnvConstAdapter(),
114
- new ServerConstAdapter(),
115
- ];
116
-
117
- $repository = RepositoryBuilder::create()
118
- ->withReaders($adapters)
119
- ->withWriters($adapters)
120
- ->immutable()
121
- ->make();
122
-
123
- Dotenv::create($repository, $path, null)->load();
124
- ```
125
-
126
- Since v3.2.0, it was easily possible to read a file and process variable interpolations, without actually "loading" the variables. This is still possible in v4.0.0. Example code that does this is as follows:
127
-
128
- ```php
129
- <?php
130
-
131
- use Dotenv\Repository\Adapter\ArrayAdapter;
132
- use Dotenv\Repository\RepositoryBuilder;
133
- use Dotenv\Loader\Loader;
134
-
135
- $adapters = [new ArrayAdapter()];
136
-
137
- $repository = RepositoryBuilder::create()
138
- ->withReaders($adapters)
139
- ->withWriters($adapters)
140
- ->make();
141
-
142
- $variables = (new Loader())->load($repository, $content);
143
- ```
144
-
145
- Notice, that compared to v3, the loader no longer expects file paths in the constructor. Reading of the files is now managed by the `Dotenv\Dotenv` class. The loader is genuinely just loading the content into the repository.
146
-
147
- Finally, we note that the minimum supported version of PHP has increased to 5.5.9, up from 5.4.0 in V3 and 5.3.9 in V2.
148
-
149
- ## V2 to V3
150
-
151
- ### Introduction
152
-
153
- New in Version 3 is first-class support for multiline variables ([#301](https://github.com/vlucas/phpdotenv/pull/301)) and much more flexibility in terms of which parts of the environment we try to read and modify ([#300](https://github.com/vlucas/phpdotenv/pull/300)). Consequently, you will need to replace any occurrences of `new Dotenv(...)` with `Dotenv::create(...)`, since our new native constructor takes a `Loader` instance now, so that it can be truly customized if required. Finally, one should note that the loader will no longer be trimming values ([#302](https://github.com/vlucas/phpdotenv/pull/302)), moreover `Loader::load()` and its callers now return an associative array of the variables loaded with their values, rather than an array of raw lines from the environment file ([#306](https://github.com/vlucas/phpdotenv/pull/306)).
154
-
155
- Release notes for 3.0.0 are available [here](https://github.com/vlucas/phpdotenv/releases/tag/v3.0.0).
156
-
157
- ### Details
158
-
159
- V3 has changed the way you initialize the `Dotenv` class. Consequently, you will need to replace any occurrences of new Dotenv(...) with Dotenv::create(...), since our new native constructor takes a `Loader` instance now.
160
-
161
- `Loader::load()` and its callers now return an associative array of the variables loaded with their values.
162
-
163
- Value parsing has been modified in the following ways:
164
-
165
- 1. For unquoted strings, as soon as there's a hash, it's treated as a comment start.
166
- 2. We're being stricter about invalid escape sequences within quoted strings.
167
- 3. We're no longer trimming the parsed values of quoted strings.
168
- 4. Multiline quoted values are now permitted, and will be parsed by V3.
169
-
170
- | input value | V2.5.2 | V2.6.1 | V3.3.1 |
171
- |-|-|-|-|
172
- | `foo#bar` | `foo#bar` | `foo#bar` | `foo` |
173
- | `foo # bar` | `foo` | `foo` | `foo` |
174
- | `"iiiiviiiixiiiiviiii\n"` | silent failure | `iiiviiiixiiiiviiii\n` | fails with invalid escape sequence exception |
175
- | `"iiiiviiiixiiiiviiii\\n"` | `iiiiviiiixiiiiviiii\n` | `iiiiviiiixiiiiviiii\n` | `iiiiviiiixiiiiviiii\n` |
176
- | `"foo\"bar"` | `foo"bar` | `foo"bar` | `foo"bar` |
177
- | `" foo "` | `foo` with whitespace trimmed | `foo` with whitespace trimmed | `foo` with 2 spaces in front and one after |
178
-
179
- In double quoted strings, double quotes and backslashes need escaping with a backslash, and in single quoted strings, single quote and backslashes need escaping with a backslash. In v2.5.2, forgetting an escape can lead to odd results due to the regex running out of stack, but this was fixed in 2.6 and 3.3, with 2.6 allowing you to continue after an unescaped backslash, but 3.3 not.
180
-
181
- It's possible to use phpdotenv V3 in a threaded environment, instructing it to not call any functions that are not tread-safe:
182
-
183
- ```php
184
- <?php
185
-
186
- use Dotenv\Dotenv;
187
- use Dotenv\Environment\Adapter\EnvConstAdapter;
188
- use Dotenv\Environment\Adapter\ServerConstAdapter;
189
- use Dotenv\Environment\DotenvFactory;
190
-
191
- $factory = new DotenvFactory([new EnvConstAdapter(), new ServerConstAdapter()]);
192
-
193
- Dotenv::create($path, null, $factory)->load();
194
- ```
195
-
196
- Finally, we note that the minimum supported version of PHP has increased from 5.3.9 to 5.4.0.
@@ -1,157 +0,0 @@
1
- parameters:
2
- ignoreErrors:
3
- -
4
- message: '#^PHPDoc tag @var with type PhpOption\\Option\<Dotenv\\Parser\\Value\> is not subtype of type PhpOption\\Option\<Dotenv\\Parser\\Value\|null\>\.$#'
5
- identifier: varTag.type
6
- count: 1
7
- path: src/Parser/Entry.php
8
-
9
- -
10
- message: '#^Anonymous function should return GrahamCampbell\\ResultType\\Result\<mixed, string\> but returns GrahamCampbell\\ResultType\\Result\<Dotenv\\Parser\\Entry, string\>\.$#'
11
- identifier: return.type
12
- count: 1
13
- path: src/Parser/EntryParser.php
14
-
15
- -
16
- message: '#^Method Dotenv\\Parser\\EntryParser\:\:parse\(\) should return GrahamCampbell\\ResultType\\Result\<Dotenv\\Parser\\Entry, string\> but returns GrahamCampbell\\ResultType\\Result\<mixed, string\>\.$#'
17
- identifier: return.type
18
- count: 1
19
- path: src/Parser/EntryParser.php
20
-
21
- -
22
- message: '#^PHPDoc tag @var with type GrahamCampbell\\ResultType\\Result\<Dotenv\\Parser\\Value\|null, string\> is not subtype of type GrahamCampbell\\ResultType\\Result\<Dotenv\\Parser\\Value, string\>\|GrahamCampbell\\ResultType\\Result\<null, mixed\>\.$#'
23
- identifier: varTag.type
24
- count: 1
25
- path: src/Parser/EntryParser.php
26
-
27
- -
28
- message: '#^Parameter \#2 \$callback of function array_reduce expects callable\(GrahamCampbell\\ResultType\\Result\<array\{Dotenv\\Parser\\Value, int\}, mixed\>\|GrahamCampbell\\ResultType\\Result\<array\{mixed, int\}, string\>, string\)\: \(GrahamCampbell\\ResultType\\Result\<array\{Dotenv\\Parser\\Value, int\}, mixed\>\|GrahamCampbell\\ResultType\\Result\<array\{mixed, int\}, string\>\), Closure\(GrahamCampbell\\ResultType\\Result, string\)\: GrahamCampbell\\ResultType\\Result\<array\{Dotenv\\Parser\\Value, int\}, string\> given\.$#'
29
- identifier: argument.type
30
- count: 1
31
- path: src/Parser/EntryParser.php
32
-
33
- -
34
- message: '#^Only booleans are allowed in a negated boolean, int\|false given\.$#'
35
- identifier: booleanNot.exprNotBoolean
36
- count: 1
37
- path: src/Parser/Lexer.php
38
-
39
- -
40
- message: '#^Parameter \#1 \$pattern of function preg_match expects string, mixed given\.$#'
41
- identifier: argument.type
42
- count: 1
43
- path: src/Parser/Lexer.php
44
-
45
- -
46
- message: '#^PHPDoc tag @var with type PhpOption\\Option\<Dotenv\\Repository\\Adapter\\AdapterInterface\> is not subtype of type PhpOption\\Some\<Dotenv\\Repository\\Adapter\\ApacheAdapter\>\.$#'
47
- identifier: varTag.type
48
- count: 1
49
- path: src/Repository/Adapter/ApacheAdapter.php
50
-
51
- -
52
- message: '#^PHPDoc tag @var with type PhpOption\\Option\<string\> is not subtype of type PhpOption\\Option\<string\|false\|null\>\.$#'
53
- identifier: varTag.type
54
- count: 1
55
- path: src/Repository/Adapter/ApacheAdapter.php
56
-
57
- -
58
- message: '#^PHPDoc tag @var with type PhpOption\\Option\<Dotenv\\Repository\\Adapter\\AdapterInterface\> is not subtype of type PhpOption\\Some\<Dotenv\\Repository\\Adapter\\ArrayAdapter\>\.$#'
59
- identifier: varTag.type
60
- count: 1
61
- path: src/Repository/Adapter/ArrayAdapter.php
62
-
63
- -
64
- message: '#^Cannot cast mixed to string\.$#'
65
- identifier: cast.string
66
- count: 1
67
- path: src/Repository/Adapter/EnvConstAdapter.php
68
-
69
- -
70
- message: '#^PHPDoc tag @var with type PhpOption\\Option\<Dotenv\\Repository\\Adapter\\AdapterInterface\> is not subtype of type PhpOption\\Some\<Dotenv\\Repository\\Adapter\\EnvConstAdapter\>\.$#'
71
- identifier: varTag.type
72
- count: 1
73
- path: src/Repository/Adapter/EnvConstAdapter.php
74
-
75
- -
76
- message: '#^PHPDoc tag @var with type PhpOption\\Option\<Dotenv\\Repository\\Adapter\\AdapterInterface\> is not subtype of type PhpOption\\Some\<Dotenv\\Repository\\Adapter\\PutenvAdapter\>\.$#'
77
- identifier: varTag.type
78
- count: 1
79
- path: src/Repository/Adapter/PutenvAdapter.php
80
-
81
- -
82
- message: '#^PHPDoc tag @var with type PhpOption\\Option\<string\> is not subtype of type PhpOption\\Option\<string\|false\>\.$#'
83
- identifier: varTag.type
84
- count: 1
85
- path: src/Repository/Adapter/PutenvAdapter.php
86
-
87
- -
88
- message: '#^Cannot cast mixed to string\.$#'
89
- identifier: cast.string
90
- count: 1
91
- path: src/Repository/Adapter/ServerConstAdapter.php
92
-
93
- -
94
- message: '#^PHPDoc tag @var with type PhpOption\\Option\<Dotenv\\Repository\\Adapter\\AdapterInterface\> is not subtype of type PhpOption\\Some\<Dotenv\\Repository\\Adapter\\ServerConstAdapter\>\.$#'
95
- identifier: varTag.type
96
- count: 1
97
- path: src/Repository/Adapter/ServerConstAdapter.php
98
-
99
- -
100
- message: '#^Parameter \#1 \$callable of method PhpOption\\Some\<Dotenv\\Repository\\Adapter\\AdapterInterface\|string\>\:\:flatMap\(\) expects callable\(Dotenv\\Repository\\Adapter\\AdapterInterface\|string\)\: PhpOption\\Option\<S\>, Closure\(mixed\)\: mixed given\.$#'
101
- identifier: argument.type
102
- count: 1
103
- path: src/Repository/RepositoryBuilder.php
104
-
105
- -
106
- message: '#^Parameter \#1 \$callable of method PhpOption\\Some\<Dotenv\\Repository\\Adapter\\ReaderInterface\|string\>\:\:flatMap\(\) expects callable\(Dotenv\\Repository\\Adapter\\ReaderInterface\|string\)\: PhpOption\\Option\<S\>, Closure\(mixed\)\: mixed given\.$#'
107
- identifier: argument.type
108
- count: 1
109
- path: src/Repository/RepositoryBuilder.php
110
-
111
- -
112
- message: '#^Parameter \#1 \$callable of method PhpOption\\Some\<Dotenv\\Repository\\Adapter\\WriterInterface\|string\>\:\:flatMap\(\) expects callable\(Dotenv\\Repository\\Adapter\\WriterInterface\|string\)\: PhpOption\\Option\<S\>, Closure\(mixed\)\: mixed given\.$#'
113
- identifier: argument.type
114
- count: 1
115
- path: src/Repository/RepositoryBuilder.php
116
-
117
- -
118
- message: '#^Parameter \#1 \$readers of class Dotenv\\Repository\\RepositoryBuilder constructor expects array\<Dotenv\\Repository\\Adapter\\ReaderInterface\>, array\<Dotenv\\Repository\\Adapter\\ReaderInterface\|S\> given\.$#'
119
- identifier: argument.type
120
- count: 2
121
- path: src/Repository/RepositoryBuilder.php
122
-
123
- -
124
- message: '#^Parameter \#2 \$writers of class Dotenv\\Repository\\RepositoryBuilder constructor expects array\<Dotenv\\Repository\\Adapter\\WriterInterface\>, array\<Dotenv\\Repository\\Adapter\\WriterInterface\|S\> given\.$#'
125
- identifier: argument.type
126
- count: 2
127
- path: src/Repository/RepositoryBuilder.php
128
-
129
- -
130
- message: '#^PHPDoc tag @var with type PhpOption\\Option\<string\> is not subtype of type PhpOption\\Option\<string\|false\>\.$#'
131
- identifier: varTag.type
132
- count: 1
133
- path: src/Store/File/Reader.php
134
-
135
- -
136
- message: '#^Method Dotenv\\Util\\Regex\:\:occurrences\(\) should return GrahamCampbell\\ResultType\\Result\<int, string\> but returns GrahamCampbell\\ResultType\\Result\<int\<0, max\>, string\>\.$#'
137
- identifier: return.type
138
- count: 1
139
- path: src/Util/Regex.php
140
-
141
- -
142
- message: '#^Loose comparison via "\=\=" is not allowed\.$#'
143
- identifier: equal.notAllowed
144
- count: 1
145
- path: src/Util/Str.php
146
-
147
- -
148
- message: '#^PHPDoc tag @var with type GrahamCampbell\\ResultType\\Result\<string, string\> is not subtype of type GrahamCampbell\\ResultType\\Result\<mixed, non\-falsy\-string\>\.$#'
149
- identifier: varTag.type
150
- count: 2
151
- path: src/Util/Str.php
152
-
153
- -
154
- message: '#^PHPDoc tag @var with type PhpOption\\Option\<int\> is not subtype of type PhpOption\\Option\<int\<0, max\>\|false\>\.$#'
155
- identifier: varTag.type
156
- count: 1
157
- path: src/Util/Str.php
@@ -1,7 +0,0 @@
1
- includes:
2
- - phpstan-baseline.neon
3
-
4
- parameters:
5
- level: max
6
- paths:
7
- - src
@@ -1,13 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" beStrictAboutTestsThatDoNotTestAnything="true" beStrictAboutOutputDuringTests="true" bootstrap="vendor/autoload.php" colors="true" failOnRisky="true" failOnWarning="true" processIsolation="false" stopOnError="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd">
3
- <testsuites>
4
- <testsuite name="PHP Dotenv Test Suite">
5
- <directory suffix="Test.php">./tests</directory>
6
- </testsuite>
7
- </testsuites>
8
- <source>
9
- <include>
10
- <directory suffix=".php">./src</directory>
11
- </include>
12
- </source>
13
- </phpunit>