Skip to content

Commit 7bd6eb7

Browse files
committed
Merge branch 'master' into annotations-autowiring-options
2 parents 59a2216 + 33eb419 commit 7bd6eb7

File tree

91 files changed

+1062
-549
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+1062
-549
lines changed

.coveralls.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

.gitattributes

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
# .gitattributes
2-
tests/ export-ignore
3-
website/ export-ignore
4-
doc/ export-ignore
5-
news/ export-ignore
2+
.github export-ignore
3+
tests export-ignore
4+
website export-ignore
5+
doc export-ignore
6+
news export-ignore
7+
.gitattributes export-ignore
8+
.gitignore export-ignore
9+
.gitstats.yml export-ignore
10+
.php_cs export-ignore
11+
.phpstorm.meta.php export-ignore
12+
404.md export-ignore
13+
CONTRIBUTING.md export-ignore
14+
couscous.yml export-ignore
15+
*.neon export-ignore
16+
phpunit.xml.dist export-ignore
17+
SECURITY.md export-ignore
618

719
# Auto detect text files and perform LF normalization
820
* text=auto

.github/FUNDING.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: mnapoli # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: "packagist/php-di/php-di"
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/pull_request_template.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<!--
2+
Please explain the motivation behind the changes.
3+
4+
In other words, explain **WHY** instead of **WHAT**.
5+
-->

.github/workflows/ci.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ['master']
6+
pull_request:
7+
branches: ['*']
8+
schedule:
9+
- cron: '0 0 * * *'
10+
11+
jobs:
12+
13+
tests:
14+
name: Tests - PHP ${{ matrix.php }} ${{ matrix.dependency-version }}
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 15
17+
strategy:
18+
matrix:
19+
php: [ '7.2', '7.3', '7.4', '8.0' ]
20+
dependency-version: [ '' ]
21+
include:
22+
- php: '7.2'
23+
dependency-version: '--prefer-lowest'
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v2
27+
- name: Setup PHP
28+
uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: ${{ matrix.php }}
31+
tools: composer:v1
32+
coverage: none
33+
- name: Cache Composer dependencies
34+
uses: actions/cache@v2
35+
with:
36+
path: ~/.composer/cache
37+
key: php-${{ matrix.php }}-composer-locked-${{ hashFiles('composer.lock') }}
38+
restore-keys: php-${{ matrix.php }}-composer-locked-
39+
- name: Install PHP dependencies
40+
if: matrix.php != '8.0'
41+
run: composer update ${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-progress --no-suggest
42+
- name: 'Install PHP dependencies on PHP 8 (TODO: remove that)'
43+
if: matrix.php == '8.0'
44+
run: |
45+
# Install Composer 2
46+
composer self-update --snapshot
47+
composer update --ignore-platform-reqs ${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-progress --no-suggest
48+
- name: PHPUnit
49+
run: vendor/bin/phpunit
50+
51+
cs:
52+
name: Coding standards
53+
runs-on: ubuntu-latest
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@v2
57+
- name: Setup PHP
58+
uses: shivammathur/setup-php@v2
59+
with:
60+
php-version: 7.4
61+
tools: composer, cs2pr
62+
coverage: none
63+
- name: Cache Composer dependencies
64+
uses: actions/cache@v2
65+
with:
66+
path: ~/.composer/cache
67+
key: php-composer-locked-${{ hashFiles('composer.lock') }}
68+
restore-keys: php-composer-locked-
69+
- name: Install PHP dependencies
70+
run: composer install --no-interaction --no-progress --no-suggest
71+
- name: PHP CS Fixer
72+
run: vendor/bin/php-cs-fixer fix --dry-run --format=checkstyle | cs2pr
73+
74+
phpstan:
75+
name: PHPStan
76+
runs-on: ubuntu-latest
77+
steps:
78+
- name: Checkout
79+
uses: actions/checkout@v2
80+
- name: Setup PHP
81+
uses: shivammathur/setup-php@v2
82+
with:
83+
php-version: 7.4
84+
tools: composer, cs2pr
85+
coverage: none
86+
- name: Cache Composer dependencies
87+
uses: actions/cache@v2
88+
with:
89+
path: ~/.composer/cache
90+
key: php-composer-locked-${{ hashFiles('composer.lock') }}
91+
restore-keys: php-composer-locked-
92+
- name: Install PHP dependencies
93+
run: composer install --no-interaction --no-progress --no-suggest
94+
- name: PHPStan
95+
run: vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
/website/css/all.min.css
99
/logo/
1010
/.php_cs.cache
11+
/.phpunit.result.cache

.php_cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?php
22

33
$finder = PhpCsFixer\Finder::create()
4-
->in(__DIR__ . '/src');
4+
->in(__DIR__ . '/src')
5+
->notPath('Compiler/Template.php');
56

67
return PhpCsFixer\Config::create()
78
->setRules([
@@ -46,6 +47,7 @@ return PhpCsFixer\Config::create()
4647
'strict_param' => true,
4748
'yoda_style' => false,
4849
'native_function_invocation' => false,
50+
'single_line_throw' => false,
4951
])
5052
->setRiskyAllowed(true)
5153
->setFinder($finder);

.styleci.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Contributing
22

3-
[![Build Status](https://travis-ci.org/PHP-DI/PHP-DI.png?branch=master)](https://travis-ci.org/PHP-DI/PHP-DI) [![Coverage Status](https://coveralls.io/repos/PHP-DI/PHP-DI/badge.png?branch=master)](https://coveralls.io/r/PHP-DI/PHP-DI?branch=master)
4-
53
PHP-DI is licensed under the MIT License.
64

75

@@ -39,7 +37,6 @@ Read the [How it works](doc/how-it-works.md) documentation.
3937

4038
## What to do?
4139

42-
- Add tests: pick up uncovered situations in the [code coverage report](https://coveralls.io/r/PHP-DI/PHP-DI)
4340
- Resolve issues: [issue list](https://github.com/PHP-DI/PHP-DI/issues)
4441
- Improve the documentation
4542
-

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
PHP-DI - PHP Dependency Injection
1+
The MIT License (MIT)
22

3-
Copyright (C) Matthieu Napoli
3+
Copyright (c) Matthieu Napoli
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
66
associated documentation files (the "Software"), to deal in the Software without restriction,

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22
layout: home
33
---
44

5-
[![](doc/img.png)](http://php-di.org/)
5+
[![](doc/img.png)](https://php-di.org/)
66

7-
[![Build Status](https://img.shields.io/travis/PHP-DI/PHP-DI/master.svg?style=flat-square)](https://travis-ci.org/PHP-DI/PHP-DI)
8-
[![Coverage Status](https://img.shields.io/coveralls/PHP-DI/PHP-DI/master.svg?style=flat-square)](https://coveralls.io/r/PHP-DI/PHP-DI?branch=master)
97
[![Downloads per months](https://img.shields.io/packagist/dm/PHP-DI/PHP-DI.svg?style=flat-square)](https://packagist.org/packages/PHP-DI/PHP-DI)
108
[![Total downloads](https://img.shields.io/packagist/dt/PHP-DI/PHP-DI.svg?style=flat-square)](https://packagist.org/packages/PHP-DI/PHP-DI)
119

12-
[![PrettyCI Status](https://hc4rcprbe1.execute-api.eu-west-1.amazonaws.com/dev?name=php-di/php-di)](https://prettyci.com/)
13-
1410
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/PHP-DI/PHP-DI.svg)](http://isitmaintained.com/project/PHP-DI/PHP-DI "Average time to resolve an issue")
1511
[![Percentage of issues still open](http://isitmaintained.com/badge/open/PHP-DI/PHP-DI.svg)](http://isitmaintained.com/project/PHP-DI/PHP-DI "Percentage of issues still open")
1612

1713
PHP-DI is a dependency injection container meant to be practical, powerful, and framework-agnostic.
1814

19-
Read more on the website: **[php-di.org](http://php-di.org)**
15+
Read more on the website: **[php-di.org](https://php-di.org)**
2016

2117
Get community support in the Gitter chat room: [![Gitter chat](https://badges.gitter.im/PHP-DI/PHP-DI.png)](https://gitter.im/PHP-DI/PHP-DI)
18+
19+
## For Enterprise
20+
21+
*Available as part of the Tidelift Subscription*
22+
23+
The maintainers of php-di/php-di 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-php-di-php-di?utm_source=packagist-php-di-php-di&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)

SECURITY.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
Only the latest stable release is supported.
6+
7+
## Reporting a Vulnerability
8+
9+
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security).
10+
11+
Tidelift will coordinate the fix and disclosure.

change-log.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Improvements:
2828
- [#487](https://github.com/PHP-DI/PHP-DI/issues/487) Closures in the config are now always interpreted as factories, even when nested inside other definitions
2929
- [#242](https://github.com/PHP-DI/PHP-DI/issues/242) Error in case a definition is not indexed by a string
3030
- [#505](https://github.com/PHP-DI/PHP-DI/pull/505) Debug container entries
31-
- [#564](https://github.com/PHP-DI/PHP-DI/pull/564) Caching was made almost entirely obsolete by the container compilation, however there is still a caching system entirely rebuilt over APCu for covering the last cases that compilation could not address (see [php-di.org/doc/performances.html](http://php-di.org/doc/performances.html))
31+
- [#564](https://github.com/PHP-DI/PHP-DI/pull/564) Caching was made almost entirely obsolete by the container compilation, however there is still a caching system entirely rebuilt over APCu for covering the last cases that compilation could not address (see [php-di.org/doc/performances.html](https://php-di.org/doc/performances.html))
3232

3333
Fixes:
3434

@@ -95,7 +95,7 @@ New features:
9595
->parameter('host', DI\get('db.host')),
9696
];
9797
```
98-
Read the [factories documentation](http://php-di.org/doc/php-definitions.html#factories) to learn more. Feature implemented by [@predakanga](https://github.com/predakanga).
98+
Read the [factories documentation](https://php-di.org/doc/php-definitions.html#factories) to learn more. Feature implemented by [@predakanga](https://github.com/predakanga).
9999

100100
Improvements:
101101

@@ -263,7 +263,7 @@ BC-breaks: None.
263263
* [#138](https://github.com/PHP-DI/PHP-DI/issues/138) [Container-interop](https://github.com/container-interop/container-interop) compliance
264264
* [#143](https://github.com/PHP-DI/PHP-DI/issues/143) Much more explicit exception messages
265265
* [#157](https://github.com/PHP-DI/PHP-DI/issues/157) HHVM support
266-
* [#158](https://github.com/PHP-DI/PHP-DI/issues/158) Improved the documentation for [Symfony 2 integration](http://php-di.org/doc/frameworks/symfony2.html)
266+
* [#158](https://github.com/PHP-DI/PHP-DI/issues/158) Improved the documentation for [Symfony 2 integration](https://php-di.org/doc/frameworks/symfony2.html)
267267

268268
## 4.0
269269

composer.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "library",
44
"description": "The dependency injection container for humans",
55
"keywords": ["di", "dependency injection", "container", "ioc", "psr-11", "psr11", "container-interop"],
6-
"homepage": "http://php-di.org/",
6+
"homepage": "https://php-di.org/",
77
"license": "MIT",
88
"autoload": {
99
"psr-4": {
@@ -22,23 +22,22 @@
2222
"scripts": {
2323
"test": "phpunit",
2424
"format-code": "php-cs-fixer fix --allow-risky=yes",
25-
"phpstan": "phpstan analyse -l 6 -c phpstan.neon src"
25+
"phpstan": "phpstan analyse -l 5 -c phpstan.neon src"
2626
},
2727
"require": {
28-
"php": ">=7.0.0",
28+
"php": ">=7.2.0",
2929
"psr/container": "^1.0",
3030
"php-di/invoker": "^2.0",
3131
"php-di/phpdoc-reader": "^2.0.1",
32-
"jeremeamia/superclosure": "^2.0",
33-
"nikic/php-parser": "^2.0|^3.0|^4.0"
32+
"opis/closure": "^3.5.5"
3433
},
3534
"require-dev": {
36-
"phpunit/phpunit": "~6.4",
37-
"mnapoli/phpunit-easymock": "~1.0",
35+
"phpunit/phpunit": "^8.5|^9.0",
36+
"mnapoli/phpunit-easymock": "^1.2",
3837
"doctrine/annotations": "~1.2",
3938
"ocramius/proxy-manager": "~2.0.2",
4039
"friendsofphp/php-cs-fixer": "^2.4",
41-
"phpstan/phpstan": "^0.9.2"
40+
"phpstan/phpstan": "^0.12"
4241
},
4342
"provide": {
4443
"psr/container-implementation": "^1.0"

couscous.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
baseUrl: http://php-di.org
1+
baseUrl: https://php-di.org
22

33
scripts:
44
before:

doc/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ title: Documentation index
4444

4545
* [Migration from PHP-DI 3.x to 4.0](migration/4.0.md)
4646
* [Migration from PHP-DI 4.x to 5.0](migration/5.0.md)
47+
* [Migration from PHP-DI 5.x to 6.0](migration/6.0.md)
4748

4849
### Internals
4950

doc/container-configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,18 @@ of Symfony's container entries.
6262
Example with Acclimate:
6363

6464
```php
65-
$container = new CompositeContainer();
65+
$container = new Acclimate\Container\CompositeContainer();
6666

6767
// Add Symfony's container
6868
$container->addContainer($acclimate->adaptContainer($symfonyContainer));
6969

7070
// Configure PHP-DI container
71-
$builder = new ContainerBuilder();
71+
$builder = new \DI\ContainerBuilder();
7272
$builder->wrapContainer($container);
7373

7474
// Add PHP-DI container
7575
$phpdiContainer = $builder->build();
76-
$container->addContainer($acclimate->adaptContainer($phpdiContainer));
76+
$container->addContainer($phpdiContainer);
7777

7878
// Good to go!
7979
$foo = $container->get('foo');

0 commit comments

Comments
 (0)