Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vlucas/phpdotenv
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.3.0
Choose a base ref
...
head repository: vlucas/phpdotenv
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v5.3.1
Choose a head ref
  • 14 commits
  • 11 files changed
  • 4 contributors

Commits on Mar 24, 2021

  1. Adding safeLoad() information on README.md file (#478)

    Co-authored-by: Graham Campbell <GrahamCampbell@users.noreply.github.com>
    Weslley Victor and GrahamCampbell authored Mar 24, 2021

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    b740396 View commit details

Commits on May 23, 2021

  1. Fixed test names

    Closes #480
    
    
    Co-authored-by: Martin Krisell <martin.krisell@gmail.com>
    GrahamCampbell and Krisell authored May 23, 2021

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    a399cb5 View commit details
  2. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    3449336 View commit details
  3. Merge branch '4.2'

    GrahamCampbell committed May 23, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b83be80 View commit details

Commits on Sep 2, 2021

  1. Updated documentation

    GrahamCampbell committed Sep 2, 2021

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    5f702d0 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    622df6a View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3349d8c View commit details

Commits on Oct 2, 2021

  1. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    f1e2a35 View commit details
  2. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    51a8a7b View commit details
  3. Copy the full SHA
    a1bf4c9 View commit details
  4. Copy the full SHA
    6854d24 View commit details
  5. Copy the full SHA
    d38f4d1 View commit details
  6. Merge branch '4.2'

    GrahamCampbell committed Oct 2, 2021
    Copy the full SHA
    4a4a82c View commit details
  7. Update composer.json

    GrahamCampbell committed Oct 2, 2021
    Copy the full SHA
    accaddf View commit details
Showing with 140 additions and 74 deletions.
  1. +104 −48 .github/CODE_OF_CONDUCT.md
  2. +1 −1 .github/CONTRIBUTING.md
  3. +3 −3 .github/SECURITY.md
  4. +2 −2 .github/workflows/tests.yml
  5. +8 −1 README.md
  6. +8 −10 composer.json
  7. +2 −1 phpunit.xml.dist
  8. +4 −2 psalm-baseline.xml
  9. +2 −2 tests/Dotenv/DotenvTest.php
  10. +4 −3 vendor-bin/phpstan/composer.json
  11. +2 −1 vendor-bin/psalm/composer.json
152 changes: 104 additions & 48 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -2,75 +2,131 @@

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:
Examples of behavior that contributes to a positive environment for our
community include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior by participants include:
Examples of unacceptable behavior include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
professional setting

## Our Responsibilities
## Enforcement Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at graham@alt-three.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
reported to the community leaders responsible for enforcement at
hello@gjcampbell.co.uk.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

[homepage]: https://www.contributor-covenant.org
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
at [https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ We accept contributions via pull requests on Github. Please review these guideli

## Guidelines

* Please follow the [PSR-2 Coding Style Guide](https://www.php-fig.org/psr/psr-2/).
* Please follow the [PSR-12 Coding Style Guide](https://www.php-fig.org/psr/psr-12/).
* Ensure that the current tests pass, and if you've added something new, add the tests where relevant.
* Send a coherent commit history, making sure each individual commit in your pull request is meaningful.
* You may need to [rebase](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) to avoid merge conflicts.
6 changes: 3 additions & 3 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -9,6 +9,6 @@ are multiple supported versions at any given time.
## Reporting a Vulnerability

If you discover a security vulnerability within this package, please send an
email to Graham Campbell at graham@alt-three.com. All security vulnerabilities
will be promptly addressed. Please do not disclose security-related issues
publicly until a fix has been announced.
email to security@tidelift.com. All security vulnerabilities will be promptly
addressed. Please do not disclose security-related issues publicly until a fix
has been announced.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ jobs:

strategy:
matrix:
php: ['7.1', '7.2', '7.3', '7.4', '8.0']
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1']

steps:
- name: Checkout Code
@@ -43,7 +43,7 @@ jobs:

strategy:
matrix:
php: ['7.1', '7.2', '7.3', '7.4', '8.0']
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1']

steps:
- name: Checkout Code
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -98,6 +98,13 @@ $dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
$dotenv->load();
```

To suppress the exception that is thrown when there is no `.env` file, you can:

```php
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
$dotenv->safeLoad();
```

Optionally you can pass in a filename as the second parameter, if you would
like to use something other than `.env`:

@@ -337,7 +344,7 @@ their own values (or get any sensitive values from a project co-worker).

## Security

If you discover a security vulnerability within this package, please send an email to Graham Campbell at graham@alt-three.com. All security vulnerabilities will be promptly addressed. You may view our full security policy [here](https://github.com/vlucas/phpdotenv/security/policy).
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/vlucas/phpdotenv/security/policy).


## License
18 changes: 8 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
@@ -6,28 +6,26 @@
"authors": [
{
"name": "Graham Campbell",
"email": "graham@alt-three.com",
"homepage": "https://gjcampbell.co.uk/"
"email": "hello@gjcampbell.co.uk"
},
{
"name": "Vance Lucas",
"email": "vance@vancelucas.com",
"homepage": "https://vancelucas.com/"
"email": "vance@vancelucas.com"
}
],
"require": {
"php": "^7.1.3 || ^8.0",
"ext-pcre": "*",
"graham-campbell/result-type": "^1.0.1",
"phpoption/phpoption": "^1.7.4",
"symfony/polyfill-ctype": "^1.17",
"symfony/polyfill-mbstring": "^1.17",
"symfony/polyfill-php80": "^1.17"
"graham-campbell/result-type": "^1.0.2",
"phpoption/phpoption": "^1.8",
"symfony/polyfill-ctype": "^1.23",
"symfony/polyfill-mbstring": "^1.23.1",
"symfony/polyfill-php80": "^1.23.1"
},
"require-dev": {
"ext-filter": "*",
"bamarni/composer-bin-plugin": "^1.4.1",
"phpunit/phpunit": "^7.5.20 || ^8.5.14 || ^9.5.1"
"phpunit/phpunit": "^7.5.20 || ^8.5.21 || ^9.5.10"
},
"autoload": {
"psr-4": {
3 changes: 2 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -5,11 +5,12 @@
beStrictAboutOutputDuringTests="true"
bootstrap="vendor/autoload.php"
colors="true"
convertDeprecationsToExceptions="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
failOnRisky="true"
failOnWarning="true"
failOnWarning="false"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
6 changes: 4 additions & 2 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.3.1@2feba22a005a18bf31d4c7b9bdb9252c73897476">
<file src="src/Repository/RepositoryBuilder.php">
<files psalm-version="4.x-dev@">
<file src="src/Parser/EntryParser.php">
<InvalidArgument occurrences="1">
<code>flatMap</code>
</InvalidArgument>
</file>
<file src="src/Repository/RepositoryBuilder.php">
<InvalidStringClass occurrences="3">
<code>$adapter::create()</code>
<code>$reader::create()</code>
4 changes: 2 additions & 2 deletions tests/Dotenv/DotenvTest.php
Original file line number Diff line number Diff line change
@@ -100,7 +100,7 @@ public function testDotenvLoadsEnvironmentVars()
self::assertEmpty($_SERVER['NULL']);
}

public function testDotenvLoadsEnvironmentVarsMultipleNotShortCircuitMode()
public function testDotenvLoadsEnvironmentVarsMultipleWithShortCircuitMode()
{
$dotenv = Dotenv::createMutable(self::$folder, ['.env', 'example.env']);

@@ -110,7 +110,7 @@ public function testDotenvLoadsEnvironmentVarsMultipleNotShortCircuitMode()
);
}

public function testDotenvLoadsEnvironmentVarsMultipleWithShortCircuitMode()
public function testDotenvLoadsEnvironmentVarsMultipleWithoutShortCircuitMode()
{
$dotenv = Dotenv::createMutable(self::$folder, ['.env', 'example.env'], false);

7 changes: 4 additions & 3 deletions vendor-bin/phpstan/composer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"require": {
"phpstan/phpstan": "0.12.68",
"php": "^7.4",
"phpstan/phpstan": "0.12.99",
"phpstan/extension-installer": "1.1.0",
"phpstan/phpstan-deprecation-rules": "0.12.6",
"phpstan/phpstan-phpunit": "0.12.17",
"phpstan/phpstan-strict-rules": "0.12.9",
"phpstan/phpstan-phpunit": "0.12.22",
"phpstan/phpstan-strict-rules": "0.12.11",
"thecodingmachine/phpstan-strict-rules": "0.12.1"
},
"config": {
3 changes: 2 additions & 1 deletion vendor-bin/psalm/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"require": {
"psalm/phar": "4.3.1"
"php": "^7.4",
"psalm/phar": "4.10.0"
},
"config": {
"preferred-install": "dist"