create-berna-stencil 1.0.9 → 1.0.10
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/.env.example +8 -0
- package/.gitignore +2 -1
- package/README.md +1 -5
- package/bin/create.js +2 -1
- package/package.json +71 -70
- package/src/api/vendor/autoload.php +22 -22
- package/src/api/vendor/composer/ClassLoader.php +579 -579
- package/src/api/vendor/composer/InstalledVersions.php +396 -396
- package/src/api/vendor/composer/LICENSE +21 -21
- package/src/api/vendor/composer/autoload_classmap.php +15 -15
- package/src/api/vendor/composer/autoload_files.php +12 -12
- package/src/api/vendor/composer/autoload_namespaces.php +9 -9
- package/src/api/vendor/composer/autoload_psr4.php +16 -16
- package/src/api/vendor/composer/autoload_real.php +50 -50
- package/src/api/vendor/composer/autoload_static.php +86 -86
- package/src/api/vendor/composer/installed.json +582 -582
- package/src/api/vendor/composer/installed.php +86 -86
- package/src/api/vendor/composer/platform_check.php +25 -25
- package/src/api/vendor/graham-campbell/result-type/.gitattributes +9 -0
- package/src/api/vendor/graham-campbell/result-type/.github/CODE_OF_CONDUCT.md +132 -0
- package/src/api/vendor/graham-campbell/result-type/.github/CONTRIBUTING.md +31 -0
- package/src/api/vendor/graham-campbell/result-type/.github/FUNDING.yml +2 -0
- package/src/api/vendor/graham-campbell/result-type/.github/SECURITY.md +14 -0
- package/src/api/vendor/graham-campbell/result-type/.github/workflows/stale.yml +11 -0
- package/src/api/vendor/graham-campbell/result-type/.github/workflows/tests.yml +40 -0
- package/src/api/vendor/graham-campbell/result-type/CHANGELOG.md +53 -0
- package/src/api/vendor/graham-campbell/result-type/LICENSE +21 -0
- package/src/api/vendor/graham-campbell/result-type/README.md +42 -0
- package/src/api/vendor/graham-campbell/result-type/composer.json +33 -0
- package/src/api/vendor/graham-campbell/result-type/phpunit.xml.dist +13 -0
- package/src/api/vendor/graham-campbell/result-type/src/Error.php +121 -0
- package/src/api/vendor/graham-campbell/result-type/src/Result.php +69 -0
- package/src/api/vendor/graham-campbell/result-type/src/Success.php +120 -0
- package/src/api/vendor/graham-campbell/result-type/tests/ResultTest.php +95 -0
- package/src/api/vendor/phpmailer/phpmailer/.codecov.yml +21 -0
- package/src/api/vendor/phpmailer/phpmailer/.editorconfig +15 -0
- package/src/api/vendor/phpmailer/phpmailer/.gitattributes +17 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/FUNDING.yml +6 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/ISSUE_TEMPLATE/bug_report.md +23 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/actions/build-docs/Dockerfile +15 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/actions/build-docs/entrypoint.sh +5 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/dependabot.yml +21 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/workflows/docs.yaml +30 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/workflows/scorecards.yml +61 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/workflows/tests.yml +237 -0
- package/src/api/vendor/phpmailer/phpmailer/.phan/config.php +41 -0
- package/src/api/vendor/phpmailer/phpmailer/COMMITMENT +46 -0
- package/src/api/vendor/phpmailer/phpmailer/LICENSE +502 -0
- package/src/api/vendor/phpmailer/phpmailer/README.md +232 -0
- package/src/api/vendor/phpmailer/phpmailer/SECURITY.md +37 -0
- package/src/api/vendor/phpmailer/phpmailer/SMTPUTF8.md +48 -0
- package/src/api/vendor/phpmailer/phpmailer/UPGRADING.md +125 -0
- package/src/api/vendor/phpmailer/phpmailer/VERSION +1 -0
- package/src/api/vendor/phpmailer/phpmailer/changelog.md +1122 -0
- package/src/api/vendor/phpmailer/phpmailer/composer.json +84 -0
- package/src/api/vendor/phpmailer/phpmailer/docs/README.md +9 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/DKIM_gen_keys.phps +81 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/DKIM_sign.phps +46 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/README.md +96 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/azure_xoauth2.phps +126 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/callback.phps +76 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/contactform-ajax.phps +146 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/contactform.phps +95 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/contents.html +17 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/contentsutf8.html +23 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/exceptions.phps +40 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/extending.phps +72 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/gmail.phps +106 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/gmail_xoauth.phps +121 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/images/PHPMailer card logo.afdesign +0 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/images/PHPMailer card logo.png +0 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/images/PHPMailer card logo.svg +209 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/images/phpmailer.png +0 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/images/phpmailer_mini.png +0 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/mail.phps +35 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/mailing_list.phps +96 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/pop_before_smtp.phps +60 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/send_file_upload.phps +60 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/send_multiple_file_upload.phps +60 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/sendmail.phps +37 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/sendoauth2.phps +100 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/simple_contact_form.phps +102 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/smime_signed_mail.phps +99 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/smtp.phps +62 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/smtp_check.phps +60 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/smtp_low_memory.phps +117 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/smtp_no_auth.phps +53 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/ssl_options.phps +81 -0
- package/src/api/vendor/phpmailer/phpmailer/get_oauth_token.php +182 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php +26 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ar.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-as.php +35 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ba.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-bn.php +35 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-da.php +39 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-el.php +33 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-eo.php +37 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php +38 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-fo.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php +36 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-gl.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php +35 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-hy.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php +31 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php +37 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ku.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-mn.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ms.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php +37 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-nl.php +38 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php +33 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt.php +34 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php +38 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php +33 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php +36 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-si.php +34 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php +30 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php +36 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php +38 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-uk.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ur.php +30 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php +29 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php +36 -0
- package/src/api/vendor/phpmailer/phpmailer/phpcs.xml.dist +52 -0
- package/src/api/vendor/phpmailer/phpmailer/phpdoc.dist.xml +20 -0
- package/src/api/vendor/phpmailer/phpmailer/phpunit.xml.dist +36 -0
- package/src/api/vendor/phpmailer/phpmailer/src/DSNConfigurator.php +245 -0
- package/src/api/vendor/phpmailer/phpmailer/src/Exception.php +40 -0
- package/src/api/vendor/phpmailer/phpmailer/src/OAuth.php +139 -0
- package/src/api/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php +44 -0
- package/src/api/vendor/phpmailer/phpmailer/src/PHPMailer.php +5525 -0
- package/src/api/vendor/phpmailer/phpmailer/src/POP3.php +470 -0
- package/src/api/vendor/phpmailer/phpmailer/src/SMTP.php +1617 -0
- package/src/api/vendor/phpmailer/phpmailer/test/DebugLogTestListener.php +47 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/FileIsAccessibleTest/accessible.txt +1 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/FileIsAccessibleTest/inaccessible.txt +1 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-fr.php +10 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-nl.php +10 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xa_scri_cc.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xb_scri.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xc_cc.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xd_cc.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xd_scri.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xe.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xx.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-yy.php +16 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-yz.php +16 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-zz.php +20 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Language/TranslationCompletenessTest.php +97 -0
- package/src/api/vendor/phpmailer/phpmailer/test/OAuth/OAuthTest.php +76 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/AddEmbeddedImageTest.php +178 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/AddStringAttachmentTest.php +147 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/AddStringEmbeddedImageTest.php +161 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/AddrFormatTest.php +70 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/AuthCRAMMD5Test.php +48 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/CustomHeaderTest.php +285 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/DKIMTest.php +258 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/DKIMWithoutExceptionsTest.php +46 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/DSNConfiguratorTest.php +221 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/EncodeQTest.php +110 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/EncodeStringTest.php +135 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/FileIsAccessibleTest.php +103 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/FilenameToTypeTest.php +74 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/GenerateIdTest.php +75 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/GetLastMessageIDTest.php +110 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/HasLineLongerThanMaxTest.php +158 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/Html2TextTest.php +231 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/ICalTest.php +126 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/IsPermittedPathTest.php +108 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/IsValidHostTest.php +107 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/LocalizationTest.php +505 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/MailTransportTest.php +261 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/MbPathinfoTest.php +171 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/MimeTypesTest.php +70 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/NormalizeBreaksTest.php +111 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/PHPMailerTest.php +1388 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/ParseAddressesTest.php +321 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/PunyencodeAddressTest.php +141 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/QuotedStringTest.php +70 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/ReplyToGetSetClearTest.php +444 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/SetErrorTest.php +154 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/SetFromTest.php +202 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/SetTest.php +81 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/SetWordWrapTest.php +120 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/Utf8CharBoundaryTest.php +66 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/ValidateAddressCustomValidatorTest.php +116 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/ValidateAddressTest.php +485 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/WrapTextTest.php +125 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/XMailerTest.php +75 -0
- package/src/api/vendor/phpmailer/phpmailer/test/POP3/PopBeforeSmtpTest.php +139 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PreSendTestCase.php +46 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Security/DenialOfServiceVectorsTest.php +52 -0
- package/src/api/vendor/phpmailer/phpmailer/test/SendTestCase.php +126 -0
- package/src/api/vendor/phpmailer/phpmailer/test/TestCase.php +392 -0
- package/src/api/vendor/phpmailer/phpmailer/test/fakepopserver.sh +126 -0
- package/src/api/vendor/phpmailer/phpmailer/test/fakesendmail.sh +22 -0
- package/src/api/vendor/phpmailer/phpmailer/test/runfakepopserver.sh +12 -0
- package/src/api/vendor/phpmailer/phpmailer/test/testbootstrap-dist.php +8 -0
- package/src/api/vendor/phpmailer/phpmailer/test/validators.php +12 -0
- package/src/api/vendor/phpoption/phpoption/.gitattributes +13 -0
- package/src/api/vendor/phpoption/phpoption/.github/CODE_OF_CONDUCT.md +132 -0
- package/src/api/vendor/phpoption/phpoption/.github/CONTRIBUTING.md +30 -0
- package/src/api/vendor/phpoption/phpoption/.github/FUNDING.yml +2 -0
- package/src/api/vendor/phpoption/phpoption/.github/SECURITY.md +14 -0
- package/src/api/vendor/phpoption/phpoption/.github/workflows/static.yml +40 -0
- package/src/api/vendor/phpoption/phpoption/.github/workflows/tests.yml +40 -0
- package/src/api/vendor/phpoption/phpoption/LICENSE +201 -0
- package/src/api/vendor/phpoption/phpoption/Makefile +17 -0
- package/src/api/vendor/phpoption/phpoption/README.md +201 -0
- package/src/api/vendor/phpoption/phpoption/composer.json +50 -0
- package/src/api/vendor/phpoption/phpoption/phpstan-baseline.neon +44 -0
- package/src/api/vendor/phpoption/phpoption/phpstan.neon.dist +7 -0
- package/src/api/vendor/phpoption/phpoption/phpunit.xml.dist +13 -0
- package/src/api/vendor/phpoption/phpoption/src/PhpOption/LazyOption.php +175 -0
- package/src/api/vendor/phpoption/phpoption/src/PhpOption/None.php +136 -0
- package/src/api/vendor/phpoption/phpoption/src/PhpOption/Option.php +434 -0
- package/src/api/vendor/phpoption/phpoption/src/PhpOption/Some.php +169 -0
- package/src/api/vendor/phpoption/phpoption/tests/PhpOption/Tests/EnsureTest.php +72 -0
- package/src/api/vendor/phpoption/phpoption/tests/PhpOption/Tests/LazyOptionTest.php +357 -0
- package/src/api/vendor/phpoption/phpoption/tests/PhpOption/Tests/NoneTest.php +153 -0
- package/src/api/vendor/phpoption/phpoption/tests/PhpOption/Tests/OptionTest.php +166 -0
- package/src/api/vendor/phpoption/phpoption/tests/PhpOption/Tests/SomeTest.php +194 -0
- package/src/api/vendor/phpoption/phpoption/tests/bootstrap.php +8 -0
- package/src/api/vendor/phpoption/phpoption/vendor-bin/phpstan/composer.json +8 -0
- package/src/api/vendor/symfony/polyfill-ctype/Ctype.php +232 -0
- package/src/api/vendor/symfony/polyfill-ctype/LICENSE +19 -0
- package/src/api/vendor/symfony/polyfill-ctype/README.md +12 -0
- package/src/api/vendor/symfony/polyfill-ctype/bootstrap.php +50 -0
- package/src/api/vendor/symfony/polyfill-ctype/bootstrap80.php +46 -0
- package/src/api/vendor/symfony/polyfill-ctype/composer.json +38 -0
- package/src/api/vendor/symfony/polyfill-mbstring/LICENSE +19 -0
- package/src/api/vendor/symfony/polyfill-mbstring/Mbstring.php +1077 -0
- package/src/api/vendor/symfony/polyfill-mbstring/README.md +13 -0
- package/src/api/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php +119 -0
- package/src/api/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +1397 -0
- package/src/api/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php +5 -0
- package/src/api/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php +1489 -0
- package/src/api/vendor/symfony/polyfill-mbstring/bootstrap.php +171 -0
- package/src/api/vendor/symfony/polyfill-mbstring/bootstrap80.php +167 -0
- package/src/api/vendor/symfony/polyfill-mbstring/composer.json +39 -0
- package/src/api/vendor/symfony/polyfill-php80/LICENSE +19 -0
- package/src/api/vendor/symfony/polyfill-php80/Php80.php +115 -0
- package/src/api/vendor/symfony/polyfill-php80/PhpToken.php +106 -0
- package/src/api/vendor/symfony/polyfill-php80/README.md +25 -0
- package/src/api/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php +31 -0
- package/src/api/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php +16 -0
- package/src/api/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php +20 -0
- package/src/api/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php +16 -0
- package/src/api/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php +16 -0
- package/src/api/vendor/symfony/polyfill-php80/bootstrap.php +42 -0
- package/src/api/vendor/symfony/polyfill-php80/composer.json +37 -0
- package/src/api/vendor/vlucas/phpdotenv/.editorconfig +15 -0
- package/src/api/vendor/vlucas/phpdotenv/.gitattributes +15 -0
- package/src/api/vendor/vlucas/phpdotenv/.github/CODE_OF_CONDUCT.md +132 -0
- package/src/api/vendor/vlucas/phpdotenv/.github/CONTRIBUTING.md +30 -0
- package/src/api/vendor/vlucas/phpdotenv/.github/FUNDING.yml +2 -0
- package/src/api/vendor/vlucas/phpdotenv/.github/SECURITY.md +14 -0
- package/src/api/vendor/vlucas/phpdotenv/.github/workflows/static.yml +40 -0
- package/src/api/vendor/vlucas/phpdotenv/.github/workflows/tests.yml +70 -0
- package/src/api/vendor/vlucas/phpdotenv/LICENSE +30 -0
- package/src/api/vendor/vlucas/phpdotenv/Makefile +17 -0
- package/src/api/vendor/vlucas/phpdotenv/README.md +370 -0
- package/src/api/vendor/vlucas/phpdotenv/UPGRADING.md +196 -0
- package/src/api/vendor/vlucas/phpdotenv/composer.json +60 -0
- package/src/api/vendor/vlucas/phpdotenv/phpstan-baseline.neon +157 -0
- package/src/api/vendor/vlucas/phpdotenv/phpstan.neon.dist +7 -0
- package/src/api/vendor/vlucas/phpdotenv/phpunit.xml.dist +13 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Dotenv.php +267 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Exception/ExceptionInterface.php +12 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Exception/InvalidEncodingException.php +12 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Exception/InvalidFileException.php +12 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Exception/InvalidPathException.php +12 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Exception/ValidationException.php +12 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Loader/Loader.php +48 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Loader/LoaderInterface.php +20 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Loader/Resolver.php +65 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/Entry.php +59 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/EntryParser.php +299 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/Lexer.php +58 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/Lines.php +127 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/Parser.php +53 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/ParserInterface.php +19 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/Value.php +88 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/AdapterInterface.php +15 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/ApacheAdapter.php +89 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/ArrayAdapter.php +80 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/EnvConstAdapter.php +88 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/GuardedWriter.php +85 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/ImmutableWriter.php +110 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiReader.php +48 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiWriter.php +64 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/PutenvAdapter.php +91 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/ReaderInterface.php +17 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/ReplacingWriter.php +104 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/ServerConstAdapter.php +88 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/WriterInterface.php +27 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/AdapterRepository.php +107 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/RepositoryBuilder.php +272 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/RepositoryInterface.php +51 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Store/File/Paths.php +44 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Store/File/Reader.php +81 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Store/FileStore.php +72 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Store/StoreBuilder.php +141 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Store/StoreInterface.php +17 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Store/StringStore.php +37 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Util/Regex.php +112 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Util/Str.php +108 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Validator.php +207 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/DotenvTest.php +387 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Loader/LoaderTest.php +86 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/EntryParserTest.php +234 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/LexerTest.php +40 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/LinesTest.php +53 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/ParserTest.php +98 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/ArrayAdapterTest.php +57 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/EnvConstAdapterTest.php +75 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/PutenvAdapterTest.php +52 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/ServerConstAdapterTest.php +75 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/RepositoryTest.php +305 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Store/StoreTest.php +141 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/ValidatorTest.php +479 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/.env +5 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/assertions.env +18 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/booleans.env +33 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/commented.env +15 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/empty.env +1 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/example.env +1 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/exported.env +7 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/immutable.env +1 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/integers.env +17 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/large.env +2 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/multibyte.env +3 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/multiline.env +14 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/multiple.env +4 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/mutable.env +1 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/nested.env +15 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/quoted.env +11 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/specialchars.env +8 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/unicodevarnames.env +2 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/utf8-with-bom-encoding.env +3 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/windows.env +1 -0
- package/src/api/vendor/vlucas/phpdotenv/vendor-bin/phpstan/composer.json +15 -0
|
@@ -0,0 +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
|
+
}
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
declare(strict_types=1);
|
|
4
|
+
|
|
5
|
+
namespace Dotenv\Tests;
|
|
6
|
+
|
|
7
|
+
use Dotenv\Dotenv;
|
|
8
|
+
use Dotenv\Exception\InvalidEncodingException;
|
|
9
|
+
use Dotenv\Exception\InvalidPathException;
|
|
10
|
+
use Dotenv\Loader\Loader;
|
|
11
|
+
use Dotenv\Parser\Parser;
|
|
12
|
+
use Dotenv\Repository\RepositoryBuilder;
|
|
13
|
+
use Dotenv\Store\StoreBuilder;
|
|
14
|
+
use PHPUnit\Framework\TestCase;
|
|
15
|
+
|
|
16
|
+
final class DotenvTest extends TestCase
|
|
17
|
+
{
|
|
18
|
+
/**
|
|
19
|
+
* @var string
|
|
20
|
+
*/
|
|
21
|
+
private static $folder;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @beforeClass
|
|
25
|
+
*
|
|
26
|
+
* @return void
|
|
27
|
+
*/
|
|
28
|
+
public static function setFolder()
|
|
29
|
+
{
|
|
30
|
+
self::$folder = \dirname(__DIR__).'/fixtures/env';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public function testDotenvThrowsExceptionIfUnableToLoadFile()
|
|
34
|
+
{
|
|
35
|
+
$dotenv = Dotenv::createMutable(__DIR__);
|
|
36
|
+
|
|
37
|
+
$this->expectException(InvalidPathException::class);
|
|
38
|
+
$this->expectExceptionMessage('Unable to read any of the environment file(s) at');
|
|
39
|
+
|
|
40
|
+
$dotenv->load();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public function testDotenvThrowsExceptionIfUnableToLoadFiles()
|
|
44
|
+
{
|
|
45
|
+
$dotenv = Dotenv::createMutable([__DIR__, __DIR__.'/foo/bar']);
|
|
46
|
+
|
|
47
|
+
$this->expectException(InvalidPathException::class);
|
|
48
|
+
$this->expectExceptionMessage('Unable to read any of the environment file(s) at');
|
|
49
|
+
|
|
50
|
+
$dotenv->load();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public function testDotenvThrowsExceptionWhenNoFiles()
|
|
54
|
+
{
|
|
55
|
+
$dotenv = Dotenv::createMutable([]);
|
|
56
|
+
|
|
57
|
+
$this->expectException(InvalidPathException::class);
|
|
58
|
+
$this->expectExceptionMessage('At least one environment file path must be provided.');
|
|
59
|
+
|
|
60
|
+
$dotenv->load();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public function testDotenvTriesPathsToLoad()
|
|
64
|
+
{
|
|
65
|
+
$dotenv = Dotenv::createMutable([__DIR__, self::$folder]);
|
|
66
|
+
self::assertCount(4, $dotenv->load());
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
public function testDotenvTriesPathsToLoadTwice()
|
|
70
|
+
{
|
|
71
|
+
$dotenv = Dotenv::createMutable([__DIR__, self::$folder]);
|
|
72
|
+
self::assertCount(4, $dotenv->load());
|
|
73
|
+
|
|
74
|
+
$dotenv = Dotenv::createImmutable([__DIR__, self::$folder]);
|
|
75
|
+
self::assertCount(0, $dotenv->load());
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
public function testDotenvTriesPathsToSafeLoad()
|
|
79
|
+
{
|
|
80
|
+
$dotenv = Dotenv::createMutable([__DIR__, self::$folder]);
|
|
81
|
+
self::assertCount(4, $dotenv->safeLoad());
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
public function testDotenvSkipsLoadingIfFileIsMissing()
|
|
85
|
+
{
|
|
86
|
+
$dotenv = Dotenv::createMutable(__DIR__);
|
|
87
|
+
self::assertSame([], $dotenv->safeLoad());
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
public function testDotenvLoadsEnvironmentVars()
|
|
91
|
+
{
|
|
92
|
+
$dotenv = Dotenv::createMutable(self::$folder);
|
|
93
|
+
self::assertSame(
|
|
94
|
+
['FOO' => 'bar', 'BAR' => 'baz', 'SPACED' => 'with spaces', 'NULL' => ''],
|
|
95
|
+
$dotenv->load()
|
|
96
|
+
);
|
|
97
|
+
self::assertSame('bar', $_SERVER['FOO']);
|
|
98
|
+
self::assertSame('baz', $_SERVER['BAR']);
|
|
99
|
+
self::assertSame('with spaces', $_SERVER['SPACED']);
|
|
100
|
+
self::assertEmpty($_SERVER['NULL']);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
public function testDotenvLoadsEnvironmentVarsMultipleWithShortCircuitMode()
|
|
104
|
+
{
|
|
105
|
+
$dotenv = Dotenv::createMutable(self::$folder, ['.env', 'example.env']);
|
|
106
|
+
|
|
107
|
+
self::assertSame(
|
|
108
|
+
['FOO' => 'bar', 'BAR' => 'baz', 'SPACED' => 'with spaces', 'NULL' => ''],
|
|
109
|
+
$dotenv->load()
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
public function testDotenvLoadsEnvironmentVarsMultipleWithoutShortCircuitMode()
|
|
114
|
+
{
|
|
115
|
+
$dotenv = Dotenv::createMutable(self::$folder, ['.env', 'example.env'], false);
|
|
116
|
+
|
|
117
|
+
self::assertSame(
|
|
118
|
+
['FOO' => 'bar', 'BAR' => 'baz', 'SPACED' => 'with spaces', 'NULL' => '', 'EG' => 'example'],
|
|
119
|
+
$dotenv->load()
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
public function testCommentedDotenvLoadsEnvironmentVars()
|
|
124
|
+
{
|
|
125
|
+
$dotenv = Dotenv::createMutable(self::$folder, 'commented.env');
|
|
126
|
+
$dotenv->load();
|
|
127
|
+
self::assertSame('bar', $_SERVER['CFOO']);
|
|
128
|
+
self::assertFalse(isset($_SERVER['CBAR']));
|
|
129
|
+
self::assertFalse(isset($_SERVER['CZOO']));
|
|
130
|
+
self::assertSame('with spaces', $_SERVER['CSPACED']);
|
|
131
|
+
self::assertSame('a value with a # character', $_SERVER['CQUOTES']);
|
|
132
|
+
self::assertSame('a value with a # character & a quote " character inside quotes', $_SERVER['CQUOTESWITHQUOTE']);
|
|
133
|
+
self::assertEmpty($_SERVER['CNULL']);
|
|
134
|
+
self::assertEmpty($_SERVER['EMPTY']);
|
|
135
|
+
self::assertEmpty($_SERVER['EMPTY2']);
|
|
136
|
+
self::assertSame('foo', $_SERVER['FOOO']);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
public function testQuotedDotenvLoadsEnvironmentVars()
|
|
140
|
+
{
|
|
141
|
+
$dotenv = Dotenv::createMutable(self::$folder, 'quoted.env');
|
|
142
|
+
$dotenv->load();
|
|
143
|
+
self::assertSame('bar', $_SERVER['QFOO']);
|
|
144
|
+
self::assertSame('baz', $_SERVER['QBAR']);
|
|
145
|
+
self::assertSame('with spaces', $_SERVER['QSPACED']);
|
|
146
|
+
self::assertEmpty(\getenv('QNULL'));
|
|
147
|
+
|
|
148
|
+
self::assertSame('pgsql:host=localhost;dbname=test', $_SERVER['QEQUALS']);
|
|
149
|
+
self::assertSame('test some escaped characters like a quote (") or maybe a backslash (\\)', $_SERVER['QESCAPED']);
|
|
150
|
+
self::assertSame('iiiiviiiixiiiiviiii\\n', $_SERVER['QSLASH']);
|
|
151
|
+
self::assertSame('iiiiviiiixiiiiviiii\\\\n', $_SERVER['SQSLASH']);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
public function testLargeDotenvLoadsEnvironmentVars()
|
|
155
|
+
{
|
|
156
|
+
$dotenv = Dotenv::createMutable(self::$folder, 'large.env');
|
|
157
|
+
$dotenv->load();
|
|
158
|
+
self::assertSame(2730, \strlen($_SERVER['LARGE']));
|
|
159
|
+
self::assertSame(8192, \strlen($_SERVER['HUGE']));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
public function testDotenvLoadsMultibyteVars()
|
|
163
|
+
{
|
|
164
|
+
$dotenv = Dotenv::createMutable(self::$folder, 'multibyte.env');
|
|
165
|
+
$dotenv->load();
|
|
166
|
+
self::assertSame('Ā ā Ă ă Ą ą Ć ć Ĉ ĉ Ċ ċ Č č Ď ď Đ đ Ē ē Ĕ ĕ Ė ė Ę ę Ě ě', $_SERVER['MB1']);
|
|
167
|
+
self::assertSame('行内支付', $_SERVER['MB2']);
|
|
168
|
+
self::assertSame('🚀', $_SERVER['APP_ENV']);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
public function testDotenvLoadsMultibyteUTF8Vars()
|
|
172
|
+
{
|
|
173
|
+
$dotenv = Dotenv::createMutable(self::$folder, 'multibyte.env', false, 'UTF-8');
|
|
174
|
+
$dotenv->load();
|
|
175
|
+
self::assertSame('Ā ā Ă ă Ą ą Ć ć Ĉ ĉ Ċ ċ Č č Ď ď Đ đ Ē ē Ĕ ĕ Ė ė Ę ę Ě ě', $_SERVER['MB1']);
|
|
176
|
+
self::assertSame('行内支付', $_SERVER['MB2']);
|
|
177
|
+
self::assertSame('🚀', $_SERVER['APP_ENV']);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
public function testDotenvLoadWithInvalidEncoding()
|
|
181
|
+
{
|
|
182
|
+
$dotenv = Dotenv::createMutable(self::$folder, 'multibyte.env', false, 'UTF-88');
|
|
183
|
+
|
|
184
|
+
$this->expectException(InvalidEncodingException::class);
|
|
185
|
+
$this->expectExceptionMessage('Illegal character encoding [UTF-88] specified.');
|
|
186
|
+
|
|
187
|
+
$dotenv->load();
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
public function testDotenvLoadsMultibyteWindowsVars()
|
|
191
|
+
{
|
|
192
|
+
$dotenv = Dotenv::createMutable(self::$folder, 'windows.env', false, 'Windows-1252');
|
|
193
|
+
$dotenv->load();
|
|
194
|
+
self::assertSame('ñá', $_SERVER['MBW']);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
public function testMultipleDotenvLoadsEnvironmentVars()
|
|
198
|
+
{
|
|
199
|
+
$dotenv = Dotenv::createMutable(self::$folder, 'multiple.env');
|
|
200
|
+
$dotenv->load();
|
|
201
|
+
self::assertSame('bar', $_SERVER['MULTI1']);
|
|
202
|
+
self::assertSame('foo', $_SERVER['MULTI2']);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
public function testExportedDotenvLoadsEnvironmentVars()
|
|
206
|
+
{
|
|
207
|
+
$dotenv = Dotenv::createMutable(self::$folder, 'exported.env');
|
|
208
|
+
$dotenv->load();
|
|
209
|
+
self::assertSame('bar', $_SERVER['EFOO']);
|
|
210
|
+
self::assertSame('baz', $_SERVER['EBAR']);
|
|
211
|
+
self::assertSame('with spaces', $_SERVER['ESPACED']);
|
|
212
|
+
self::assertSame('123', $_SERVER['EDQUOTED']);
|
|
213
|
+
self::assertSame('456', $_SERVER['ESQUOTED']);
|
|
214
|
+
self::assertEmpty($_SERVER['ENULL']);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
public function testDotenvLoadsEnvGlobals()
|
|
218
|
+
{
|
|
219
|
+
$dotenv = Dotenv::createMutable(self::$folder);
|
|
220
|
+
$dotenv->load();
|
|
221
|
+
self::assertSame('bar', $_SERVER['FOO']);
|
|
222
|
+
self::assertSame('baz', $_SERVER['BAR']);
|
|
223
|
+
self::assertSame('with spaces', $_SERVER['SPACED']);
|
|
224
|
+
self::assertEmpty($_SERVER['NULL']);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
public function testDotenvLoadsServerGlobals()
|
|
228
|
+
{
|
|
229
|
+
$dotenv = Dotenv::createMutable(self::$folder);
|
|
230
|
+
$dotenv->load();
|
|
231
|
+
self::assertSame('bar', $_ENV['FOO']);
|
|
232
|
+
self::assertSame('baz', $_ENV['BAR']);
|
|
233
|
+
self::assertSame('with spaces', $_ENV['SPACED']);
|
|
234
|
+
self::assertEmpty($_ENV['NULL']);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
public function testDotenvNestedEnvironmentVars()
|
|
238
|
+
{
|
|
239
|
+
$dotenv = Dotenv::createMutable(self::$folder, 'nested.env');
|
|
240
|
+
$dotenv->load();
|
|
241
|
+
self::assertSame('{$NVAR1} {$NVAR2}', $_ENV['NVAR3']); // not resolved
|
|
242
|
+
self::assertSame('Hellō World!', $_ENV['NVAR4']);
|
|
243
|
+
self::assertSame('$NVAR1 {NVAR2}', $_ENV['NVAR5']); // not resolved
|
|
244
|
+
self::assertSame('Special Value', $_ENV['N.VAR6']); // new '.' (dot) in var name
|
|
245
|
+
self::assertSame('Special Value', $_ENV['NVAR7']); // nested '.' (dot) variable
|
|
246
|
+
self::assertSame('', $_ENV['NVAR8']); // nested variable is empty string
|
|
247
|
+
self::assertSame('', $_ENV['NVAR9']); // nested variable is empty string
|
|
248
|
+
self::assertSame('${NVAR888}', $_ENV['NVAR10']); // nested variable is not set
|
|
249
|
+
self::assertSame('NVAR1', $_ENV['NVAR11']);
|
|
250
|
+
self::assertSame('Hellō', $_ENV['NVAR12']);
|
|
251
|
+
self::assertSame('${${NVAR11}}', $_ENV['NVAR13']); // single quotes
|
|
252
|
+
self::assertSame('${NVAR1} ${NVAR2}', $_ENV['NVAR14']); // single quotes
|
|
253
|
+
self::assertSame('${NVAR1} ${NVAR2}', $_ENV['NVAR15']); // escaped
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
public function testDotenvNullFileArgumentUsesDefault()
|
|
257
|
+
{
|
|
258
|
+
$dotenv = Dotenv::createMutable(self::$folder, null);
|
|
259
|
+
$dotenv->load();
|
|
260
|
+
self::assertSame('bar', $_SERVER['FOO']);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* The fixture data has whitespace between the key and in the value string.
|
|
265
|
+
*
|
|
266
|
+
* Test that these keys are trimmed down.
|
|
267
|
+
*/
|
|
268
|
+
public function testDotenvTrimmedKeys()
|
|
269
|
+
{
|
|
270
|
+
$dotenv = Dotenv::createMutable(self::$folder, 'quoted.env');
|
|
271
|
+
$dotenv->load();
|
|
272
|
+
self::assertSame('no space', $_SERVER['QWHITESPACE']);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
public function testDotenvLoadDoesNotOverwriteEnv()
|
|
276
|
+
{
|
|
277
|
+
\putenv('IMMUTABLE=true');
|
|
278
|
+
$dotenv = Dotenv::createImmutable(self::$folder, 'immutable.env');
|
|
279
|
+
$dotenv->load();
|
|
280
|
+
self::assertSame('true', \getenv('IMMUTABLE'));
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
public function testDotenvLoadAfterOverload()
|
|
284
|
+
{
|
|
285
|
+
\putenv('IMMUTABLE=true');
|
|
286
|
+
$dotenv = Dotenv::createUnsafeMutable(self::$folder, 'immutable.env');
|
|
287
|
+
$dotenv->load();
|
|
288
|
+
self::assertSame('false', \getenv('IMMUTABLE'));
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
public function testDotenvOverloadAfterLoad()
|
|
292
|
+
{
|
|
293
|
+
\putenv('IMMUTABLE=true');
|
|
294
|
+
$dotenv = Dotenv::createUnsafeImmutable(self::$folder, 'immutable.env');
|
|
295
|
+
$dotenv->load();
|
|
296
|
+
self::assertSame('true', \getenv('IMMUTABLE'));
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
public function testDotenvOverloadDoesOverwriteEnv()
|
|
300
|
+
{
|
|
301
|
+
$dotenv = Dotenv::createUnsafeMutable(self::$folder, 'mutable.env');
|
|
302
|
+
$dotenv->load();
|
|
303
|
+
self::assertSame('true', \getenv('MUTABLE'));
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
public function testDotenvAllowsSpecialCharacters()
|
|
307
|
+
{
|
|
308
|
+
$dotenv = Dotenv::createUnsafeMutable(self::$folder, 'specialchars.env');
|
|
309
|
+
$dotenv->load();
|
|
310
|
+
self::assertSame('$a6^C7k%zs+e^.jvjXk', \getenv('SPVAR1'));
|
|
311
|
+
self::assertSame('?BUty3koaV3%GA*hMAwH}B', \getenv('SPVAR2'));
|
|
312
|
+
self::assertSame('jdgEB4{QgEC]HL))&GcXxokB+wqoN+j>xkV7K?m$r', \getenv('SPVAR3'));
|
|
313
|
+
self::assertSame('22222:22#2^{', \getenv('SPVAR4'));
|
|
314
|
+
self::assertSame('test some escaped characters like a quote " or maybe a backslash \\', \getenv('SPVAR5'));
|
|
315
|
+
self::assertSame('secret!@', \getenv('SPVAR6'));
|
|
316
|
+
self::assertSame('secret!@#', \getenv('SPVAR7'));
|
|
317
|
+
self::assertSame('secret!@#', \getenv('SPVAR8'));
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
public function testMultilineLoading()
|
|
321
|
+
{
|
|
322
|
+
$dotenv = Dotenv::createUnsafeMutable(self::$folder, 'multiline.env');
|
|
323
|
+
$dotenv->load();
|
|
324
|
+
self::assertSame("test\n test\"test\"\n test", \getenv('TEST'));
|
|
325
|
+
self::assertSame("test\ntest", \getenv('TEST_ND'));
|
|
326
|
+
self::assertSame('test\\ntest', \getenv('TEST_NS'));
|
|
327
|
+
|
|
328
|
+
self::assertSame('https://vision.googleapis.com/v1/images:annotate?key=', \getenv('TEST_EQD'));
|
|
329
|
+
self::assertSame('https://vision.googleapis.com/v1/images:annotate?key=', \getenv('TEST_EQS'));
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
public function testEmptyLoading()
|
|
333
|
+
{
|
|
334
|
+
$dotenv = Dotenv::createImmutable(self::$folder, 'empty.env');
|
|
335
|
+
self::assertSame(['EMPTY_VAR' => null], $dotenv->load());
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
public function testUnicodeVarNames()
|
|
339
|
+
{
|
|
340
|
+
$dotenv = Dotenv::createImmutable(self::$folder, 'unicodevarnames.env');
|
|
341
|
+
$dotenv->load();
|
|
342
|
+
self::assertSame('Skybert', $_SERVER['AlbertÅberg']);
|
|
343
|
+
self::assertSame('2022-04-01T00:00', $_SERVER['ДатаЗакрытияРасчетногоПериода']);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
public function testDirectConstructor()
|
|
347
|
+
{
|
|
348
|
+
$repository = RepositoryBuilder::createWithDefaultAdapters()->make();
|
|
349
|
+
$store = StoreBuilder::createWithDefaultName()->addPath(self::$folder)->make();
|
|
350
|
+
|
|
351
|
+
$dotenv = new Dotenv($store, new Parser(), new Loader(), $repository);
|
|
352
|
+
|
|
353
|
+
self::assertSame([
|
|
354
|
+
'FOO' => 'bar',
|
|
355
|
+
'BAR' => 'baz',
|
|
356
|
+
'SPACED' => 'with spaces',
|
|
357
|
+
'NULL' => '',
|
|
358
|
+
], $dotenv->load());
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
public function testDotenvParseExample1()
|
|
362
|
+
{
|
|
363
|
+
$output = Dotenv::parse(
|
|
364
|
+
"BASE_DIR=\"/var/webroot/project-root\"\nCACHE_DIR=\"\${BASE_DIR}/cache\"\nTMP_DIR=\"\${BASE_DIR}/tmp\"\n"
|
|
365
|
+
);
|
|
366
|
+
|
|
367
|
+
self::assertSame($output, [
|
|
368
|
+
'BASE_DIR' => '/var/webroot/project-root',
|
|
369
|
+
'CACHE_DIR' => '/var/webroot/project-root/cache',
|
|
370
|
+
'TMP_DIR' => '/var/webroot/project-root/tmp',
|
|
371
|
+
]);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
public function testDotenvParseExample2()
|
|
375
|
+
{
|
|
376
|
+
$output = Dotenv::parse("FOO=Bar\nBAZ=\"Hello \${FOO}\"");
|
|
377
|
+
|
|
378
|
+
self::assertSame($output, ['FOO' => 'Bar', 'BAZ' => 'Hello Bar']);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
public function testDotenvParseEmptyCase()
|
|
382
|
+
{
|
|
383
|
+
$output = Dotenv::parse('');
|
|
384
|
+
|
|
385
|
+
self::assertSame($output, []);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
declare(strict_types=1);
|
|
4
|
+
|
|
5
|
+
namespace Dotenv\Tests\Loader;
|
|
6
|
+
|
|
7
|
+
use Dotenv\Exception\InvalidFileException;
|
|
8
|
+
use Dotenv\Loader\Loader;
|
|
9
|
+
use Dotenv\Loader\LoaderInterface;
|
|
10
|
+
use Dotenv\Parser\Parser;
|
|
11
|
+
use Dotenv\Repository\Adapter\ArrayAdapter;
|
|
12
|
+
use Dotenv\Repository\Adapter\EnvConstAdapter;
|
|
13
|
+
use Dotenv\Repository\Adapter\ServerConstAdapter;
|
|
14
|
+
use Dotenv\Repository\RepositoryBuilder;
|
|
15
|
+
use PHPUnit\Framework\TestCase;
|
|
16
|
+
|
|
17
|
+
final class LoaderTest extends TestCase
|
|
18
|
+
{
|
|
19
|
+
public function testParserInstanceOf()
|
|
20
|
+
{
|
|
21
|
+
self::assertInstanceOf(LoaderInterface::class, new Loader());
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public function testLoaderWithNoReaders()
|
|
25
|
+
{
|
|
26
|
+
$repository = RepositoryBuilder::createWithNoAdapters()->addWriter(ArrayAdapter::class)->make();
|
|
27
|
+
$loader = new Loader();
|
|
28
|
+
|
|
29
|
+
$content = "NVAR1=\"Hello\"\nNVAR2=\"World!\"\nNVAR3=\"{\$NVAR1} {\$NVAR2}\"\nNVAR4=\"\${NVAR1} \${NVAR2}\"";
|
|
30
|
+
$expected = ['NVAR1' => 'Hello', 'NVAR2' => 'World!', 'NVAR3' => '{$NVAR1} {$NVAR2}', 'NVAR4' => '${NVAR1} ${NVAR2}'];
|
|
31
|
+
|
|
32
|
+
self::assertSame($expected, $loader->load($repository, (new Parser())->parse($content)));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public function testLoaderWithAllowList()
|
|
36
|
+
{
|
|
37
|
+
$adapter = ArrayAdapter::create()->get();
|
|
38
|
+
$repository = RepositoryBuilder::createWithNoAdapters()->addReader($adapter)->addWriter($adapter)->allowList(['FOO'])->make();
|
|
39
|
+
$loader = new Loader();
|
|
40
|
+
|
|
41
|
+
self::assertSame(['FOO' => 'Hello'], $loader->load($repository, (new Parser())->parse("FOO=\"Hello\"\nBAR=\"World!\"\n")));
|
|
42
|
+
self::assertTrue($adapter->read('FOO')->isDefined());
|
|
43
|
+
self::assertSame('Hello', $adapter->read('FOO')->get());
|
|
44
|
+
self::assertFalse($adapter->read('BAR')->isDefined());
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public function testLoaderWithGarbage()
|
|
48
|
+
{
|
|
49
|
+
$adapter = ArrayAdapter::create()->get();
|
|
50
|
+
$repository = RepositoryBuilder::createWithNoAdapters()->make();
|
|
51
|
+
$loader = new Loader();
|
|
52
|
+
|
|
53
|
+
$this->expectException(InvalidFileException::class);
|
|
54
|
+
$this->expectExceptionMessage('Failed to parse dotenv file. Encountered unexpected whitespace at ["""].');
|
|
55
|
+
|
|
56
|
+
$loader->load($repository, (new Parser())->parse('FOO="""'));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @return array<int,\Dotenv\Repository\Adapter\AdapterInterface|string>[]
|
|
61
|
+
*/
|
|
62
|
+
public static function providesAdapters()
|
|
63
|
+
{
|
|
64
|
+
return [
|
|
65
|
+
[ArrayAdapter::create()->get()],
|
|
66
|
+
[EnvConstAdapter::class],
|
|
67
|
+
[ServerConstAdapter::class],
|
|
68
|
+
];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @dataProvider providesAdapters
|
|
73
|
+
*
|
|
74
|
+
* @param \Dotenv\Repository\Adapter\AdapterInterface|string $adapter
|
|
75
|
+
*/
|
|
76
|
+
public function testLoaderWithSpecificAdapter($adapter)
|
|
77
|
+
{
|
|
78
|
+
$repository = RepositoryBuilder::createWithNoAdapters()->addReader($adapter)->addWriter($adapter)->make();
|
|
79
|
+
$loader = new Loader();
|
|
80
|
+
|
|
81
|
+
$content = "NVAR1=\"Hello\"\nNVAR2=\"World!\"\nNVAR3=\"{\$NVAR1} {\$NVAR2}\"\nNVAR4=\"\${NVAR1} \${NVAR2}\"";
|
|
82
|
+
$expected = ['NVAR1' => 'Hello', 'NVAR2' => 'World!', 'NVAR3' => '{$NVAR1} {$NVAR2}', 'NVAR4' => 'Hello World!'];
|
|
83
|
+
|
|
84
|
+
self::assertSame($expected, $loader->load($repository, (new Parser())->parse($content)));
|
|
85
|
+
}
|
|
86
|
+
}
|