Skip to content

Commit f22684d

Browse files
committed
Add PHP 8.5, Symfony 7.4 and 8.0
1 parent 5d53d3d commit f22684d

13 files changed

Lines changed: 151 additions & 6 deletions

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
description: Add a new PHP version to CI (DependenciesVersions, Dockerfile, phpstan configs)
3+
argument-hint: <php-version>
4+
allowed-tools: [Read, Edit, Write, Glob, Grep, Bash]
5+
---
6+
7+
Add PHP version **$ARGUMENTS** to the CI pipeline. Follow each step exactly.
8+
9+
## Step 1: Validate input
10+
11+
The argument must be a PHP version like `8.5`. If `$ARGUMENTS` is empty or does not match the pattern `X.Y` (single digit dot single digit), stop and tell the user the correct usage: `/add-php-version 8.5`.
12+
13+
Derive these values from the version `X.Y`:
14+
- **MAJOR** = X (e.g. `8`)
15+
- **MINOR** = Y (e.g. `5`)
16+
- **phpVersion int** = X0Y00 (e.g. `80500`) — pad minor to two digits, append two zeros
17+
18+
## Step 2: Update `bin/DependenciesVersions.php`
19+
20+
Read the file. In the `$this->phpVersions` chain (around line 33-38), add `->add('X.Y')` immediately before `->setReadOnly()`. Follow the existing indentation (16 spaces).
21+
22+
## Step 3: Update `docker/ci/Dockerfile`
23+
24+
Read the file. Find the last `# PHP X.Y` comment block in the `apt-get install` section (the block with `phpX.Y-cli`, `phpX.Y-dom`, `phpX.Y-mbstring`). Add a new block immediately after it with the same pattern:
25+
26+
```
27+
# PHP X.Y
28+
phpX.Y-cli \
29+
phpX.Y-dom \
30+
phpX.Y-mbstring \
31+
```
32+
33+
Make sure the backslash continuation is preserved on the line before the new block.
34+
35+
## Step 4: Create phpstan config files
36+
37+
1. Glob `config/ci/phpstan/php-*.neon` to find all existing Symfony versions in use.
38+
2. Extract the unique Symfony versions (e.g. `7.0`, `7.1`, `7.2`, `7.3`).
39+
3. For each Symfony version `Z.A`, create `config/ci/phpstan/php-X.Y.symfony-Z.A.neon` with this exact content (no trailing newline after the last line):
40+
41+
```
42+
includes:
43+
- common.neon
44+
parameters:
45+
phpVersion: <phpVersion int>
46+
tmpDir: ../../../var/ci/phpstan/php-X-Y/symfony-Z-A
47+
```
48+
49+
Where dashes replace dots in directory names (e.g. `php-8-5/symfony-7-0`).
50+
51+
## Step 5: Build Docker image
52+
53+
Run `bin/ci/docker` to rebuild the CI Docker image with the new PHP version. This may take several minutes.
54+
55+
## Step 6: Run CI validation
56+
57+
Run `bin/ci/validate` to verify everything passes. If it fails, fix the errors and re-run until it passes.
58+
59+
## Step 7: Report
60+
61+
List all files that were modified or created.
62+
63+
At the very end, display this reminder message in bold yellow (using markdown):
64+
65+
> **⚠️ Don't forget to push the Docker image: `bin/ci/docker --push`**

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/.claude/settings.local.json
12
/var/
23
!/var/.gitkeep
34
/vendor/

CLAUDE.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
PHP library for running shell processes in parallel with dependency management between them. Built on Symfony Console/Process components. The library itself is used to run its own CI validation (self-dogfooding).
8+
9+
## Common Commands
10+
11+
**Run tests locally (requires PHP 8.2+ and ext-pcntl):**
12+
```bash
13+
composer install
14+
vendor/bin/phpunit -c config/ci/phpunit.xml
15+
```
16+
17+
**Run full CI validation (runs all checks in parallel using this library itself):**
18+
```bash
19+
bin/ci/env # install dependencies
20+
bin/ci/validate # runs phpcs, phpstan, phpunit, composer checks, etc. in parallel
21+
```
22+
23+
**Run individual CI tools:**
24+
```bash
25+
bin/ci/phpcs # code style (steevanb custom sniffs)
26+
bin/ci/phpstan # static analysis (level 9)
27+
bin/ci/phpunit-coverage # tests with coverage
28+
```
29+
30+
CI tests across a matrix: PHP 8.2/8.3/8.4 × Symfony 7.0/7.1/7.2/7.3.
31+
32+
## Architecture
33+
34+
### Core Components
35+
36+
**`ParallelProcessesApplication`** (`src/Console/Application/`) — Main orchestrator. Extends Symfony `SingleCommandApplication`, implements `SignalableCommandInterface`. Uses a fluent builder interface to add processes, configure timeout/refresh interval/max parallel processes, then `run()`. Handles SIGINT for graceful shutdown.
37+
38+
**`Process`** (`src/Process/Process.php`) — Extends Symfony `Process`, implements `ProcessInterface`. Each process has configurable output verbosity levels (standard, error, failure, canceled), a `StartCondition` for dependency management, and cancellation support.
39+
40+
**`StartCondition`** (`src/Process/StartCondition.php`) — Controls when a process can start via three dependency collections:
41+
- `processesTerminated` — start after these finish (regardless of success/failure)
42+
- `processesSuccessful` — start only after these succeed
43+
- `processesFailed` — start only after these fail
44+
45+
**`BootstrapProcess` / `TearDownProcess`** — Special process types. Bootstrap processes automatically become dependencies (via `processesSuccessful`) for all standard processes. TearDown processes automatically wait for all standard processes to terminate.
46+
47+
**Theme system** (`src/Console/Application/Theme/`) — Strategy pattern. `DefaultTheme` shows real-time colored status; `SummaryTheme` shows minimal output (used in CI). Custom themes implement `ThemeInterface`. Selected via `--theme` CLI option.
48+
49+
**`ProcessInterfaceCollection`** — Type-safe collection with filtering: `getReady()`, `getStarted()`, `countRunning()`.
50+
51+
## Code Conventions
52+
53+
- `declare(strict_types=1)` on every file
54+
- PHP 8.2+ features: constructor property promotion, `readonly`, enums, `#[\Override]` attribute
55+
- PHPStan level 9 (strictest)
56+
- Fluent interface pattern (methods return `static`)
57+
- Interfaces suffixed with `Interface`, no `Abstract` prefix convention
58+
- Tests: one test class per method, `@covers` annotation required, test directory mirrors `src/` structure
59+
- PHPUnit config: `config/ci/phpunit.xml` (with coverage), `config/release/phpunit.xml`
60+
- PHPStan configs: `config/ci/phpstan/` (per PHP/Symfony version combination)

bin/DependenciesVersions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function __construct(array $argv)
3535
->add('8.2')
3636
->add('8.3')
3737
->add('8.4')
38+
->add('8.5')
3839
->setReadOnly();
3940
}
4041

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
includes:
2+
- common.neon
3+
parameters:
4+
phpVersion: 80500
5+
tmpDir: ../../../var/ci/phpstan/php-8-5/symfony-7-0
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
includes:
2+
- common.neon
3+
parameters:
4+
phpVersion: 80500
5+
tmpDir: ../../../var/ci/phpstan/php-8-5/symfony-7-1
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
includes:
2+
- common.neon
3+
parameters:
4+
phpVersion: 80500
5+
tmpDir: ../../../var/ci/phpstan/php-8-5/symfony-7-2
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
includes:
2+
- common.neon
3+
parameters:
4+
phpVersion: 80500
5+
tmpDir: ../../../var/ci/phpstan/php-8-5/symfony-7-3

docker/ci/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ RUN \
3838
php8.4-cli \
3939
php8.4-dom \
4040
php8.4-mbstring \
41+
# PHP 8.5
42+
php8.5-cli \
43+
php8.5-dom \
44+
php8.5-mbstring \
4145
# For Composer
4246
curl \
4347
zip \

src/Process/Process.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ protected function updateStatus(bool $blocking): void
251251
protected function getParentPrivatePropertyValue(string $property): mixed
252252
{
253253
$reflection = new \ReflectionProperty(SymfonyProcess::class, $property);
254-
$reflection->setAccessible(true);
255254

256255
return $reflection->getValue($this);
257256
}

0 commit comments

Comments
 (0)