Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions docs/CI_UPDATE_REQUIRED.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Required CI Update for Issue #43

To complete Issue #43, the following CI workflow changes are needed:

## Add to `.github/workflows/ci.yml`

```yaml
static-analysis:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: gmp

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --no-interaction --prefer-dist

- name: PHPStan
run: make stan

code-style:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: gmp

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --no-interaction --prefer-dist

- name: Code Style (PHPCS)
run: make sniff
```

## Current Makefile Commands

- `make stan` - Run PHPStan level 9
- `make sniff` - Check code style (PSR-12)
- `make cs` - Fix code style

## PHPStan Configuration

Already configured in `phpstan.neon`:
```yaml
parameters:
level: 9
paths:
- src
- tests
```
42 changes: 42 additions & 0 deletions docs/STATIC_ANALYSIS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Static Analysis and Code Quality

This project uses PHPStan for static analysis and PHPCS for code style checking.

## PHPStan (Static Analysis)

We use PHPStan level 9 for strict type checking.

### Run Locally

```bash
make stan
```

### Configuration

See `phpstan.neon` for configuration.

## Code Style (PHPCS)

We follow PSR-12 coding standards.

### Check Code Style

```bash
make sniff
```

### Fix Code Style

```bash
make cs
```

## CI Integration

The CI pipeline runs:
1. Unit tests (PHPUnit)
2. Static analysis (PHPStan)
3. Code style check (PHPCS)

All checks must pass before merging.
Loading