create-berna-stencil 2.0.2 → 2.0.3
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.
- package/LICENSE +170 -0
- package/NOTICE +5 -0
- package/README.md +4 -4
- package/bin/create.js +11 -4
- package/docs/Head and SEO.md +23 -0
- package/package.json +60 -58
- package/src/backend/_core/vendor/composer/autoload_static.php +10 -10
- package/src/backend/_core/vendor/composer/installed.json +6 -6
- package/src/backend/_core/vendor/composer/installed.php +2 -2
- package/src/backend/_core/vendor/graham-campbell/result-type/.gitattributes +9 -0
- package/src/backend/_core/vendor/graham-campbell/result-type/.github/CODE_OF_CONDUCT.md +132 -0
- package/src/backend/_core/vendor/graham-campbell/result-type/.github/CONTRIBUTING.md +31 -0
- package/src/backend/_core/vendor/graham-campbell/result-type/.github/FUNDING.yml +2 -0
- package/src/backend/_core/vendor/graham-campbell/result-type/.github/SECURITY.md +14 -0
- package/src/backend/_core/vendor/graham-campbell/result-type/.github/workflows/stale.yml +11 -0
- package/src/backend/_core/vendor/graham-campbell/result-type/.github/workflows/tests.yml +40 -0
- package/src/backend/_core/vendor/graham-campbell/result-type/CHANGELOG.md +53 -0
- package/src/backend/_core/vendor/graham-campbell/result-type/LICENSE +21 -21
- package/src/backend/_core/vendor/graham-campbell/result-type/README.md +42 -0
- package/src/backend/_core/vendor/graham-campbell/result-type/composer.json +33 -33
- package/src/backend/_core/vendor/graham-campbell/result-type/phpunit.xml.dist +13 -0
- package/src/backend/_core/vendor/graham-campbell/result-type/src/Error.php +121 -121
- package/src/backend/_core/vendor/graham-campbell/result-type/src/Result.php +69 -69
- package/src/backend/_core/vendor/graham-campbell/result-type/src/Success.php +120 -120
- package/src/backend/_core/vendor/graham-campbell/result-type/tests/ResultTest.php +95 -0
- package/src/backend/_core/vendor/phpoption/phpoption/.gitattributes +13 -0
- package/src/backend/_core/vendor/phpoption/phpoption/.github/CODE_OF_CONDUCT.md +132 -0
- package/src/backend/_core/vendor/phpoption/phpoption/.github/CONTRIBUTING.md +30 -0
- package/src/backend/_core/vendor/phpoption/phpoption/.github/FUNDING.yml +2 -0
- package/src/backend/_core/vendor/phpoption/phpoption/.github/SECURITY.md +14 -0
- package/src/backend/_core/vendor/phpoption/phpoption/.github/workflows/static.yml +40 -0
- package/src/backend/_core/vendor/phpoption/phpoption/.github/workflows/tests.yml +40 -0
- package/src/backend/_core/vendor/phpoption/phpoption/LICENSE +200 -200
- package/src/backend/_core/vendor/phpoption/phpoption/Makefile +17 -0
- package/src/backend/_core/vendor/phpoption/phpoption/README.md +201 -0
- package/src/backend/_core/vendor/phpoption/phpoption/composer.json +50 -50
- package/src/backend/_core/vendor/phpoption/phpoption/phpstan-baseline.neon +44 -0
- package/src/backend/_core/vendor/phpoption/phpoption/phpstan.neon.dist +7 -0
- package/src/backend/_core/vendor/phpoption/phpoption/phpunit.xml.dist +13 -0
- package/src/backend/_core/vendor/phpoption/phpoption/src/PhpOption/LazyOption.php +175 -175
- package/src/backend/_core/vendor/phpoption/phpoption/src/PhpOption/None.php +136 -136
- package/src/backend/_core/vendor/phpoption/phpoption/src/PhpOption/Option.php +434 -434
- package/src/backend/_core/vendor/phpoption/phpoption/src/PhpOption/Some.php +169 -169
- package/src/backend/_core/vendor/phpoption/phpoption/tests/PhpOption/Tests/EnsureTest.php +72 -0
- package/src/backend/_core/vendor/phpoption/phpoption/tests/PhpOption/Tests/LazyOptionTest.php +357 -0
- package/src/backend/_core/vendor/phpoption/phpoption/tests/PhpOption/Tests/NoneTest.php +153 -0
- package/src/backend/_core/vendor/phpoption/phpoption/tests/PhpOption/Tests/OptionTest.php +166 -0
- package/src/backend/_core/vendor/phpoption/phpoption/tests/PhpOption/Tests/SomeTest.php +194 -0
- package/src/backend/_core/vendor/phpoption/phpoption/tests/bootstrap.php +8 -0
- package/src/backend/_core/vendor/phpoption/phpoption/vendor-bin/phpstan/composer.json +8 -0
- package/src/backend/_core/vendor/symfony/polyfill-ctype/Ctype.php +232 -232
- package/src/backend/_core/vendor/symfony/polyfill-ctype/LICENSE +19 -19
- package/src/backend/_core/vendor/symfony/polyfill-ctype/README.md +12 -12
- package/src/backend/_core/vendor/symfony/polyfill-ctype/bootstrap.php +50 -50
- package/src/backend/_core/vendor/symfony/polyfill-ctype/bootstrap80.php +46 -46
- package/src/backend/_core/vendor/symfony/polyfill-ctype/composer.json +38 -38
- package/src/backend/_core/vendor/symfony/polyfill-mbstring/LICENSE +19 -19
- package/src/backend/_core/vendor/symfony/polyfill-mbstring/Mbstring.php +1077 -1077
- package/src/backend/_core/vendor/symfony/polyfill-mbstring/README.md +13 -13
- package/src/backend/_core/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php +119 -119
- package/src/backend/_core/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +1397 -1397
- package/src/backend/_core/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php +5 -5
- package/src/backend/_core/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php +1489 -1489
- package/src/backend/_core/vendor/symfony/polyfill-mbstring/bootstrap.php +171 -171
- package/src/backend/_core/vendor/symfony/polyfill-mbstring/bootstrap80.php +167 -167
- package/src/backend/_core/vendor/symfony/polyfill-mbstring/composer.json +39 -39
- package/src/backend/_core/vendor/symfony/polyfill-php80/LICENSE +19 -19
- package/src/backend/_core/vendor/symfony/polyfill-php80/Php80.php +115 -115
- package/src/backend/_core/vendor/symfony/polyfill-php80/PhpToken.php +106 -106
- package/src/backend/_core/vendor/symfony/polyfill-php80/README.md +25 -25
- package/src/backend/_core/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php +31 -31
- package/src/backend/_core/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php +16 -16
- package/src/backend/_core/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php +20 -20
- package/src/backend/_core/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php +16 -16
- package/src/backend/_core/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php +16 -16
- package/src/backend/_core/vendor/symfony/polyfill-php80/bootstrap.php +42 -42
- package/src/backend/_core/vendor/symfony/polyfill-php80/composer.json +37 -37
- package/src/backend/_core/vendor/vlucas/phpdotenv/.editorconfig +15 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/.gitattributes +15 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/.github/CODE_OF_CONDUCT.md +132 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/.github/CONTRIBUTING.md +30 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/.github/FUNDING.yml +2 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/.github/SECURITY.md +14 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/.github/workflows/static.yml +40 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/.github/workflows/tests.yml +70 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/LICENSE +30 -30
- package/src/backend/_core/vendor/vlucas/phpdotenv/Makefile +17 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/README.md +370 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/UPGRADING.md +196 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/composer.json +60 -60
- package/src/backend/_core/vendor/vlucas/phpdotenv/phpstan-baseline.neon +157 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/phpstan.neon.dist +7 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/phpunit.xml.dist +13 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Dotenv.php +267 -267
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Exception/ExceptionInterface.php +12 -12
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Exception/InvalidEncodingException.php +12 -12
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Exception/InvalidFileException.php +12 -12
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Exception/InvalidPathException.php +12 -12
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Exception/ValidationException.php +12 -12
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Loader/Loader.php +48 -48
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Loader/LoaderInterface.php +20 -20
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Loader/Resolver.php +65 -65
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Parser/Entry.php +59 -59
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Parser/EntryParser.php +299 -299
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Parser/Lexer.php +58 -58
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Parser/Lines.php +127 -127
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Parser/Parser.php +53 -53
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Parser/ParserInterface.php +19 -19
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Parser/Value.php +88 -88
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/AdapterInterface.php +15 -15
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ApacheAdapter.php +89 -89
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ArrayAdapter.php +80 -80
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/EnvConstAdapter.php +88 -88
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/GuardedWriter.php +85 -85
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ImmutableWriter.php +110 -110
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiReader.php +48 -48
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiWriter.php +64 -64
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/PutenvAdapter.php +91 -91
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ReaderInterface.php +17 -17
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ReplacingWriter.php +104 -104
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ServerConstAdapter.php +88 -88
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/WriterInterface.php +27 -27
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/AdapterRepository.php +107 -107
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/RepositoryBuilder.php +272 -272
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/RepositoryInterface.php +51 -51
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Store/File/Paths.php +44 -44
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Store/File/Reader.php +81 -81
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Store/FileStore.php +72 -72
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Store/StoreBuilder.php +141 -141
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Store/StoreInterface.php +17 -17
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Store/StringStore.php +37 -37
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Util/Regex.php +112 -112
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Util/Str.php +108 -108
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Validator.php +207 -207
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/DotenvTest.php +387 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Loader/LoaderTest.php +86 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/EntryParserTest.php +234 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/LexerTest.php +40 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/LinesTest.php +53 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/ParserTest.php +98 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/ArrayAdapterTest.php +57 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/EnvConstAdapterTest.php +75 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/PutenvAdapterTest.php +52 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/ServerConstAdapterTest.php +75 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/RepositoryTest.php +305 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Store/StoreTest.php +141 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/ValidatorTest.php +479 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/.env +5 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/assertions.env +18 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/booleans.env +33 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/commented.env +15 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/empty.env +1 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/example.env +1 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/exported.env +7 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/immutable.env +1 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/integers.env +17 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/large.env +2 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/multibyte.env +3 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/multiline.env +14 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/multiple.env +4 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/mutable.env +1 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/nested.env +15 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/quoted.env +11 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/specialchars.env +8 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/unicodevarnames.env +2 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/utf8-with-bom-encoding.env +3 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/windows.env +1 -0
- package/src/backend/_core/vendor/vlucas/phpdotenv/vendor-bin/phpstan/composer.json +15 -0
- package/src/backend/config.php +18 -0
- package/src/frontend/data/site.json +43 -43
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# CONTRIBUTION GUIDELINES
|
|
2
|
+
|
|
3
|
+
Contributions are **welcome** and will be fully **credited**.
|
|
4
|
+
|
|
5
|
+
We accept contributions via pull requests on GitHub. Please review these guidelines before continuing.
|
|
6
|
+
|
|
7
|
+
## Guidelines
|
|
8
|
+
|
|
9
|
+
* Please follow the [PSR-12 Coding Style Guide](https://www.php-fig.org/psr/psr-12/), enforced by [StyleCI](https://styleci.io/).
|
|
10
|
+
* Ensure that the current tests pass, and if you've added something new, add the tests where relevant.
|
|
11
|
+
* Send a coherent commit history, making sure each commit in your pull request is meaningful.
|
|
12
|
+
* You may need to [rebase](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) to avoid merge conflicts.
|
|
13
|
+
* If you are changing or adding to the behaviour or public API, you may need to update the docs.
|
|
14
|
+
* Please remember that we follow [Semantic Versioning](https://semver.org/).
|
|
15
|
+
|
|
16
|
+
## Running Tests
|
|
17
|
+
|
|
18
|
+
First, install the dependencies using [Composer](https://getcomposer.org/):
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
$ composer install
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Then run [PHPUnit](https://phpunit.de/):
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
$ vendor/bin/phpunit
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
* The tests will be automatically run by [GitHub Actions](https://github.com/features/actions) against pull requests.
|
|
31
|
+
* We also have [StyleCI](https://styleci.io/) set up to automatically fix any code style issues.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# SECURITY POLICY
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
After each new major release, the previous release will be supported for no
|
|
6
|
+
less than 2 years, unless explicitly stated otherwise. This may mean that there
|
|
7
|
+
are multiple supported versions at any given time.
|
|
8
|
+
|
|
9
|
+
## Reporting a Vulnerability
|
|
10
|
+
|
|
11
|
+
If you discover a security vulnerability within this package, please send an
|
|
12
|
+
email to security@tidelift.com. All security vulnerabilities will be promptly
|
|
13
|
+
addressed. Please do not disclose security-related issues publicly until a fix
|
|
14
|
+
has been announced.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
tests:
|
|
9
|
+
name: PHP ${{ matrix.php }}
|
|
10
|
+
runs-on: ubuntu-24.04
|
|
11
|
+
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout Code
|
|
18
|
+
uses: actions/checkout@v6
|
|
19
|
+
|
|
20
|
+
- name: Setup PHP
|
|
21
|
+
uses: shivammathur/setup-php@v2
|
|
22
|
+
with:
|
|
23
|
+
php-version: ${{ matrix.php }}
|
|
24
|
+
tools: composer:v2
|
|
25
|
+
coverage: none
|
|
26
|
+
env:
|
|
27
|
+
update: true
|
|
28
|
+
|
|
29
|
+
- name: Setup Problem Matchers
|
|
30
|
+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
|
|
31
|
+
|
|
32
|
+
- name: Install PHP Dependencies
|
|
33
|
+
uses: nick-fields/retry@v3
|
|
34
|
+
with:
|
|
35
|
+
timeout_minutes: 5
|
|
36
|
+
max_attempts: 5
|
|
37
|
+
command: composer update --no-interaction --no-progress
|
|
38
|
+
|
|
39
|
+
- name: Execute PHPUnit
|
|
40
|
+
run: vendor/bin/phpunit
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
CHANGE LOG
|
|
2
|
+
==========
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## V1.1.4 (27/12/2025)
|
|
6
|
+
|
|
7
|
+
* Added support for PHP 8.5
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## V1.1.3 (20/07/2024)
|
|
11
|
+
|
|
12
|
+
* Added support for PHP 8.4
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## V1.1.2 (12/11/2023)
|
|
16
|
+
|
|
17
|
+
* Added support for PHP 8.3
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## V1.1.1 (25/02/2023)
|
|
21
|
+
|
|
22
|
+
* Cleaned up tests
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## V1.1 (30/07/2022)
|
|
26
|
+
|
|
27
|
+
* Added support for PHP 8.2
|
|
28
|
+
* Dropped support for PHP <7.2.5
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## V1.0.4 (21/11/2021)
|
|
32
|
+
|
|
33
|
+
* Updated package metadata
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## V1.0.3 (17/10/2021)
|
|
37
|
+
|
|
38
|
+
* Corrected docs
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## V1.0.2 (28/08/2021)
|
|
42
|
+
|
|
43
|
+
* Added support for PHP 8.1
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## V1.0.1 (13/04/2020)
|
|
47
|
+
|
|
48
|
+
* Updated funding information
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
## V1.0 (21/03/2020)
|
|
52
|
+
|
|
53
|
+
* Initial release
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020-2024 Graham Campbell <hello@gjcampbell.co.uk>
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020-2024 Graham Campbell <hello@gjcampbell.co.uk>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
Result Type
|
|
2
|
+
===========
|
|
3
|
+
|
|
4
|
+
Result Type was created by, and is maintained by [Graham Campbell](https://github.com/GrahamCampbell), and is an implementation of the result type. Feel free to check out the [change log](CHANGELOG.md), [releases](https://github.com/GrahamCampbell/Result-Type/releases), [security policy](https://github.com/GrahamCampbell/Result-Type/security/policy), [license](LICENSE), [code of conduct](.github/CODE_OF_CONDUCT.md), and [contribution guidelines](.github/CONTRIBUTING.md).
|
|
5
|
+
|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="https://github.com/GrahamCampbell/Result-Type/actions?query=workflow%3ATests"><img src="https://img.shields.io/github/actions/workflow/status/GrahamCampbell/Result-Type/tests.yml?label=Tests&style=flat-square" alt="Build Status"></img></a>
|
|
10
|
+
<a href="https://github.styleci.io/repos/249026522"><img src="https://github.styleci.io/repos/249026522/shield" alt="StyleCI Status"></img></a>
|
|
11
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-brightgreen?style=flat-square" alt="Software License"></img></a>
|
|
12
|
+
<a href="https://packagist.org/packages/graham-campbell/result-type"><img src="https://img.shields.io/packagist/dt/graham-campbell/result-type?style=flat-square" alt="Packagist Downloads"></img></a>
|
|
13
|
+
<a href="https://github.com/GrahamCampbell/Result-Type/releases"><img src="https://img.shields.io/github/release/GrahamCampbell/Result-Type?style=flat-square" alt="Latest Version"></img></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
This version requires [PHP](https://www.php.net/) 7.2.5-8.5.
|
|
20
|
+
|
|
21
|
+
To get the latest version, simply require the project using [Composer](https://getcomposer.org/):
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
$ composer require "graham-campbell/result-type:^1.1"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## Security
|
|
29
|
+
|
|
30
|
+
If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. You may view our full security policy [here](https://github.com/GrahamCampbell/Result-Type/security/policy).
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## License
|
|
34
|
+
|
|
35
|
+
Result Type is licensed under [The MIT License (MIT)](LICENSE).
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## For Enterprise
|
|
39
|
+
|
|
40
|
+
Available as part of the Tidelift Subscription
|
|
41
|
+
|
|
42
|
+
The maintainers of `graham-campbell/result-type` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-graham-campbell-result-type?utm_source=packagist-graham-campbell-result-type&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "graham-campbell/result-type",
|
|
3
|
-
"description": "An Implementation Of The Result Type",
|
|
4
|
-
"keywords": ["result", "result-type", "Result", "Result Type", "Result-Type", "Graham Campbell", "GrahamCampbell"],
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"authors": [
|
|
7
|
-
{
|
|
8
|
-
"name": "Graham Campbell",
|
|
9
|
-
"email": "hello@gjcampbell.co.uk",
|
|
10
|
-
"homepage": "https://github.com/GrahamCampbell"
|
|
11
|
-
}
|
|
12
|
-
],
|
|
13
|
-
"require": {
|
|
14
|
-
"php": "^7.2.5 || ^8.0",
|
|
15
|
-
"phpoption/phpoption": "^1.9.5"
|
|
16
|
-
},
|
|
17
|
-
"require-dev": {
|
|
18
|
-
"phpunit/phpunit": "^8.5.41 || ^9.6.22 || ^10.5.45 || ^11.5.7"
|
|
19
|
-
},
|
|
20
|
-
"autoload": {
|
|
21
|
-
"psr-4": {
|
|
22
|
-
"GrahamCampbell\\ResultType\\": "src/"
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"autoload-dev": {
|
|
26
|
-
"psr-4": {
|
|
27
|
-
"GrahamCampbell\\Tests\\ResultType\\": "tests/"
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
"config": {
|
|
31
|
-
"preferred-install": "dist"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "graham-campbell/result-type",
|
|
3
|
+
"description": "An Implementation Of The Result Type",
|
|
4
|
+
"keywords": ["result", "result-type", "Result", "Result Type", "Result-Type", "Graham Campbell", "GrahamCampbell"],
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"authors": [
|
|
7
|
+
{
|
|
8
|
+
"name": "Graham Campbell",
|
|
9
|
+
"email": "hello@gjcampbell.co.uk",
|
|
10
|
+
"homepage": "https://github.com/GrahamCampbell"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"require": {
|
|
14
|
+
"php": "^7.2.5 || ^8.0",
|
|
15
|
+
"phpoption/phpoption": "^1.9.5"
|
|
16
|
+
},
|
|
17
|
+
"require-dev": {
|
|
18
|
+
"phpunit/phpunit": "^8.5.41 || ^9.6.22 || ^10.5.45 || ^11.5.7"
|
|
19
|
+
},
|
|
20
|
+
"autoload": {
|
|
21
|
+
"psr-4": {
|
|
22
|
+
"GrahamCampbell\\ResultType\\": "src/"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"autoload-dev": {
|
|
26
|
+
"psr-4": {
|
|
27
|
+
"GrahamCampbell\\Tests\\ResultType\\": "tests/"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"config": {
|
|
31
|
+
"preferred-install": "dist"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
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="Result Type 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>
|
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
|
|
3
|
-
declare(strict_types=1);
|
|
4
|
-
|
|
5
|
-
/*
|
|
6
|
-
* This file is part of Result Type.
|
|
7
|
-
*
|
|
8
|
-
* (c) Graham Campbell <hello@gjcampbell.co.uk>
|
|
9
|
-
*
|
|
10
|
-
* For the full copyright and license information, please view the LICENSE
|
|
11
|
-
* file that was distributed with this source code.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
namespace GrahamCampbell\ResultType;
|
|
15
|
-
|
|
16
|
-
use PhpOption\None;
|
|
17
|
-
use PhpOption\Some;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @template T
|
|
21
|
-
* @template E
|
|
22
|
-
*
|
|
23
|
-
* @extends \GrahamCampbell\ResultType\Result<T,E>
|
|
24
|
-
*/
|
|
25
|
-
final class Error extends Result
|
|
26
|
-
{
|
|
27
|
-
/**
|
|
28
|
-
* @var E
|
|
29
|
-
*/
|
|
30
|
-
private $value;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Internal constructor for an error value.
|
|
34
|
-
*
|
|
35
|
-
* @param E $value
|
|
36
|
-
*
|
|
37
|
-
* @return void
|
|
38
|
-
*/
|
|
39
|
-
private function __construct($value)
|
|
40
|
-
{
|
|
41
|
-
$this->value = $value;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Create a new error value.
|
|
46
|
-
*
|
|
47
|
-
* @template F
|
|
48
|
-
*
|
|
49
|
-
* @param F $value
|
|
50
|
-
*
|
|
51
|
-
* @return \GrahamCampbell\ResultType\Result<T,F>
|
|
52
|
-
*/
|
|
53
|
-
public static function create($value)
|
|
54
|
-
{
|
|
55
|
-
return new self($value);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Get the success option value.
|
|
60
|
-
*
|
|
61
|
-
* @return \PhpOption\Option<T>
|
|
62
|
-
*/
|
|
63
|
-
public function success()
|
|
64
|
-
{
|
|
65
|
-
return None::create();
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Map over the success value.
|
|
70
|
-
*
|
|
71
|
-
* @template S
|
|
72
|
-
*
|
|
73
|
-
* @param callable(T):S $f
|
|
74
|
-
*
|
|
75
|
-
* @return \GrahamCampbell\ResultType\Result<S,E>
|
|
76
|
-
*/
|
|
77
|
-
public function map(callable $f)
|
|
78
|
-
{
|
|
79
|
-
return self::create($this->value);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Flat map over the success value.
|
|
84
|
-
*
|
|
85
|
-
* @template S
|
|
86
|
-
* @template F
|
|
87
|
-
*
|
|
88
|
-
* @param callable(T):\GrahamCampbell\ResultType\Result<S,F> $f
|
|
89
|
-
*
|
|
90
|
-
* @return \GrahamCampbell\ResultType\Result<S,F>
|
|
91
|
-
*/
|
|
92
|
-
public function flatMap(callable $f)
|
|
93
|
-
{
|
|
94
|
-
/** @var \GrahamCampbell\ResultType\Result<S,F> */
|
|
95
|
-
return self::create($this->value);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Get the error option value.
|
|
100
|
-
*
|
|
101
|
-
* @return \PhpOption\Option<E>
|
|
102
|
-
*/
|
|
103
|
-
public function error()
|
|
104
|
-
{
|
|
105
|
-
return Some::create($this->value);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Map over the error value.
|
|
110
|
-
*
|
|
111
|
-
* @template F
|
|
112
|
-
*
|
|
113
|
-
* @param callable(E):F $f
|
|
114
|
-
*
|
|
115
|
-
* @return \GrahamCampbell\ResultType\Result<T,F>
|
|
116
|
-
*/
|
|
117
|
-
public function mapError(callable $f)
|
|
118
|
-
{
|
|
119
|
-
return self::create($f($this->value));
|
|
120
|
-
}
|
|
121
|
-
}
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
declare(strict_types=1);
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* This file is part of Result Type.
|
|
7
|
+
*
|
|
8
|
+
* (c) Graham Campbell <hello@gjcampbell.co.uk>
|
|
9
|
+
*
|
|
10
|
+
* For the full copyright and license information, please view the LICENSE
|
|
11
|
+
* file that was distributed with this source code.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
namespace GrahamCampbell\ResultType;
|
|
15
|
+
|
|
16
|
+
use PhpOption\None;
|
|
17
|
+
use PhpOption\Some;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @template T
|
|
21
|
+
* @template E
|
|
22
|
+
*
|
|
23
|
+
* @extends \GrahamCampbell\ResultType\Result<T,E>
|
|
24
|
+
*/
|
|
25
|
+
final class Error extends Result
|
|
26
|
+
{
|
|
27
|
+
/**
|
|
28
|
+
* @var E
|
|
29
|
+
*/
|
|
30
|
+
private $value;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Internal constructor for an error value.
|
|
34
|
+
*
|
|
35
|
+
* @param E $value
|
|
36
|
+
*
|
|
37
|
+
* @return void
|
|
38
|
+
*/
|
|
39
|
+
private function __construct($value)
|
|
40
|
+
{
|
|
41
|
+
$this->value = $value;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Create a new error value.
|
|
46
|
+
*
|
|
47
|
+
* @template F
|
|
48
|
+
*
|
|
49
|
+
* @param F $value
|
|
50
|
+
*
|
|
51
|
+
* @return \GrahamCampbell\ResultType\Result<T,F>
|
|
52
|
+
*/
|
|
53
|
+
public static function create($value)
|
|
54
|
+
{
|
|
55
|
+
return new self($value);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Get the success option value.
|
|
60
|
+
*
|
|
61
|
+
* @return \PhpOption\Option<T>
|
|
62
|
+
*/
|
|
63
|
+
public function success()
|
|
64
|
+
{
|
|
65
|
+
return None::create();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Map over the success value.
|
|
70
|
+
*
|
|
71
|
+
* @template S
|
|
72
|
+
*
|
|
73
|
+
* @param callable(T):S $f
|
|
74
|
+
*
|
|
75
|
+
* @return \GrahamCampbell\ResultType\Result<S,E>
|
|
76
|
+
*/
|
|
77
|
+
public function map(callable $f)
|
|
78
|
+
{
|
|
79
|
+
return self::create($this->value);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Flat map over the success value.
|
|
84
|
+
*
|
|
85
|
+
* @template S
|
|
86
|
+
* @template F
|
|
87
|
+
*
|
|
88
|
+
* @param callable(T):\GrahamCampbell\ResultType\Result<S,F> $f
|
|
89
|
+
*
|
|
90
|
+
* @return \GrahamCampbell\ResultType\Result<S,F>
|
|
91
|
+
*/
|
|
92
|
+
public function flatMap(callable $f)
|
|
93
|
+
{
|
|
94
|
+
/** @var \GrahamCampbell\ResultType\Result<S,F> */
|
|
95
|
+
return self::create($this->value);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Get the error option value.
|
|
100
|
+
*
|
|
101
|
+
* @return \PhpOption\Option<E>
|
|
102
|
+
*/
|
|
103
|
+
public function error()
|
|
104
|
+
{
|
|
105
|
+
return Some::create($this->value);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Map over the error value.
|
|
110
|
+
*
|
|
111
|
+
* @template F
|
|
112
|
+
*
|
|
113
|
+
* @param callable(E):F $f
|
|
114
|
+
*
|
|
115
|
+
* @return \GrahamCampbell\ResultType\Result<T,F>
|
|
116
|
+
*/
|
|
117
|
+
public function mapError(callable $f)
|
|
118
|
+
{
|
|
119
|
+
return self::create($f($this->value));
|
|
120
|
+
}
|
|
121
|
+
}
|