Skip to content

Commit 17e6725

Browse files
authored
Fix implementations and adjust tests (#69)
1 parent f0a0e9a commit 17e6725

Some content is hidden

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

63 files changed

+2466
-3534
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,12 @@ jobs:
3737
- windows-latest
3838

3939
php:
40-
- 7.4
41-
- 8.0
42-
- 8.1
40+
- 8.3
41+
- 8.4
4342

4443
steps:
4544
- name: Checkout
46-
uses: actions/checkout@v2.3.4
45+
uses: actions/checkout@v5
4746

4847
- name: Install PHP
4948
uses: shivammathur/setup-php@v2
@@ -62,7 +61,7 @@ jobs:
6261
run: echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
6362

6463
- name: Cache dependencies installed with composer
65-
uses: actions/cache@v2
64+
uses: actions/cache@v4
6665
with:
6766
path: ${{ env.COMPOSER_CACHE_DIR }}
6867
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}

.github/workflows/mutation.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ on:
1818
- 'psalm.xml'
1919

2020
name: mutation test
21+
permissions:
22+
contents: read
2123

2224
jobs:
2325
mutation:
@@ -31,11 +33,11 @@ jobs:
3133
- ubuntu-latest
3234

3335
php:
34-
- 8.1
36+
- 8.3
3537

3638
steps:
3739
- name: Checkout
38-
uses: actions/checkout@v2.3.4
40+
uses: actions/checkout@v5
3941

4042
- name: Install PHP
4143
uses: shivammathur/setup-php@v2
@@ -49,21 +51,24 @@ jobs:
4951
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
5052

5153
- name: Cache dependencies installed with composer
52-
uses: actions/cache@v2
54+
uses: actions/cache@v4
5355
with:
5456
path: ${{ env.COMPOSER_CACHE_DIR }}
5557
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
5658
restore-keys: |
5759
php${{ matrix.php }}-composer-
5860
61+
- name: Validate composer configuration
62+
run: composer validate --no-check-publish
63+
5964
- name: Update composer
6065
run: composer self-update
6166

6267
- name: Install dependencies with composer
63-
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
68+
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
6469

6570
- name: Run infection
6671
run: |
67-
vendor/bin/roave-infection-static-analysis-plugin -j2 --ignore-msi-with-no-mutations --only-covered
72+
vendor/bin/roave-infection-static-analysis-plugin --threads=2 --ignore-msi-with-no-mutations --only-covered
6873
env:
69-
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
74+
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

.github/workflows/static.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ jobs:
3333
- ubuntu-latest
3434

3535
php:
36-
- 7.4
37-
- 8.0
38-
- 8.1
36+
- 8.2
37+
- 8.3
38+
- 8.4
3939

4040
steps:
4141
- name: Checkout
42-
uses: actions/checkout@v2.3.4
42+
uses: actions/checkout@v5
4343

4444
- name: Install PHP
4545
uses: shivammathur/setup-php@v2
@@ -52,7 +52,7 @@ jobs:
5252
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
5353

5454
- name: Cache dependencies installed with composer
55-
uses: actions/cache@v2
55+
uses: actions/cache@v4
5656
with:
5757
path: ${{ env.COMPOSER_CACHE_DIR }}
5858
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}

.styleci.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
preset: psr12
22
risky: true
33

4-
version: 8.1
4+
version: 8.3
55

66
finder:
77
exclude:
8-
- docs
9-
- vendor
8+
- "resources"
9+
- "vendor"
1010

1111
enabled:
1212
- alpha_ordered_traits
@@ -44,13 +44,6 @@ enabled:
4444
- no_useless_else
4545
- no_useless_return
4646
- normalize_index_brace
47-
- php_unit_dedicate_assert
48-
- php_unit_dedicate_assert_internal_type
49-
- php_unit_expectation
50-
- php_unit_mock
51-
- php_unit_mock_short_will_return
52-
- php_unit_namespaced
53-
- php_unit_no_expectation_annotation
5447
- phpdoc_no_empty_return
5548
- phpdoc_no_useless_inheritdoc
5649
- phpdoc_order
@@ -82,4 +75,4 @@ enabled:
8275
- union_type_without_spaces
8376

8477
disabled:
85-
- function_declaration
78+
- function_declaration

Makefile

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
.DEFAULT_GOAL := help
2+
3+
CLI_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
4+
$(eval $(CLI_ARGS):;@:)
5+
6+
PRIMARY_GOAL := $(firstword $(MAKECMDGOALS))
7+
8+
#
9+
# Targets
10+
#
11+
12+
ifeq ($(PRIMARY_GOAL),p)
13+
p: ## Run PHP Psalm
14+
php vendor/bin/psalm
15+
endif
16+
17+
ifeq ($(PRIMARY_GOAL),pf)
18+
pf: ## Run PHP Psalm on a specific file
19+
ifndef FILE
20+
$(error Please provide FILE, e.g. 'make pf FILE=src/Foo.php')
21+
endif
22+
php vendor/bin/psalm "$(FILE)"
23+
endif
24+
25+
ifeq ($(PRIMARY_GOAL),pc)
26+
pc: ## Clear Psalm's cache
27+
php vendor/bin/psalm --clear-cache
28+
endif
29+
30+
ifeq ($(PRIMARY_GOAL),pu)
31+
pu: ## Run PHPUnit tests
32+
php vendor/bin/phpunit
33+
endif
34+
35+
ifeq ($(PRIMARY_GOAL),ric)
36+
ric: ## Roave Infection Covered
37+
php vendor/bin/roave-infection-static-analysis-plugin --only-covered --min-msi=92
38+
endif
39+
40+
ifeq ($(PRIMARY_GOAL),riu)
41+
riu: ## Roave Infection Uncovered
42+
php vendor/bin/roave-infection-static-analysis-plugin --min-msi=92
43+
endif
44+
45+
ifeq ($(PRIMARY_GOAL),i)
46+
i: ## Infection Mutation Test
47+
php vendor/bin/infection
48+
endif
49+
50+
ifeq ($(PRIMARY_GOAL),co)
51+
co: ## Composer outdated
52+
composer outdated
53+
endif
54+
55+
ifeq ($(PRIMARY_GOAL),cwn)
56+
cwn: ## Composer why-not
57+
ifndef REPO
58+
$(error Please provide REPO, e.g. 'make cwn REPO=yiisoft/yii-demo VERSION=1.1.1')
59+
endif
60+
ifndef VERSION
61+
$(error Please provide VERSION, e.g. 'make cwn REPO=yiisoft/yii-demo VERSION=1.1.1')
62+
endif
63+
composer why-not $(REPO) $(VERSION)
64+
endif
65+
66+
ifeq ($(PRIMARY_GOAL),cu)
67+
cu: ## Composer update
68+
composer update
69+
endif
70+
71+
ifeq ($(PRIMARY_GOAL),cda)
72+
cda: ## Composer dump-autoload
73+
composer dump-autoload -o
74+
endif
75+
76+
ifeq ($(PRIMARY_GOAL),crc)
77+
crc: ## Composer require checker
78+
php vendor/bin/composer-require-checker
79+
endif
80+
81+
ifeq ($(PRIMARY_GOAL),rdr)
82+
rdr: ## Rector Dry Run (see changes)
83+
php vendor/bin/rector process --dry-run
84+
endif
85+
86+
ifeq ($(PRIMARY_GOAL),rmc)
87+
rmc: ## Rector (make changes)
88+
php vendor/bin/rector
89+
endif
90+
91+
#
92+
# Help
93+
#
94+
95+
ifeq ($(PRIMARY_GOAL),help)
96+
help: ## This help.
97+
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
98+
endif
99+
100+
.PHONY: menu p pf pc pu ric riu i co cwn cu cda crc rdr rmc help

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ consumers for the [Yii framework](https://www.yiiframework.com).
2525

2626
## Requirements
2727

28-
- PHP 7.4 or higher.
28+
- PHP 8.1 or higher.
2929

3030
## Installation
3131

@@ -60,4 +60,4 @@ Maintained by [Yii Software](https://www.yiiframework.com/).
6060
[![Twitter](https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555?style=flat)](https://twitter.com/yiiframework)
6161
[![Telegram](https://img.shields.io/badge/telegram-join-1DA1F2?style=flat&logo=telegram)](https://t.me/yii3en)
6262
[![Facebook](https://img.shields.io/badge/facebook-join-1DA1F2?style=flat&logo=facebook&logoColor=ffffff)](https://www.facebook.com/groups/yiitalk)
63-
[![Slack](https://img.shields.io/badge/slack-join-1DA1F2?style=flat&logo=slack)](https://yiiframework.com/go/slack)
63+
[![Slack](https://img.shields.io/badge/slack-join-1DA1F2?style=flat&logo=slack)](https://yiiframework.com/go/slack)

composer.json

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{
22
"name": "yiisoft/yii-auth-client",
3-
"description": "Yii Framework external authentication via OAuth and OpenID Extension",
3+
"description": "Yii Framework external authentication via OAuth",
44
"keywords": [
55
"yii",
66
"OAuth",
7-
"OpenID Connect",
87
"auth",
98
"api"
109
],
@@ -29,40 +28,46 @@
2928
}
3029
],
3130
"require": {
32-
"php": "^7.4|^8.0",
33-
"psr/http-client": "^1.0",
34-
"psr/http-factory": "^1.0",
31+
"php": "8.1 - 8.4",
32+
"phpseclib/phpseclib": ">=3.0.46",
33+
"psr/container": "^2.0.2",
34+
"psr/http-client": "^1.0.3",
35+
"psr/http-factory": "^1.1",
3536
"psr/http-factory-implementation": "1.0",
36-
"psr/http-message": "^1.0",
37+
"psr/http-message": "^2.0",
3738
"psr/http-message-implementation": "1.0",
38-
"psr/log-implementation": "^1.0",
39+
"psr/http-server-handler": "^1.0.2",
40+
"psr/http-server-middleware": "^1.0.2",
41+
"psr/log-implementation": "^2.0",
3942
"psr/simple-cache-implementation": "^1.0",
40-
"yiisoft/assets": "^4.0",
43+
"web-token/jwt-framework": ">=4.0.6",
44+
"yiisoft/aliases": "^3.1",
45+
"yiisoft/assets": "^5.1.1",
46+
"yiisoft/factory": "^1.3",
47+
"yiisoft/html": "^3.11",
48+
"yiisoft/http": "^1.2",
4149
"yiisoft/json": "^1.0",
42-
"yiisoft/session": "^2.0",
43-
"yiisoft/view": "^8.0",
44-
"yiisoft/widget": "^2.0"
50+
"yiisoft/router": "^4.0",
51+
"yiisoft/session": "^3.0",
52+
"yiisoft/view": "^12.2.1",
53+
"yiisoft/widget": "^2.2"
4554
},
4655
"require-dev": {
47-
"kriswallsmith/buzz": "^1.1",
48-
"nyholm/psr7": "^1.3",
49-
"phpunit/phpunit": "^9.5",
50-
"roave/infection-static-analysis-plugin": "^1.16",
51-
"spatie/phpunit-watcher": "^1.23",
52-
"vimeo/psalm": "^4.18",
53-
"yiisoft/cache": "^1.0",
54-
"yiisoft/di": "^1.0",
55-
"yiisoft/log": "^1.0",
56-
"yiisoft/router-fastroute": "^1.0",
57-
"yiisoft/psr-dummy-provider": "*"
58-
},
59-
"suggest": {
60-
"web-token/jwt-checker": "required for JWS, JWT or JWK related flows like OpenIDConnect",
61-
"web-token/jwt-key-mgmt": "required for JWS, JWT or JWK related flows like OpenIDConnect",
62-
"web-token/jwt-signature": "required for JWS, JWT or JWK related flows like OpenIDConnect",
63-
"web-token/jwt-signature-algorithm-hmac": "required for JWS, JWT or JWK related flows like OpenIDConnect",
64-
"web-token/jwt-signature-algorithm-ecdsa": "required for JWS, JWT or JWK related flows like OpenIDConnect",
65-
"web-token/jwt-signature-algorithm-rsa": "required for JWS, JWT or JWK related flows like OpenIDConnect"
56+
"ext-curl": "*",
57+
"maglnet/composer-require-checker": "^4.16.1",
58+
"kriswallsmith/buzz": "^1.3",
59+
"nyholm/psr7": "^1.8.2",
60+
"phpunit/phpunit": ">=11.5.9",
61+
"rector/rector": "^2.1.6",
62+
"roave/infection-static-analysis-plugin": ">=1.39",
63+
"spatie/phpunit-watcher": "^1.24",
64+
"styleci/cli": "^1.6.0",
65+
"vimeo/psalm": "^6.13.1",
66+
"yiisoft/cache": "^3.1",
67+
"yiisoft/di": "^1.4",
68+
"yiisoft/log": "^2.1.1",
69+
"yiisoft/router-fastroute": "^4.0.1",
70+
"yiisoft/psr-dummy-provider": "^1.0.2"
6671
},
6772
"repositories": [
6873
{
@@ -94,13 +99,14 @@
9499
},
95100
"config": {
96101
"sort-packages": true,
102+
"bump-after-update": true,
97103
"allow-plugins": {
98104
"infection/extension-installer": true,
99105
"composer/package-versions-deprecated": true
100106
}
101107
},
102108
"scripts": {
103-
"test": "phpunit --testdox --no-interaction",
109+
"test": "phpunit --stop-on-notice --display-phpunit-deprecations --testdox",
104110
"test-watch": "phpunit-watcher watch"
105111
}
106112
}

phpunit.xml.dist

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
22

3-
<phpunit bootstrap="./vendor/autoload.php"
4-
colors="true"
5-
verbose="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
stopOnFailure="false">
3+
<phpunit bootstrap="./vendor/autoload.php"
4+
colors="true"
5+
displayDetailsOnTestsThatTriggerDeprecations="true">
106

11-
<coverage>
7+
<source>
128
<include>
139
<directory>./src</directory>
1410
</include>
1511
<exclude>
1612
<directory>./tests</directory>
1713
<directory>./vendor</directory>
1814
</exclude>
19-
</coverage>
15+
</source>
2016

2117
<php>
2218
<ini name="error_reporting" value="-1"/>

0 commit comments

Comments
 (0)