Skip to content

Commit be9e951

Browse files
authored
Remove psr/container and add psr/event-dispatcher dependency (#167)
1 parent 08f240f commit be9e951

File tree

5 files changed

+83
-7
lines changed

5 files changed

+83
-7
lines changed

.github/workflows/dependency.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
on:
2+
pull_request:
3+
paths-ignore:
4+
- 'docs/**'
5+
- 'README.md'
6+
- 'CHANGELOG.md'
7+
- '.gitignore'
8+
- '.gitattributes'
9+
- 'infection.json.dist'
10+
- 'phpunit.xml.dist'
11+
- 'psalm.xml'
12+
13+
push:
14+
paths-ignore:
15+
- 'docs/**'
16+
- 'README.md'
17+
- 'CHANGELOG.md'
18+
- '.gitignore'
19+
- '.gitattributes'
20+
- 'infection.json.dist'
21+
- 'phpunit.xml.dist'
22+
- 'psalm.xml'
23+
24+
name: dependency checker
25+
26+
jobs:
27+
mutation:
28+
name: PHP ${{ matrix.php }}-${{ matrix.os }}
29+
30+
runs-on: ${{ matrix.os }}
31+
32+
strategy:
33+
matrix:
34+
os:
35+
- ubuntu-latest
36+
37+
php:
38+
- 8.1
39+
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v3
43+
44+
- name: Install PHP
45+
uses: shivammathur/setup-php@v2
46+
with:
47+
php-version: ${{ matrix.php }}
48+
tools: composer:v2, cs2pr
49+
coverage: none
50+
51+
- name: Determine composer cache directory
52+
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
53+
54+
- name: Cache dependencies installed with composer
55+
uses: actions/cache@v3
56+
with:
57+
path: ${{ env.COMPOSER_CACHE_DIR }}
58+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
59+
restore-keys: |
60+
php${{ matrix.php }}-composer-
61+
- name: Update composer
62+
run: composer self-update
63+
64+
- name: Install dependencies with composer
65+
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
66+
67+
- name: Check dependency
68+
run: vendor/bin/composer-require-checker

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
## 1.1.0 under development
44

55
- Enh #163: Allow multiple separate hosts with new `Route::hosts()` method (@Gerych1984)
6+
- Chg #167: Move `psr/container` dependency to dev requirements (@vjik)
7+
- Chg #167: Add `psr/event-dispatcher` dependency (@vjik)
68
- Enh #168: Allow multiple separate hosts with new `Group::hosts()` method (@rustamwin)
79

810
## 1.0.0 December 30, 2021

composer.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"require": {
2121
"php": "^7.4|^8.0",
22-
"psr/container": "^1.0",
22+
"psr/event-dispatcher": "^1.0",
2323
"psr/http-factory": "^1.0",
2424
"psr/http-message": "^1.0",
2525
"psr/http-server-handler": "^1.0",
@@ -29,15 +29,16 @@
2929
"yiisoft/router-implementation": "1.0.0"
3030
},
3131
"require-dev": {
32-
"nyholm/psr7": "^1.3",
32+
"maglnet/composer-require-checker": "^3.8",
33+
"nyholm/psr7": "^1.5",
3334
"phpunit/phpunit": "^9.5",
34-
"psr/event-dispatcher": "^1.0",
35-
"roave/infection-static-analysis-plugin": "^1.16",
35+
"psr/container": "^1.1|^2.0",
36+
"roave/infection-static-analysis-plugin": "^1.18",
3637
"spatie/phpunit-watcher": "^1.23",
37-
"vimeo/psalm": "^4.18",
38+
"vimeo/psalm": "^4.23",
3839
"yiisoft/di": "^1.0",
3940
"yiisoft/dummy-provider": "^1.0.0",
40-
"yiisoft/test-support": "^1.3"
41+
"yiisoft/test-support": "^1.4"
4142
},
4243
"autoload": {
4344
"psr-4": {

dependency-checker.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"scan-files": [
3+
"src/*.php"
4+
]
5+
}

tests/Support/Container.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function get($id)
2424
throw new NotFoundException("$id was not found in container");
2525
}
2626

27-
public function has($id)
27+
public function has(string $id): bool
2828
{
2929
return array_key_exists($id, $this->instances);
3030
}

0 commit comments

Comments
 (0)