create-berna-stencil 1.0.36 → 1.0.37

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 (177) hide show
  1. package/_tools/res/templates/template.js +18 -22
  2. package/_tools/res/templates/template.njk +8 -8
  3. package/_tools/res/templates/template.scss +16 -16
  4. package/bin/create.js +1 -1
  5. package/package.json +70 -70
  6. package/src/404.njk +2 -2
  7. package/src/api/core/composer.lock +492 -492
  8. package/src/api/core/vendor/composer/autoload_static.php +10 -10
  9. package/src/api/core/vendor/composer/installed.json +6 -6
  10. package/src/api/core/vendor/composer/installed.php +2 -2
  11. package/src/api/core/vendor/graham-campbell/result-type/LICENSE +21 -21
  12. package/src/api/core/vendor/graham-campbell/result-type/composer.json +33 -33
  13. package/src/api/core/vendor/graham-campbell/result-type/src/Error.php +121 -121
  14. package/src/api/core/vendor/graham-campbell/result-type/src/Result.php +69 -69
  15. package/src/api/core/vendor/graham-campbell/result-type/src/Success.php +120 -120
  16. package/src/api/core/vendor/phpoption/phpoption/LICENSE +200 -200
  17. package/src/api/core/vendor/phpoption/phpoption/composer.json +50 -50
  18. package/src/api/core/vendor/phpoption/phpoption/src/PhpOption/LazyOption.php +175 -175
  19. package/src/api/core/vendor/phpoption/phpoption/src/PhpOption/None.php +136 -136
  20. package/src/api/core/vendor/phpoption/phpoption/src/PhpOption/Option.php +434 -434
  21. package/src/api/core/vendor/phpoption/phpoption/src/PhpOption/Some.php +169 -169
  22. package/src/api/core/vendor/symfony/polyfill-ctype/Ctype.php +232 -232
  23. package/src/api/core/vendor/symfony/polyfill-ctype/LICENSE +19 -19
  24. package/src/api/core/vendor/symfony/polyfill-ctype/README.md +12 -12
  25. package/src/api/core/vendor/symfony/polyfill-ctype/bootstrap.php +50 -50
  26. package/src/api/core/vendor/symfony/polyfill-ctype/bootstrap80.php +46 -46
  27. package/src/api/core/vendor/symfony/polyfill-ctype/composer.json +38 -38
  28. package/src/api/core/vendor/symfony/polyfill-mbstring/LICENSE +19 -19
  29. package/src/api/core/vendor/symfony/polyfill-mbstring/Mbstring.php +1077 -1077
  30. package/src/api/core/vendor/symfony/polyfill-mbstring/README.md +13 -13
  31. package/src/api/core/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php +119 -119
  32. package/src/api/core/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +1397 -1397
  33. package/src/api/core/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php +5 -5
  34. package/src/api/core/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php +1489 -1489
  35. package/src/api/core/vendor/symfony/polyfill-mbstring/bootstrap.php +171 -171
  36. package/src/api/core/vendor/symfony/polyfill-mbstring/bootstrap80.php +167 -167
  37. package/src/api/core/vendor/symfony/polyfill-mbstring/composer.json +39 -39
  38. package/src/api/core/vendor/symfony/polyfill-php80/LICENSE +19 -19
  39. package/src/api/core/vendor/symfony/polyfill-php80/Php80.php +115 -115
  40. package/src/api/core/vendor/symfony/polyfill-php80/PhpToken.php +106 -106
  41. package/src/api/core/vendor/symfony/polyfill-php80/README.md +25 -25
  42. package/src/api/core/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php +31 -31
  43. package/src/api/core/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php +16 -16
  44. package/src/api/core/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php +20 -20
  45. package/src/api/core/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php +16 -16
  46. package/src/api/core/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php +16 -16
  47. package/src/api/core/vendor/symfony/polyfill-php80/bootstrap.php +42 -42
  48. package/src/api/core/vendor/symfony/polyfill-php80/composer.json +37 -37
  49. package/src/api/core/vendor/vlucas/phpdotenv/LICENSE +30 -30
  50. package/src/api/core/vendor/vlucas/phpdotenv/composer.json +60 -60
  51. package/src/api/core/vendor/vlucas/phpdotenv/src/Dotenv.php +267 -267
  52. package/src/api/core/vendor/vlucas/phpdotenv/src/Exception/ExceptionInterface.php +12 -12
  53. package/src/api/core/vendor/vlucas/phpdotenv/src/Exception/InvalidEncodingException.php +12 -12
  54. package/src/api/core/vendor/vlucas/phpdotenv/src/Exception/InvalidFileException.php +12 -12
  55. package/src/api/core/vendor/vlucas/phpdotenv/src/Exception/InvalidPathException.php +12 -12
  56. package/src/api/core/vendor/vlucas/phpdotenv/src/Exception/ValidationException.php +12 -12
  57. package/src/api/core/vendor/vlucas/phpdotenv/src/Loader/Loader.php +48 -48
  58. package/src/api/core/vendor/vlucas/phpdotenv/src/Loader/LoaderInterface.php +20 -20
  59. package/src/api/core/vendor/vlucas/phpdotenv/src/Loader/Resolver.php +65 -65
  60. package/src/api/core/vendor/vlucas/phpdotenv/src/Parser/Entry.php +59 -59
  61. package/src/api/core/vendor/vlucas/phpdotenv/src/Parser/EntryParser.php +299 -299
  62. package/src/api/core/vendor/vlucas/phpdotenv/src/Parser/Lexer.php +58 -58
  63. package/src/api/core/vendor/vlucas/phpdotenv/src/Parser/Lines.php +127 -127
  64. package/src/api/core/vendor/vlucas/phpdotenv/src/Parser/Parser.php +53 -53
  65. package/src/api/core/vendor/vlucas/phpdotenv/src/Parser/ParserInterface.php +19 -19
  66. package/src/api/core/vendor/vlucas/phpdotenv/src/Parser/Value.php +88 -88
  67. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/AdapterInterface.php +15 -15
  68. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ApacheAdapter.php +89 -89
  69. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ArrayAdapter.php +80 -80
  70. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/EnvConstAdapter.php +88 -88
  71. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/GuardedWriter.php +85 -85
  72. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ImmutableWriter.php +110 -110
  73. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiReader.php +48 -48
  74. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiWriter.php +64 -64
  75. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/PutenvAdapter.php +91 -91
  76. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ReaderInterface.php +17 -17
  77. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ReplacingWriter.php +104 -104
  78. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ServerConstAdapter.php +88 -88
  79. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/Adapter/WriterInterface.php +27 -27
  80. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/AdapterRepository.php +107 -107
  81. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/RepositoryBuilder.php +272 -272
  82. package/src/api/core/vendor/vlucas/phpdotenv/src/Repository/RepositoryInterface.php +51 -51
  83. package/src/api/core/vendor/vlucas/phpdotenv/src/Store/File/Paths.php +44 -44
  84. package/src/api/core/vendor/vlucas/phpdotenv/src/Store/File/Reader.php +81 -81
  85. package/src/api/core/vendor/vlucas/phpdotenv/src/Store/FileStore.php +72 -72
  86. package/src/api/core/vendor/vlucas/phpdotenv/src/Store/StoreBuilder.php +141 -141
  87. package/src/api/core/vendor/vlucas/phpdotenv/src/Store/StoreInterface.php +17 -17
  88. package/src/api/core/vendor/vlucas/phpdotenv/src/Store/StringStore.php +37 -37
  89. package/src/api/core/vendor/vlucas/phpdotenv/src/Util/Regex.php +112 -112
  90. package/src/api/core/vendor/vlucas/phpdotenv/src/Util/Str.php +108 -108
  91. package/src/api/core/vendor/vlucas/phpdotenv/src/Validator.php +207 -207
  92. package/src/components/global/header.njk +2 -6
  93. package/src/components/welcome.njk +8 -13
  94. package/src/data/site.json +43 -43
  95. package/src/js/pages/404.js +0 -3
  96. package/src/js/pages/homepage.js +0 -6
  97. package/src/api/core/vendor/graham-campbell/result-type/.gitattributes +0 -9
  98. package/src/api/core/vendor/graham-campbell/result-type/.github/CODE_OF_CONDUCT.md +0 -132
  99. package/src/api/core/vendor/graham-campbell/result-type/.github/CONTRIBUTING.md +0 -31
  100. package/src/api/core/vendor/graham-campbell/result-type/.github/FUNDING.yml +0 -2
  101. package/src/api/core/vendor/graham-campbell/result-type/.github/SECURITY.md +0 -14
  102. package/src/api/core/vendor/graham-campbell/result-type/.github/workflows/stale.yml +0 -11
  103. package/src/api/core/vendor/graham-campbell/result-type/.github/workflows/tests.yml +0 -40
  104. package/src/api/core/vendor/graham-campbell/result-type/CHANGELOG.md +0 -53
  105. package/src/api/core/vendor/graham-campbell/result-type/README.md +0 -42
  106. package/src/api/core/vendor/graham-campbell/result-type/phpunit.xml.dist +0 -13
  107. package/src/api/core/vendor/graham-campbell/result-type/tests/ResultTest.php +0 -95
  108. package/src/api/core/vendor/phpoption/phpoption/.gitattributes +0 -13
  109. package/src/api/core/vendor/phpoption/phpoption/.github/CODE_OF_CONDUCT.md +0 -132
  110. package/src/api/core/vendor/phpoption/phpoption/.github/CONTRIBUTING.md +0 -30
  111. package/src/api/core/vendor/phpoption/phpoption/.github/FUNDING.yml +0 -2
  112. package/src/api/core/vendor/phpoption/phpoption/.github/SECURITY.md +0 -14
  113. package/src/api/core/vendor/phpoption/phpoption/.github/workflows/static.yml +0 -40
  114. package/src/api/core/vendor/phpoption/phpoption/.github/workflows/tests.yml +0 -40
  115. package/src/api/core/vendor/phpoption/phpoption/Makefile +0 -17
  116. package/src/api/core/vendor/phpoption/phpoption/README.md +0 -201
  117. package/src/api/core/vendor/phpoption/phpoption/phpstan-baseline.neon +0 -44
  118. package/src/api/core/vendor/phpoption/phpoption/phpstan.neon.dist +0 -7
  119. package/src/api/core/vendor/phpoption/phpoption/phpunit.xml.dist +0 -13
  120. package/src/api/core/vendor/phpoption/phpoption/tests/PhpOption/Tests/EnsureTest.php +0 -72
  121. package/src/api/core/vendor/phpoption/phpoption/tests/PhpOption/Tests/LazyOptionTest.php +0 -357
  122. package/src/api/core/vendor/phpoption/phpoption/tests/PhpOption/Tests/NoneTest.php +0 -153
  123. package/src/api/core/vendor/phpoption/phpoption/tests/PhpOption/Tests/OptionTest.php +0 -166
  124. package/src/api/core/vendor/phpoption/phpoption/tests/PhpOption/Tests/SomeTest.php +0 -194
  125. package/src/api/core/vendor/phpoption/phpoption/tests/bootstrap.php +0 -8
  126. package/src/api/core/vendor/phpoption/phpoption/vendor-bin/phpstan/composer.json +0 -8
  127. package/src/api/core/vendor/vlucas/phpdotenv/.editorconfig +0 -15
  128. package/src/api/core/vendor/vlucas/phpdotenv/.gitattributes +0 -15
  129. package/src/api/core/vendor/vlucas/phpdotenv/.github/CODE_OF_CONDUCT.md +0 -132
  130. package/src/api/core/vendor/vlucas/phpdotenv/.github/CONTRIBUTING.md +0 -30
  131. package/src/api/core/vendor/vlucas/phpdotenv/.github/FUNDING.yml +0 -2
  132. package/src/api/core/vendor/vlucas/phpdotenv/.github/SECURITY.md +0 -14
  133. package/src/api/core/vendor/vlucas/phpdotenv/.github/workflows/static.yml +0 -40
  134. package/src/api/core/vendor/vlucas/phpdotenv/.github/workflows/tests.yml +0 -70
  135. package/src/api/core/vendor/vlucas/phpdotenv/Makefile +0 -17
  136. package/src/api/core/vendor/vlucas/phpdotenv/README.md +0 -370
  137. package/src/api/core/vendor/vlucas/phpdotenv/UPGRADING.md +0 -196
  138. package/src/api/core/vendor/vlucas/phpdotenv/phpstan-baseline.neon +0 -157
  139. package/src/api/core/vendor/vlucas/phpdotenv/phpstan.neon.dist +0 -7
  140. package/src/api/core/vendor/vlucas/phpdotenv/phpunit.xml.dist +0 -13
  141. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/DotenvTest.php +0 -387
  142. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/Loader/LoaderTest.php +0 -86
  143. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/EntryParserTest.php +0 -234
  144. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/LexerTest.php +0 -40
  145. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/LinesTest.php +0 -53
  146. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/ParserTest.php +0 -98
  147. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/ArrayAdapterTest.php +0 -57
  148. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/EnvConstAdapterTest.php +0 -75
  149. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/PutenvAdapterTest.php +0 -52
  150. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/ServerConstAdapterTest.php +0 -75
  151. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/RepositoryTest.php +0 -305
  152. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/Store/StoreTest.php +0 -141
  153. package/src/api/core/vendor/vlucas/phpdotenv/tests/Dotenv/ValidatorTest.php +0 -479
  154. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/.env +0 -5
  155. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/assertions.env +0 -18
  156. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/booleans.env +0 -33
  157. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/commented.env +0 -15
  158. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/empty.env +0 -1
  159. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/example.env +0 -1
  160. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/exported.env +0 -7
  161. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/immutable.env +0 -1
  162. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/integers.env +0 -17
  163. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/large.env +0 -2
  164. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/multibyte.env +0 -3
  165. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/multiline.env +0 -14
  166. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/multiple.env +0 -4
  167. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/mutable.env +0 -1
  168. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/nested.env +0 -15
  169. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/quoted.env +0 -11
  170. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/specialchars.env +0 -8
  171. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/unicodevarnames.env +0 -2
  172. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/utf8-with-bom-encoding.env +0 -3
  173. package/src/api/core/vendor/vlucas/phpdotenv/tests/fixtures/env/windows.env +0 -1
  174. package/src/api/core/vendor/vlucas/phpdotenv/vendor-bin/phpstan/composer.json +0 -15
  175. package/src/data/lang.json +0 -36
  176. package/src/js/modules/forms/form.js +0 -45
  177. package/src/js/modules/langSwitcher.js +0 -69
@@ -1,207 +1,207 @@
1
- <?php
2
-
3
- declare(strict_types=1);
4
-
5
- namespace Dotenv;
6
-
7
- use Dotenv\Exception\ValidationException;
8
- use Dotenv\Repository\RepositoryInterface;
9
- use Dotenv\Util\Regex;
10
- use Dotenv\Util\Str;
11
-
12
- class Validator
13
- {
14
- /**
15
- * The environment repository instance.
16
- *
17
- * @var \Dotenv\Repository\RepositoryInterface
18
- */
19
- private $repository;
20
-
21
- /**
22
- * The variables to validate.
23
- *
24
- * @var string[]
25
- */
26
- private $variables;
27
-
28
- /**
29
- * Create a new validator instance.
30
- *
31
- * @param \Dotenv\Repository\RepositoryInterface $repository
32
- * @param string[] $variables
33
- *
34
- * @return void
35
- */
36
- public function __construct(RepositoryInterface $repository, array $variables)
37
- {
38
- $this->repository = $repository;
39
- $this->variables = $variables;
40
- }
41
-
42
- /**
43
- * Assert that each variable is present.
44
- *
45
- * @throws \Dotenv\Exception\ValidationException
46
- *
47
- * @return \Dotenv\Validator
48
- */
49
- public function required()
50
- {
51
- return $this->assert(
52
- static function (?string $value) {
53
- return $value !== null;
54
- },
55
- 'is missing'
56
- );
57
- }
58
-
59
- /**
60
- * Assert that each variable is not empty.
61
- *
62
- * @throws \Dotenv\Exception\ValidationException
63
- *
64
- * @return \Dotenv\Validator
65
- */
66
- public function notEmpty()
67
- {
68
- return $this->assertNullable(
69
- static function (string $value) {
70
- return Str::len(\trim($value)) > 0;
71
- },
72
- 'is empty'
73
- );
74
- }
75
-
76
- /**
77
- * Assert that each specified variable is an integer.
78
- *
79
- * @throws \Dotenv\Exception\ValidationException
80
- *
81
- * @return \Dotenv\Validator
82
- */
83
- public function isInteger()
84
- {
85
- return $this->assertNullable(
86
- static function (string $value) {
87
- return \ctype_digit($value);
88
- },
89
- 'is not an integer'
90
- );
91
- }
92
-
93
- /**
94
- * Assert that each specified variable is a boolean.
95
- *
96
- * @throws \Dotenv\Exception\ValidationException
97
- *
98
- * @return \Dotenv\Validator
99
- */
100
- public function isBoolean()
101
- {
102
- return $this->assertNullable(
103
- static function (string $value) {
104
- if ($value === '') {
105
- return false;
106
- }
107
-
108
- return \filter_var($value, \FILTER_VALIDATE_BOOLEAN, \FILTER_NULL_ON_FAILURE) !== null;
109
- },
110
- 'is not a boolean'
111
- );
112
- }
113
-
114
- /**
115
- * Assert that each variable is amongst the given choices.
116
- *
117
- * @param string[] $choices
118
- *
119
- * @throws \Dotenv\Exception\ValidationException
120
- *
121
- * @return \Dotenv\Validator
122
- */
123
- public function allowedValues(array $choices)
124
- {
125
- return $this->assertNullable(
126
- static function (string $value) use ($choices) {
127
- return \in_array($value, $choices, true);
128
- },
129
- \sprintf('is not one of [%s]', \implode(', ', $choices))
130
- );
131
- }
132
-
133
- /**
134
- * Assert that each variable matches the given regular expression.
135
- *
136
- * @param string $regex
137
- *
138
- * @throws \Dotenv\Exception\ValidationException
139
- *
140
- * @return \Dotenv\Validator
141
- */
142
- public function allowedRegexValues(string $regex)
143
- {
144
- return $this->assertNullable(
145
- static function (string $value) use ($regex) {
146
- return Regex::matches($regex, $value)->success()->getOrElse(false);
147
- },
148
- \sprintf('does not match "%s"', $regex)
149
- );
150
- }
151
-
152
- /**
153
- * Assert that the callback returns true for each variable.
154
- *
155
- * @param callable(?string):bool $callback
156
- * @param string $message
157
- *
158
- * @throws \Dotenv\Exception\ValidationException
159
- *
160
- * @return \Dotenv\Validator
161
- */
162
- public function assert(callable $callback, string $message)
163
- {
164
- $failing = [];
165
-
166
- foreach ($this->variables as $variable) {
167
- if ($callback($this->repository->get($variable)) === false) {
168
- $failing[] = \sprintf('%s %s', $variable, $message);
169
- }
170
- }
171
-
172
- if (\count($failing) > 0) {
173
- throw new ValidationException(\sprintf(
174
- 'One or more environment variables failed assertions: %s.',
175
- \implode(', ', $failing)
176
- ));
177
- }
178
-
179
- return $this;
180
- }
181
-
182
- /**
183
- * Assert that the callback returns true for each variable.
184
- *
185
- * Skip checking null variable values.
186
- *
187
- * @param callable(string):bool $callback
188
- * @param string $message
189
- *
190
- * @throws \Dotenv\Exception\ValidationException
191
- *
192
- * @return \Dotenv\Validator
193
- */
194
- public function assertNullable(callable $callback, string $message)
195
- {
196
- return $this->assert(
197
- static function (?string $value) use ($callback) {
198
- if ($value === null) {
199
- return true;
200
- }
201
-
202
- return $callback($value);
203
- },
204
- $message
205
- );
206
- }
207
- }
1
+ <?php
2
+
3
+ declare(strict_types=1);
4
+
5
+ namespace Dotenv;
6
+
7
+ use Dotenv\Exception\ValidationException;
8
+ use Dotenv\Repository\RepositoryInterface;
9
+ use Dotenv\Util\Regex;
10
+ use Dotenv\Util\Str;
11
+
12
+ class Validator
13
+ {
14
+ /**
15
+ * The environment repository instance.
16
+ *
17
+ * @var \Dotenv\Repository\RepositoryInterface
18
+ */
19
+ private $repository;
20
+
21
+ /**
22
+ * The variables to validate.
23
+ *
24
+ * @var string[]
25
+ */
26
+ private $variables;
27
+
28
+ /**
29
+ * Create a new validator instance.
30
+ *
31
+ * @param \Dotenv\Repository\RepositoryInterface $repository
32
+ * @param string[] $variables
33
+ *
34
+ * @return void
35
+ */
36
+ public function __construct(RepositoryInterface $repository, array $variables)
37
+ {
38
+ $this->repository = $repository;
39
+ $this->variables = $variables;
40
+ }
41
+
42
+ /**
43
+ * Assert that each variable is present.
44
+ *
45
+ * @throws \Dotenv\Exception\ValidationException
46
+ *
47
+ * @return \Dotenv\Validator
48
+ */
49
+ public function required()
50
+ {
51
+ return $this->assert(
52
+ static function (?string $value) {
53
+ return $value !== null;
54
+ },
55
+ 'is missing'
56
+ );
57
+ }
58
+
59
+ /**
60
+ * Assert that each variable is not empty.
61
+ *
62
+ * @throws \Dotenv\Exception\ValidationException
63
+ *
64
+ * @return \Dotenv\Validator
65
+ */
66
+ public function notEmpty()
67
+ {
68
+ return $this->assertNullable(
69
+ static function (string $value) {
70
+ return Str::len(\trim($value)) > 0;
71
+ },
72
+ 'is empty'
73
+ );
74
+ }
75
+
76
+ /**
77
+ * Assert that each specified variable is an integer.
78
+ *
79
+ * @throws \Dotenv\Exception\ValidationException
80
+ *
81
+ * @return \Dotenv\Validator
82
+ */
83
+ public function isInteger()
84
+ {
85
+ return $this->assertNullable(
86
+ static function (string $value) {
87
+ return \ctype_digit($value);
88
+ },
89
+ 'is not an integer'
90
+ );
91
+ }
92
+
93
+ /**
94
+ * Assert that each specified variable is a boolean.
95
+ *
96
+ * @throws \Dotenv\Exception\ValidationException
97
+ *
98
+ * @return \Dotenv\Validator
99
+ */
100
+ public function isBoolean()
101
+ {
102
+ return $this->assertNullable(
103
+ static function (string $value) {
104
+ if ($value === '') {
105
+ return false;
106
+ }
107
+
108
+ return \filter_var($value, \FILTER_VALIDATE_BOOLEAN, \FILTER_NULL_ON_FAILURE) !== null;
109
+ },
110
+ 'is not a boolean'
111
+ );
112
+ }
113
+
114
+ /**
115
+ * Assert that each variable is amongst the given choices.
116
+ *
117
+ * @param string[] $choices
118
+ *
119
+ * @throws \Dotenv\Exception\ValidationException
120
+ *
121
+ * @return \Dotenv\Validator
122
+ */
123
+ public function allowedValues(array $choices)
124
+ {
125
+ return $this->assertNullable(
126
+ static function (string $value) use ($choices) {
127
+ return \in_array($value, $choices, true);
128
+ },
129
+ \sprintf('is not one of [%s]', \implode(', ', $choices))
130
+ );
131
+ }
132
+
133
+ /**
134
+ * Assert that each variable matches the given regular expression.
135
+ *
136
+ * @param string $regex
137
+ *
138
+ * @throws \Dotenv\Exception\ValidationException
139
+ *
140
+ * @return \Dotenv\Validator
141
+ */
142
+ public function allowedRegexValues(string $regex)
143
+ {
144
+ return $this->assertNullable(
145
+ static function (string $value) use ($regex) {
146
+ return Regex::matches($regex, $value)->success()->getOrElse(false);
147
+ },
148
+ \sprintf('does not match "%s"', $regex)
149
+ );
150
+ }
151
+
152
+ /**
153
+ * Assert that the callback returns true for each variable.
154
+ *
155
+ * @param callable(?string):bool $callback
156
+ * @param string $message
157
+ *
158
+ * @throws \Dotenv\Exception\ValidationException
159
+ *
160
+ * @return \Dotenv\Validator
161
+ */
162
+ public function assert(callable $callback, string $message)
163
+ {
164
+ $failing = [];
165
+
166
+ foreach ($this->variables as $variable) {
167
+ if ($callback($this->repository->get($variable)) === false) {
168
+ $failing[] = \sprintf('%s %s', $variable, $message);
169
+ }
170
+ }
171
+
172
+ if (\count($failing) > 0) {
173
+ throw new ValidationException(\sprintf(
174
+ 'One or more environment variables failed assertions: %s.',
175
+ \implode(', ', $failing)
176
+ ));
177
+ }
178
+
179
+ return $this;
180
+ }
181
+
182
+ /**
183
+ * Assert that the callback returns true for each variable.
184
+ *
185
+ * Skip checking null variable values.
186
+ *
187
+ * @param callable(string):bool $callback
188
+ * @param string $message
189
+ *
190
+ * @throws \Dotenv\Exception\ValidationException
191
+ *
192
+ * @return \Dotenv\Validator
193
+ */
194
+ public function assertNullable(callable $callback, string $message)
195
+ {
196
+ return $this->assert(
197
+ static function (?string $value) use ($callback) {
198
+ if ($value === null) {
199
+ return true;
200
+ }
201
+
202
+ return $callback($value);
203
+ },
204
+ $message
205
+ );
206
+ }
207
+ }
@@ -6,14 +6,10 @@
6
6
  <div class="nav-links">
7
7
  <a class="btn" href="/">Homepage</a>
8
8
  <a class="btn" href="/about-us">About-us</a>
9
- <a class="btn" href="/contact-us">Contact us</a>
9
+ <a class="btn" href="/work-with-us">Work with us</a>
10
10
  </div>
11
11
  <div class="nav-links">
12
- <select id="lang-select" class="form-select">
13
- {# enLangName or itLangName is the key that contains the language name accordint to the current language #}
14
- <option value="en" data-lang-key="enLangName"></option>
15
- <option value="it" data-lang-key="itLangName"></option>
16
- </select>
12
+ <a class="btn" href="/contact-us">Contact us</a>
17
13
  </div>
18
14
  </nav>
19
15
  </header>
@@ -1,6 +1,6 @@
1
1
  <div class="container my-3">
2
2
  <h1>Welcome to <span class="berna-stencil">Berna-Stencil</span></h1>
3
- <div class="slogan" data-lang-key="welcomeSlogan"></div>
3
+ <div class="slogan">The framework you need, simplified</div>
4
4
 
5
5
  <div class="grid">
6
6
  <a
@@ -10,14 +10,11 @@
10
10
  rel="noopener noreferrer"
11
11
  >
12
12
  <i class="bi bi-book card-icon" aria-hidden="true"></i>
13
- <h3 data-lang-key="documentationCardTitle"></h3>
14
- <p data-lang-key="documentatioCardParagraph">
15
- Everything you need to get started, from setup to advanced topics and
16
- customizations.
13
+ <h3>Documentation</h3>
14
+ <p>
15
+ Everything you need to get started, from setup to advanced topics and customizations
17
16
  </p>
18
- <span class="card-link"
19
- data-lang-key="documentationCardLink"></i
20
- ></span>
17
+ <span class="card-link">Go to documentation <span class="bi bi-arrow-right"></span></span>
21
18
  </a>
22
19
 
23
20
  <a
@@ -27,11 +24,9 @@
27
24
  rel="noopener noreferrer"
28
25
  >
29
26
  <i class="bi bi-github card-icon" aria-hidden="true"></i>
30
- <h3 data-lang-key="githubCardTitle">Github repository</h3>
31
- <p data-lang-key="githubCardParagraph">Community-driven. Contributions, issues and PRs are welcome.</p>
32
- <span class="card-link"
33
- data-lang-key="githubCardLink">Open the repository</i
34
- ></span>
27
+ <h3>Github repository</h3>
28
+ <p>Community-driven. Contributions, issues and PRs are welcome.</p>
29
+ <span class="card-link">Open the repository <span class="bi bi-arrow-right"></span></span>
35
30
  </a>
36
31
  </div>
37
32
  </div>
@@ -1,44 +1,44 @@
1
- {
2
- "site_name": "Site name",
3
- "title": "Site title",
4
- "description": "Site description",
5
- "keywords": "keyword1, keyword2, keyword3",
6
- "domain": "yoursite.com",
7
- "url": "https://yoursite.com",
8
- "lang": "en",
9
- "author": "Name and surname",
10
- "data_bs_theme": "dark",
11
- "favicon": "/assets/brand/favicon.svg",
12
- "logo": "/assets/brand/logo.svg",
13
- "copyright": {
14
- "year": "2026",
15
- "text": "Copyright text"
16
- },
17
- "legal": {
18
- "privacy": "",
19
- "cookie": "",
20
- "cookieControls": "",
21
- "terms": ""
22
- },
23
- "pages": {
24
- "404": {
25
- "seo": {
26
- "title": "404 - Not found"
27
- },
28
- "cdn": {
29
- "css": [],
30
- "js": []
31
- }
32
- },
33
- "homepage": {
34
- "seo": {
35
- "title": "Homepage",
36
- "description": "Description"
37
- },
38
- "cdn": {
39
- "css": [],
40
- "js": []
41
- }
42
- }
43
- }
1
+ {
2
+ "site_name": "Site name",
3
+ "title": "Site title",
4
+ "description": "Site description",
5
+ "keywords": "keyword1, keyword2, keyword3",
6
+ "domain": "yoursite.com",
7
+ "url": "https://yoursite.com",
8
+ "lang": "en",
9
+ "author": "Name and surname",
10
+ "data_bs_theme": "dark",
11
+ "favicon": "/assets/brand/favicon.svg",
12
+ "logo": "/assets/brand/logo.svg",
13
+ "copyright": {
14
+ "year": "2026",
15
+ "text": "Copyright text"
16
+ },
17
+ "legal": {
18
+ "privacy": "",
19
+ "cookie": "",
20
+ "cookieControls": "",
21
+ "terms": ""
22
+ },
23
+ "pages": {
24
+ "404": {
25
+ "seo": {
26
+ "title": "404 - Not found"
27
+ },
28
+ "cdn": {
29
+ "css": [],
30
+ "js": []
31
+ }
32
+ },
33
+ "homepage": {
34
+ "seo": {
35
+ "title": "Homepage",
36
+ "description": "Description"
37
+ },
38
+ "cdn": {
39
+ "css": [],
40
+ "js": []
41
+ }
42
+ }
43
+ }
44
44
  }
@@ -2,8 +2,6 @@
2
2
  // JAVASCRIPT MODULES IMPORTS
3
3
  //==========================
4
4
 
5
- // Call inside DOMContentLoaded
6
- import { initLangSwitcher } from '../modules/langSwitcher.js';
7
5
 
8
6
  // Call anywhere
9
7
  import { showNotification } from '../modules/notification.js';
@@ -17,7 +15,6 @@ import { showNotification } from '../modules/notification.js';
17
15
  //==========================
18
16
 
19
17
  document.addEventListener("DOMContentLoaded", () => {
20
- initLangSwitcher();
21
18
  });
22
19
 
23
20
  showNotification("404 notification", "success", 3000);
@@ -2,10 +2,6 @@
2
2
  // JAVASCRIPT MODULES IMPORTS
3
3
  //==========================
4
4
 
5
- // Call inside DOMContentLoaded
6
- import { initFormListener } from '../modules/forms/form.js';
7
- import { initLangSwitcher } from '../modules/langSwitcher.js';
8
-
9
5
  // Call anywhere
10
6
  import { showNotification } from '../modules/notification.js';
11
7
 
@@ -18,8 +14,6 @@ import { showNotification } from '../modules/notification.js';
18
14
  //==========================
19
15
 
20
16
  document.addEventListener("DOMContentLoaded", () => {
21
- initLangSwitcher();
22
- initFormListener();
23
17
  });
24
18
 
25
19
  showNotification("Example notification", "success", 3000);
@@ -1,9 +0,0 @@
1
- * text=auto
2
-
3
- /tests export-ignore
4
- /.gitattributes export-ignore
5
- /.github export-ignore
6
- /.gitignore export-ignore
7
- /phpunit.xml.dist export-ignore
8
- /CHANGELOG.md export-ignore
9
- /README.md export-ignore