-
-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
503 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,6 @@ trim_trailing_whitespace = true | |
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.{yml,yaml}] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Psalm | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
paths: | ||
- '**.php' | ||
- 'composer.*' | ||
- 'psalm*' | ||
- '.github/workflows/psalm.yml' | ||
push: | ||
branches: | ||
- develop | ||
paths: | ||
- '**.php' | ||
- 'composer.*' | ||
- 'psalm*' | ||
- '.github/workflows/psalm.yml' | ||
|
||
jobs: | ||
build: | ||
name: Psalm Analysis | ||
runs-on: ubuntu-latest | ||
if: "!contains(github.event.head_commit.message, '[ci skip]')" | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.0' | ||
tools: phpstan, phpunit | ||
extensions: intl, json, mbstring, xml | ||
coverage: none | ||
env: | ||
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache composer dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Create Psalm cache directory | ||
run: mkdir -p build/psalm | ||
|
||
- name: Cache Psalm results | ||
uses: actions/cache@v3 | ||
with: | ||
path: build/psalm | ||
key: ${{ runner.os }}-psalm-${{ github.sha }} | ||
restore-keys: ${{ runner.os }}-psalm- | ||
|
||
- name: Install dependencies | ||
run: | | ||
if [ -f composer.lock ]; then | ||
composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader | ||
else | ||
composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader | ||
fi | ||
- name: Run Psalm analysis | ||
run: vendor/bin/psalm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,73 @@ | ||
{ | ||
"name": "myth/auth", | ||
"type": "library", | ||
"description": "Flexible authentication/authorization system for CodeIgniter 4.", | ||
"keywords": [ | ||
"codeigniter", | ||
"authentication", | ||
"authorization" | ||
], | ||
"homepage": "https://github.com/lonnieezell/myth-auth", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Lonnie Ezell", | ||
"email": "lonnieje@gmail.com", | ||
"homepage": "http://newmythmedia.com", | ||
"role": "Developer" | ||
} | ||
], | ||
"require": { | ||
"php": "^7.4 || ^8.0" | ||
}, | ||
"provide": { | ||
"codeigniter4/authentication-implementation": "1.0" | ||
}, | ||
"require-dev": { | ||
"codeigniter4/codeigniter4-standard": "^1.0", | ||
"codeigniter4/devkit": "^1.0", | ||
"codeigniter4/framework": "^4.1", | ||
"mockery/mockery": "^1.0" | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"phpstan/extension-installer": true | ||
} | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Myth\\Auth\\": "src" | ||
}, | ||
"exclude-from-classmap": [ | ||
"**/Database/Migrations/**" | ||
] | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Tests\\Support\\": "tests/_support" | ||
} | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true, | ||
"scripts": { | ||
"analyze": "phpstan analyze", | ||
"ci": [ | ||
"Composer\\Config::disableProcessTimeout", | ||
"@deduplicate", | ||
"@analyze", | ||
"@test", | ||
"@inspect", | ||
"rector process", | ||
"@style" | ||
], | ||
"deduplicate": "phpcpd app/ src/", | ||
"inspect": "deptrac analyze --cache-file=build/deptrac.cache", | ||
"mutate": "infection --threads=2 --skip-initial-tests --coverage=build/phpunit", | ||
"style": "php-cs-fixer fix --verbose --ansi --using-cache=no", | ||
"test": "phpunit" | ||
} | ||
"name": "myth/auth", | ||
"description": "Flexible authentication/authorization system for CodeIgniter 4.", | ||
"license": "MIT", | ||
"type": "library", | ||
"keywords": [ | ||
"codeigniter", | ||
"authentication", | ||
"authorization" | ||
], | ||
"authors": [ | ||
{ | ||
"name": "Lonnie Ezell", | ||
"email": "lonnieje@gmail.com", | ||
"homepage": "http://newmythmedia.com", | ||
"role": "Developer" | ||
} | ||
], | ||
"homepage": "https://github.com/lonnieezell/myth-auth", | ||
"require": { | ||
"php": "^7.4 || ^8.0" | ||
}, | ||
"require-dev": { | ||
"codeigniter4/codeigniter4-standard": "^1.0", | ||
"codeigniter4/devkit": "^1.0", | ||
"codeigniter4/framework": "^4.1", | ||
"mockery/mockery": "^1.0" | ||
}, | ||
"provide": { | ||
"codeigniter4/authentication-implementation": "1.0" | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true, | ||
"autoload": { | ||
"psr-4": { | ||
"Myth\\Auth\\": "src" | ||
}, | ||
"exclude-from-classmap": [ | ||
"**/Database/Migrations/**" | ||
] | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Tests\\Support\\": "tests/_support" | ||
} | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"phpstan/extension-installer": true | ||
} | ||
}, | ||
"scripts": { | ||
"analyze": [ | ||
"phpstan analyze", | ||
"psalm", | ||
"rector process --dry-run" | ||
], | ||
"ci": [ | ||
"Composer\\Config::disableProcessTimeout", | ||
"@deduplicate", | ||
"@analyze", | ||
"@composer normalize --dry-run", | ||
"@test", | ||
"@inspect", | ||
"@style" | ||
], | ||
"deduplicate": "phpcpd app/ src/", | ||
"inspect": "deptrac analyze --cache-file=build/deptrac.cache", | ||
"mutate": "infection --threads=2 --skip-initial-tests --coverage=build/phpunit", | ||
"style": "php-cs-fixer fix --verbose --ansi --using-cache=no", | ||
"test": "phpunit" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
parameters: | ||
paths: | ||
- ./src/ | ||
- ./vendor/codeigniter4/framework/system/ | ||
exclude_files: | ||
- '#.*test.*#i' | ||
layers: | ||
- name: Model | ||
collectors: | ||
- type: bool | ||
must: | ||
- type: className | ||
regex: .*[A-Za-z]+Model$ | ||
must_not: | ||
- type: directory | ||
regex: vendor/.* | ||
- name: Vendor Model | ||
collectors: | ||
- type: bool | ||
must: | ||
- type: className | ||
regex: .*[A-Za-z]+Model$ | ||
- type: directory | ||
regex: vendor/.* | ||
- name: Controller | ||
collectors: | ||
- type: bool | ||
must: | ||
- type: className | ||
regex: .*\/Controllers\/.* | ||
must_not: | ||
- type: directory | ||
regex: vendor/.* | ||
- name: Vendor Controller | ||
collectors: | ||
- type: bool | ||
must: | ||
- type: className | ||
regex: .*\/Controllers\/.* | ||
- type: directory | ||
regex: vendor/.* | ||
- name: Config | ||
collectors: | ||
- type: bool | ||
must: | ||
- type: directory | ||
regex: src/Config/.* | ||
must_not: | ||
- type: className | ||
regex: .*Services | ||
- type: directory | ||
regex: vendor/.* | ||
- name: Vendor Config | ||
collectors: | ||
- type: bool | ||
must: | ||
- type: directory | ||
regex: vendor/.*/Config/.* | ||
must_not: | ||
- type: className | ||
regex: .*Services | ||
- name: Entity | ||
collectors: | ||
- type: bool | ||
must: | ||
- type: directory | ||
regex: src/Entities/.* | ||
must_not: | ||
- type: directory | ||
regex: vendor/.* | ||
- name: Vendor Entity | ||
collectors: | ||
- type: bool | ||
must: | ||
- type: directory | ||
regex: vendor/.*/Entities/.* | ||
- name: View | ||
collectors: | ||
- type: bool | ||
must: | ||
- type: directory | ||
regex: src/Views/.* | ||
must_not: | ||
- type: directory | ||
regex: vendor/.* | ||
- name: Vendor View | ||
collectors: | ||
- type: bool | ||
must: | ||
- type: directory | ||
regex: vendor/.*/Views/.* | ||
- name: Service | ||
collectors: | ||
- type: className | ||
regex: .*Services.* | ||
ruleset: | ||
Entity: | ||
- Config | ||
- Model | ||
- Service | ||
- Vendor Config | ||
- Vendor Entity | ||
- Vendor Model | ||
Config: | ||
- Service | ||
- Vendor Config | ||
Model: | ||
- Config | ||
- Entity | ||
- Service | ||
- Vendor Config | ||
- Vendor Entity | ||
- Vendor Model | ||
Service: | ||
- Config | ||
- Vendor Config | ||
|
||
# Ignore anything in the Vendor layers | ||
Vendor Model: | ||
- Config | ||
- Service | ||
- Vendor Config | ||
- Vendor Controller | ||
- Vendor Entity | ||
- Vendor Model | ||
- Vendor View | ||
Vendor Controller: | ||
- Service | ||
- Vendor Config | ||
- Vendor Controller | ||
- Vendor Entity | ||
- Vendor Model | ||
- Vendor View | ||
Vendor Config: | ||
- Config | ||
- Service | ||
- Vendor Config | ||
- Vendor Controller | ||
- Vendor Entity | ||
- Vendor Model | ||
- Vendor View | ||
Vendor Entity: | ||
- Service | ||
- Vendor Config | ||
- Vendor Controller | ||
- Vendor Entity | ||
- Vendor Model | ||
- Vendor View | ||
Vendor View: | ||
- Service | ||
- Vendor Config | ||
- Vendor Controller | ||
- Vendor Entity | ||
- Vendor Model | ||
- Vendor View | ||
skip_violations: | ||
Myth\Auth\Config\Services: | ||
- Myth\Auth\Authorization\GroupModel | ||
- Myth\Auth\Authorization\PermissionModel | ||
- Myth\Auth\Models\LoginModel | ||
- Myth\Auth\Models\UserModel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.