Skip to content

Commit 7648219

Browse files
committed
1 parent f7bb3ce commit 7648219

File tree

13 files changed

+281
-142
lines changed

13 files changed

+281
-142
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ko_fi: codemasher

.github/workflows/tests.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
# https://github.com/localheinz/php-library-template/blob/master/.github/workflows/continuous-integration.yml
3+
# https://github.com/sebastianbergmann/phpunit/blob/master/.github/workflows/ci.yml
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- master
10+
tags:
11+
- "**"
12+
13+
name: "CI"
14+
15+
jobs:
16+
17+
tests:
18+
name: "Unit Tests"
19+
runs-on: ubuntu-latest
20+
21+
strategy:
22+
matrix:
23+
php-binary:
24+
- php7.4
25+
26+
dependencies:
27+
- lowest
28+
- highest
29+
30+
steps:
31+
- name: "Checkout"
32+
uses: actions/checkout@v2
33+
34+
- name: "Install lowest dependencies with composer"
35+
if: matrix.dependencies == 'lowest'
36+
run: ${{ matrix.php-binary }} $(which composer) update --no-interaction --no-progress --no-suggest --prefer-lowest
37+
38+
- name: "Install highest dependencies with composer"
39+
if: matrix.dependencies == 'highest'
40+
run: ${{ matrix.php-binary }} $(which composer) update --no-interaction --no-progress --no-suggest
41+
42+
- name: "Run unit tests with phpunit"
43+
run: ${{ matrix.php-binary }} vendor/bin/phpunit --configuration=phpunit.xml --no-coverage

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
.idea
2-
.vendor
1+
/.build
2+
/.idea
3+
/vendor
34
composer.lock

.phan/config.php

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
/**
3+
* This configuration will be read and overlaid on top of the
4+
* default configuration. Command-line arguments will be applied
5+
* after this file is read.
6+
*/
7+
return [
8+
// Supported values: `'5.6'`, `'7.0'`, `'7.1'`, `'7.2'`, `'7.3'`,
9+
// `'7.4'`, `null`.
10+
// If this is set to `null`,
11+
// then Phan assumes the PHP version which is closest to the minor version
12+
// of the php executable used to execute Phan.
13+
//
14+
// Note that the **only** effect of choosing `'5.6'` is to infer
15+
// that functions removed in php 7.0 exist.
16+
// (See `backward_compatibility_checks` for additional options)
17+
'target_php_version' => '7.4',
18+
19+
// A list of directories that should be parsed for class and
20+
// method information. After excluding the directories
21+
// defined in exclude_analysis_directory_list, the remaining
22+
// files will be statically analyzed for errors.
23+
//
24+
// Thus, both first-party and third-party code being used by
25+
// your application should be included in this list.
26+
'directory_list' => [
27+
'src',
28+
'tests',
29+
'vendor',
30+
],
31+
32+
// A regex used to match every file name that you want to
33+
// exclude from parsing. Actual value will exclude every
34+
// "test", "tests", "Test" and "Tests" folders found in
35+
// "vendor/" directory.
36+
'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@',
37+
38+
// A directory list that defines files that will be excluded
39+
// from static analysis, but whose class and method
40+
// information should be included.
41+
//
42+
// Generally, you'll want to include the directories for
43+
// third-party code (such as "vendor/") in this list.
44+
//
45+
// n.b.: If you'd like to parse but not analyze 3rd
46+
// party code, directories containing that code
47+
// should be added to both the `directory_list`
48+
// and `exclude_analysis_directory_list` arrays.
49+
'exclude_analysis_directory_list' => [
50+
'vendor',
51+
],
52+
];

.scrutinizer.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
build:
2+
nodes:
3+
analysis:
4+
tests:
5+
override:
6+
- php-scrutinizer-run
7+
18
filter:
29
excluded_paths:
310
- examples/*

.travis.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
language: php
22

3+
env:
4+
global:
5+
- PHAN_ALLOW_XDEBUG=0 PHAN_DISABLE_XDEBUG_WARN=1
6+
37
matrix:
48
include:
5-
- php: 7.2
6-
- php: nightly
7-
allow_failures:
8-
- php: nightly
9+
- php: 7.4
10+
11+
before_install:
12+
- pecl channel-update pecl.php.net
13+
- pecl install ast
14+
15+
install:
16+
- composer install --no-interaction --prefer-source
17+
- composer validate
18+
19+
script:
20+
- vendor/bin/phpunit --configuration phpunit.xml --coverage-clover clover.xml
21+
- vendor/bin/phan
922

10-
before_script: travis_retry composer install --no-interaction --prefer-source
11-
script: vendor/bin/phpunit --configuration phpunit.xml --coverage-clover clover.xml
1223
after_script: bash <(curl -s https://codecov.io/bash)

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Loads contents from a `.env` file into the environment (similar to [vlucas/phpdo
1010
[![Packagist downloads][downloads-badge]][downloads]
1111
[![PayPal donate][donate-badge]][donate]
1212

13+
[![CI][gh-action-badge]][gh-action]
14+
1315
[packagist-badge]: https://img.shields.io/packagist/v/chillerlan/php-dotenv.svg?style=flat-square
1416
[packagist]: https://packagist.org/packages/chillerlan/php-dotenv
1517
[license-badge]: https://img.shields.io/github/license/chillerlan/php-dotenv.svg?style=flat-square
@@ -24,27 +26,26 @@ Loads contents from a `.env` file into the environment (similar to [vlucas/phpdo
2426
[downloads]: https://packagist.org/packages/chillerlan/php-dotenv/stats
2527
[donate-badge]: https://img.shields.io/badge/donate-paypal-ff33aa.svg?style=flat-square
2628
[donate]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WLYUNAT9ZTJZ4
29+
[gh-action-badge]: https://github.com/chillerlan/php-dotenv/workflows/CI/badge.svg
30+
[gh-action]: https://github.com/chillerlan/php-dotenv/actions?query=workflow%3A%22CI%22
2731

2832
# Documentation
2933

3034
## Installation
3135
**requires [composer](https://getcomposer.org)**
3236

33-
*composer.json* (note: replace `dev-master` with a version boundary)
37+
*composer.json* (note: replace `dev-master` with a [version constraint](https://getcomposer.org/doc/articles/versions.md#writing-version-constraints))
38+
3439
```json
3540
{
3641
"require": {
37-
"php": "^7.2",
38-
"chillerlan/php-dotenv": "^1.0"
42+
"php": "^7.4",
43+
"chillerlan/php-dotenv": "dev-master"
3944
}
4045
}
4146
```
4247

43-
### Manual installation
44-
Download the desired version of the package from [master](https://github.com/chillerlan/php-dotenv/archive/master.zip) or
45-
[release](https://github.com/chillerlan/php-dotenv/releases) and extract the contents to your project folder. After that:
46-
- run `composer install` to install the required dependencies and generate `/vendor/autoload.php`.
47-
- if you use a custom autoloader, point the namespace `chillerlan\DotEnv` to the folder `src` of the package
48+
Installation via terminal: `composer require chillerlan/php-dotenv`
4849

4950
Profit!
5051

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "chillerlan/php-dotenv",
3-
"description": "A simple .env loader - PHP 7.2+",
3+
"description": "A simple .env loader - PHP 7.4+",
44
"homepage": "https://github.com/chillerlan/php-dotenv",
55
"license": "MIT",
66
"type": "library",
@@ -20,10 +20,11 @@
2020
"source": "https://github.com/chillerlan/php-dotenv"
2121
},
2222
"require": {
23-
"php": "^7.2"
23+
"php": "^7.4"
2424
},
2525
"require-dev": {
26-
"phpunit/phpunit": "^7.3"
26+
"phan/phan": "^2.7",
27+
"phpunit/phpunit": "^9.1"
2728
},
2829
"autoload": {
2930
"psr-4": {

phpunit.xml

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
4-
bootstrap="vendor/autoload.php"
5-
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
processIsolation="false"
10-
stopOnFailure="false"
1+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
3+
bootstrap="vendor/autoload.php"
4+
cacheResultFile=".build/phpunit.result.cache"
5+
colors="true"
6+
verbose="true"
117
>
12-
<filter>
13-
<whitelist processUncoveredFilesFromWhitelist="true">
14-
<directory suffix=".php">./src</directory>
15-
</whitelist>
16-
</filter>
17-
<testsuites>
18-
<testsuite name="php-dotenv test suite">
19-
<directory suffix=".php">./tests/</directory>
20-
</testsuite>
21-
</testsuites>
8+
<filter>
9+
<whitelist processUncoveredFilesFromWhitelist="true">
10+
<directory suffix=".php">./src</directory>
11+
</whitelist>
12+
</filter>
13+
<testsuites>
14+
<testsuite name="php-dotenv test suite">
15+
<directory suffix=".php">./tests/</directory>
16+
</testsuite>
17+
</testsuites>
18+
<logging>
19+
<log type="coverage-clover" target=".build/coverage/clover.xml"/>
20+
<log type="coverage-xml" target=".build/coverage/coverage-xml"/>
21+
<log type="junit" target=".build/logs/junit.xml"/>
22+
</logging>
2223
</phpunit>

0 commit comments

Comments
 (0)