mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
apply code static analysis check with phpstan
This commit is contained in:
parent
f69812d1af
commit
3e98c88d7e
33
.github/workflows/static-analysis-check.yml
vendored
Normal file
33
.github/workflows/static-analysis-check.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
name: "Static Analysis Check"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
paths:
|
||||
- 'app'
|
||||
- 'system'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: PHP ${{ matrix.php-versions }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['7.4']
|
||||
steps:
|
||||
- name: Setup PHP Action
|
||||
uses: shivammathur/setup-php@1.8.2
|
||||
with:
|
||||
extensions: intl
|
||||
php-version: "${{ matrix.php-versions }}"
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: "Install dependencies"
|
||||
run: "composer install"
|
||||
- name: "CS Check app"
|
||||
run: "vendor/bin/phpstan analyze --level=0 app"
|
||||
- name: "CS Check app"
|
||||
run: "vendor/bin/phpstan analyze --level=0 system"
|
@ -20,7 +20,8 @@
|
||||
"mikey179/vfsstream": "1.6.*",
|
||||
"phpunit/phpunit": "^8.5",
|
||||
"predis/predis": "^1.1",
|
||||
"squizlabs/php_codesniffer": "^3.3"
|
||||
"squizlabs/php_codesniffer": "^3.3",
|
||||
"phpstan/phpstan": "^0.12.37"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
12
phpstan.neon
Normal file
12
phpstan.neon
Normal file
@ -0,0 +1,12 @@
|
||||
includes:
|
||||
- vendor/phpstan/phpstan/conf/bleedingEdge.neon
|
||||
|
||||
parameters:
|
||||
bootstrapFiles:
|
||||
- qa-bootstrap.php
|
||||
inferPrivatePropertyTypeFromConstructor: true
|
||||
checkMissingIterableValueType: false
|
||||
excludes_analyse:
|
||||
- app/Config/*
|
||||
- app/Database/*
|
||||
- app/Views/*
|
5
qa-bootstrap.php
Normal file
5
qa-bootstrap.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
require 'app/Config/Paths.php';
|
||||
$paths = new Config\Paths();
|
||||
require_once 'system/bootstrap.php';
|
Loading…
x
Reference in New Issue
Block a user