Skip to content

Commit dc2c71d

Browse files
authored
Applying Yii2 coding standards
2 parents 641fd63 + 174aaa1 commit dc2c71d

Some content is hidden

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

78 files changed

+2738
-304
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ trim_trailing_whitespace = true
1212

1313
[*.md]
1414
trim_trailing_whitespace = false
15+
16+
[*.yml]
17+
indent_size = 2

.gitattributes

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# Ignore all test and documentation for archive
2-
/.editorconfig export-ignore
3-
/.github export-ignore
4-
/.gitattributes export-ignore
5-
/.gitignore export-ignore
6-
/.scrutinizer.yml export-ignore
7-
/.travis.yml export-ignore
8-
/phpunit.xml.dist export-ignore
2+
.* export-ignore
3+
*.dist export-ignore
4+
*.neon export-ignore
5+
*.yml export-ignore
96
/tests export-ignore
107
/docs export-ignore
8+
/Makefile export-ignore

.github/ISSUE_TEMPLATE.md

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

.github/PULL_REQUEST_TEMPLATE.md

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

.github/workflows/build.yml

Lines changed: 19 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,25 @@
11
name: build
22

3-
on: [push, pull_request]
3+
on:
4+
pull_request: &ignore-paths
5+
paths-ignore:
6+
- 'docs/**'
7+
- '.github/CONTRIBUTING.md'
8+
- '.github/FUNDING.yml'
9+
- '.github/SECURITY.md'
10+
- 'README.md'
11+
- 'CHANGELOG.md'
12+
- 'LICENSE.md'
13+
- '.gitignore'
14+
- '.gitattributes'
15+
- '.editorconfig'
16+
- 'docker-compose.yml'
17+
- 'Makefile'
418

5-
env:
6-
DEFAULT_COMPOSER_FLAGS: "--prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi"
19+
push: *ignore-paths
720

821
jobs:
922
phpunit:
10-
name: PHP ${{ matrix.php }} on ${{ matrix.os }}
11-
runs-on: ${{ matrix.os }}
12-
strategy:
13-
fail-fast: false
14-
matrix:
15-
os: [ubuntu-latest]
16-
php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
17-
18-
steps:
19-
- name: Checkout
20-
uses: actions/checkout@v5
21-
- name: Install PHP
22-
uses: shivammathur/setup-php@v2
23-
with:
24-
php-version: ${{ matrix.php }}
25-
- name: Get composer cache directory
26-
id: composer-cache
27-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
28-
- name: Cache composer dependencies
29-
uses: actions/cache@v4
30-
with:
31-
path: ${{ steps.composer-cache.outputs.dir }}
32-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
33-
restore-keys: ${{ runner.os }}-composer-
34-
- name: Install dependencies
35-
run: composer update $DEFAULT_COMPOSER_FLAGS
36-
- name: Run unit tests with coverage
37-
run: vendor/bin/phpunit --verbose --coverage-clover=coverage.clover --colors=always
38-
if: matrix.php == '7.1'
39-
- name: Run unit tests without coverage
40-
run: vendor/bin/phpunit --verbose --colors=always
41-
if: matrix.php != '7.1'
42-
- name: Upload code coverage
43-
run: |
44-
wget https://scrutinizer-ci.com/ocular.phar
45-
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
46-
if: matrix.php == '7.1'
47-
continue-on-error: true # if is fork
23+
uses: yiisoft/yii2-actions/.github/workflows/phpunit.yml@master
24+
secrets:
25+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/linter.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: linter
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request: &ignore-paths
8+
paths-ignore:
9+
- 'docs/**'
10+
- '.github/CONTRIBUTING.md'
11+
- '.github/FUNDING.yml'
12+
- '.github/SECURITY.md'
13+
- 'README.md'
14+
- 'CHANGELOG.md'
15+
- 'LICENSE.md'
16+
- '.gitignore'
17+
- '.gitattributes'
18+
- '.editorconfig'
19+
- 'docker-compose.yml'
20+
- 'Makefile'
21+
22+
push: *ignore-paths
23+
24+
jobs:
25+
phpcs:
26+
uses: yiisoft/yii2-actions/.github/workflows/linter.yml@master
27+
with:
28+
directories: src/ tests/

.github/workflows/static.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: static analysis
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request: &ignore-paths
8+
paths-ignore:
9+
- 'docs/**'
10+
- '.github/CONTRIBUTING.md'
11+
- '.github/FUNDING.yml'
12+
- '.github/SECURITY.md'
13+
- 'README.md'
14+
- 'CHANGELOG.md'
15+
- 'LICENSE.md'
16+
- '.gitignore'
17+
- '.gitattributes'
18+
- '.editorconfig'
19+
- 'docker-compose.yml'
20+
- 'Makefile'
21+
22+
push: *ignore-paths
23+
24+
jobs:
25+
phpstan:
26+
uses: yiisoft/yii2-actions/.github/workflows/phpstan.yml@master

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ composer.phar
2626
phpunit.phar
2727
# local phpunit config
2828
/phpunit.xml
29+
.phpunit.result.cache
2930

3031
# local tests configuration
3132
/tests/data/config.local.php

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
Yii Framework 2 authclient extension Change Log
22
===============================================
33

4-
2.2.18 under development
4+
3.0.0 under development
55
------------------------
66

77
- Enh #398: Updated VKontakte client to use `vk.ru` domains instead of `vk.com` (DMITRII1548)
88
- Bug #396: Fix `BaseOAuth::refreshAccessToken()` when no refresh token exists (kalmer)
99
- Bug #393: Fix type for `BaseOAuth::$accessToken` (mspirkov)
10+
- Enh #403: Applying Yii2 coding standards (@s1lver)
11+
- Enh #403: Raise min version to PHP 7.4 (@s1lver)
12+
- Bug #401: Explicit null in `InvalidResponseException` constructor (@cyansoftdev)
1013

1114
2.2.17 February 13, 2025
1215
------------------------

Makefile

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
1+
help: ## Display help information.
2+
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
13

2-
# default versions to test against
3-
# these can be overridden by setting the environment variables in the shell
4-
PHP_VERSION=php-5.6.8
5-
YII_VERSION=dev-master
4+
start: ## Start services
5+
docker compose up -d
66

7-
# ensure all the configuration variables above are in environment of the shell commands below
8-
export
7+
test: ## Run tests. Params: {{ v=8.1 }}.
8+
PHP_VERSION=$(filter-out $@,$(v)) docker compose build --pull yii2-authclient-php
9+
PHP_VERSION=$(filter-out $@,$(v)) docker compose up -d
10+
PHP_VERSION=$(filter-out $@,$(v)) docker compose exec yii2-authclient-php sh -c "php -v && composer update && vendor/bin/phpunit --coverage-clover=coverage.xml"
11+
make down
912

10-
help:
11-
@echo "make test - run phpunit tests using a docker environment"
12-
# @echo "make clean - stop docker and remove container"
13+
build: ## Build an image from a docker-compose file. Params: {{ v=8.1 }}.
14+
PHP_VERSION=$(filter-out $@,$(v)) docker compose up -d --build
1315

14-
test: docker-php
15-
composer require "yiisoft/yii2:${YII_VERSION}" --prefer-dist --ignore-platform-reqs
16-
composer install --prefer-dist --ignore-platform-reqs
17-
docker run --rm=true -v $(shell pwd):/opt/test yiitest/php:${PHP_VERSION} phpunit --verbose --color
16+
down: ## Stop and remove containers, networks
17+
docker compose down
1818

19-
docker-php: dockerfiles
20-
cd tests/docker/php && sh build.sh
21-
22-
dockerfiles:
23-
test -d tests/docker || git clone https://github.com/cebe/jenkins-test-docker tests/docker
24-
cd tests/docker && git checkout -- . && git pull
25-
mkdir -p tests/dockerids
19+
sh: ## Enter the container with the application
20+
docker exec -it yii2-authclient-php-1 bash
2621

22+
static-analysis: ## Run code static analyze. Params: {{ v=8.1 }}.
23+
make build v=$(filter-out $@,$(v))
24+
PHP_VERSION=$(filter-out $@,$(v)) docker compose exec yii2-authclient-php sh -c "php -v && composer update && vendor/bin/phpstan analyse --memory-limit 512M"
25+
make down

0 commit comments

Comments
 (0)