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
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ version: 2
updates:
- package-ecosystem: "composer"
directory: "/"
cooldown:
default-days: 7
schedule:
interval: "daily"
43 changes: 43 additions & 0 deletions .github/workflows/grumphp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Grumphp

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
production-build:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
php-version: [ '8.4', '8.5' ]

steps:
- name: Checkout current repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Setup .env file
run: echo "php-container=coding-standards-php${{ matrix.php-version }}" >> $GITHUB_ENV

- name: Start containers
run: docker compose -f docker-compose.yml up -d ${{ env.php-container }}

- name: Check PHP Version
run: docker exec ${{ env.php-container }} php -v

- name: Validate composer.json
run: docker exec ${{ env.php-container }} composer validate --strict --no-check-lock

- name: Composer update
run: docker exec ${{ env.php-container }} composer update --prefer-dist --no-interaction
Comment thread
majoskorec marked this conversation as resolved.

- name: Run static analysis (GrumPHP)
run: docker exec ${{ env.php-container }} vendor/bin/grumphp run --testsuite=php${{ matrix.php-version }}

- name: Stop containers
if: always()
run: docker compose -f docker-compose.yml down -v
4 changes: 2 additions & 2 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
use PhpCsFixer\Config;
use PhpCsFixer\Finder;

$finder = (new Finder())
$finder = new Finder()
->in(__DIR__)
->exclude('var');

return (new Config())
return new Config()
->setRiskyAllowed(true)
->setRules([
'array_syntax' => [
Expand Down
8 changes: 8 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Project instructions

Run project commands, including tests, static analysis, code-style checks, and Composer commands, inside the project's Docker containers.

- Use the `coding-standards-php-min` container by default.
- When a command verifies behavior specific to a PHP version, use the corresponding container, such as `coding-standards-php8.4` or `coding-standards-php8.5`.
- Start the required service with Docker Compose if it is not already running.
- Do not use the host PHP or Composer installation for project validation.
121 changes: 121 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Changelog

All notable changes from version 4.0.0 onward are documented in this file.

## 6.0.0

### Added

- Added PHP 8.4 and PHP 8.5 GrumPHP test suites and a GitHub Actions workflow that tests against the latest allowed
dependency versions.
- Added the `ClassKeywordOrder`, `ReadonlyClass`, `TraitUseOrder`, `CatchExceptionsOrder`, and
`ThrowsAnnotationsOrder` Slevomat rules.
- Added a project `RequireAbstractOrFinal` sniff that accepts native `final`, `abstract`, and the `@final`
annotation.
- Added functional coverage for forbidden annotations, abstract or final classes, whitespace fixes, and XML schema
validation.

### Changed

- Raised the minimum PHP version to 8.4.
- Updated PHP_CodeSniffer to 4.0.4, Slevomat Coding Standard to 8.31.1, and the development dependencies to their
current supported versions.
- Made PHP 8.4 the base ruleset and made PHP 8.5 extend it.
- Limited forbidden annotations to `@author`, `@copyright`, and `@license`; `@throws` remains allowed.
- Improved the XML linter to validate multi-namespace documents through their root schema and to restore libxml
error handling after exceptions.
- Prevented functional PHPCS tests from modifying source fixtures.

### Removed

- Removed PHP 8.3 rulesets and runtime support.
- Removed the PHP Mess Detector dependency and the `phpmd_extended` GrumPHP task.

## 5.5.1 - 2026-02-03

### Fixed

- Fixed XML linting and task option handling.
- Improved compatibility of custom GrumPHP tasks with current GrumPHP APIs.

## 5.5.0 - 2026-01-07

### Added

- Added the `phpstan_extended` task with chunked PHPStan execution.
- Added the `xmllint_extended` task with strict schema validation.

## 5.4.0 - 2025-12-15

### Added

- Added PHP 8.5 rulesets and a PHP 8.5 development container.

## 5.3.1 - 2025-12-11

### Added

- Added explicit end-of-file newline enforcement.
- Extended functional test helpers for PHPCS fix verification.

## 5.3.0 - 2025-12-09

### Added

- Added stricter whitespace rules.
- Added functional tests for PHPCS fixes.

## 5.2.0 - 2025-11-14

### Added

- Added the chunked `phpmd_extended` GrumPHP task.

## 5.1.1 - 2025-11-14

### Added

- Added enforcement for whitespace on otherwise empty lines.

## 5.1.0 - 2025-11-13

### Added

- Added GrumPHP integration and custom tasks for Composer installation checks and Doctrine schema validation.
- Added project configuration for PHP-CS-Fixer, PHPCS, and PHPStan.

## 5.0.0 - 2025-10-22

### Changed

- Reworked the version-specific ruleset hierarchy.
- Updated the development environment and project tooling.

### Removed

- Removed obsolete PHP 8.1 and PHP 8.2 rulesets.
- Removed sniffs deprecated by newer PHP_CodeSniffer and Slevomat Coding Standard releases.

## 4.1.1 - 2025-02-25

### Fixed

- Fixed the installed path configuration for both local development and Composer-installed usage.

## 4.1.0 - 2025-02-24

### Added

- Added PHP 8.4 support and version-specific PHP 8.4 rulesets.
- Added the Pixel Federation custom sniff standard and the switch-statement restriction.

### Changed

- Updated package dependencies and reorganized example files.
- Replaced the generic ruleset with PHP-version-specific rulesets.

## 4.0.0 - 2024-11-26

### Added

- Added PHP 8.3 support.
Loading
Loading