Skip to content

feat: bootstrap standard PHP project with CI: Rector, PHPStan, PHPUnit#1

Merged
ddevsr merged 4 commits into
mainfrom
copilot/add-ci-rector-phpstan-phpunit
Apr 18, 2026
Merged

feat: bootstrap standard PHP project with CI: Rector, PHPStan, PHPUnit#1
ddevsr merged 4 commits into
mainfrom
copilot/add-ci-rector-phpstan-phpunit

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 18, 2026

Initialises the php-profiler repo from a bare README into a fully structured PHP library with static analysis and test automation.

Project Structure

  • src/Profiler.php — core profiler class (start/stop, period control, log collection, runtime guards)
  • tests/ProfilerTest.php — PHPUnit 12 test suite covering all public API paths
  • composer.json — library manifest; dev deps: PHPStan 2.x, Rector 2.x, PHPUnit 12.x, Tachycardia, phpcov

Tooling Config

  • rector.php — code quality, dead code, early-return, and coding-style rule sets; targets PHP 8.3
  • phpstan.neon.dist — level 9, scans src/ + tests/
  • phpunit.xml.dist — PHPUnit 12 schema, Tachycardia extension, coverage reports under build/

CI Workflows (.github/workflows/)

Workflow Trigger Matrix
test-phpunit.yml push/PR → main, **.php 8.3 · 8.4
test-phpstan.yml push/PR → main, **.php / phpstan* 8.3 · 8.4
test-rector.yml push/PR → main, src/**.php 8.3 · 8.4
check-conflict.yml schedule every 20 min
check-signing.yml PR → main
dependency-review.yml pull_request

Requirements

  • Minimum PHP version: 8.3
  • phpunit/phpcov: ^11.0 || ^12.0

Security

phpunit/phpunit pinned to ^12.5.22 — the first release patching the argument-injection-via-INI-newline vulnerability (affected <= 12.5.21). phpunit/phpcov set to ^11.0 || ^12.0 to allow flexibility while remaining compatible. PHPUnit 12 also requires renaming <bootstrap><extension> inside <extensions> in phpunit.xml.dist.

Original prompt

Make standard PHP project have CI Rector + PHPStan + PHPUnit with Standard folder

.github/
src/

Copilot AI and others added 2 commits April 18, 2026 16:25
Copilot AI changed the title [WIP] Add CI Rector, PHPStan, and PHPUnit to standard PHP project Bootstrap standard PHP project with CI: Rector, PHPStan, PHPUnit Apr 18, 2026
Copilot AI requested a review from ddevsr April 18, 2026 16:32
@ddevsr ddevsr changed the title Bootstrap standard PHP project with CI: Rector, PHPStan, PHPUnit feat: bootstrap standard PHP project with CI: Rector, PHPStan, PHPUnit Apr 18, 2026
@ddevsr
Copy link
Copy Markdown
Contributor

ddevsr commented Apr 18, 2026

@copilot Minimum PHP 8.3, phpunit/pcov minimum v11

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 18, 2026

@copilot Minimum PHP 8.3, phpunit/pcov minimum v11

Done in f3519a1:

  • PHP minimum raised to ^8.3 in composer.json and rector.php (PHP_83 / UP_TO_PHP_83)
  • phpunit/phpcov broadened to ^11.0 || ^12.0
  • PHP 8.2 removed from all three CI workflow matrices (test-phpunit, test-phpstan, test-rector)

@ddevsr ddevsr marked this pull request as ready for review April 18, 2026 16:41
@ddevsr ddevsr merged commit 02e94d4 into main Apr 18, 2026
3 of 9 checks passed
@ddevsr ddevsr deleted the copilot/add-ci-rector-phpstan-phpunit branch April 18, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants