Skip to content

Platform ​

The platform every library of the MIDDAG PHP family declares, when its PHP floor rises, and how CI proves it. This page states every platform rule a consumer of the libraries relies on. The PHP platform floor reference of the MIDDAG profile (docs-middag-ops) is the internal source behind it; a reader does not need it. Related: Versioning and compatibility, Guards.

Declared platform ​

Every library declares the same values. The Symfony row applies only to a library that depends on a Symfony component; ui depends on none.

ItemValueWhere
PHP requirement^8.3composer.json require.php
Platform pin8.3.0composer.json config.platform.php
Symfony packages^7.4 || ^8.1every Symfony component (symfony/* on the 7.x/8.x release line) in require and require-dev, in a library that has one
Sibling librariesthe family MAJOR (^2.0 on 2.x)require / require-dev
Rector targetLevelSetList::UP_TO_PHP_83rector.php
PHPStan PHP version80300phpVersion in the PHPStan config
CI PHP versions8.3, 8.4 and 8.5the library CI workflow

Rules:

  • The pin equals the floor (<floor>.0). Composer resolves the lowest PHP of the range locally and in the pinned CI jobs, so a dependency that needs a newer PHP fails at install time, not in production.
  • No Symfony component is held to one major line. A constraint such as ^7.0 alone, or ^8.0 alone, is a platform defect.
  • The Symfony contracts (symfony/*-contracts) and polyfills (symfony/polyfill-*) are versioned on their own line, not on the 7.x/8.x line of the components. They keep their own ranges (for example symfony/event-dispatcher-contracts ^3.0) and are outside the ^7.4 || ^8.1 rule.
  • The Rector and PHPStan targets equal the floor. A target above the floor would rewrite code into syntax the floor cannot parse.

Raising the floor ​

  • The floor is never lower than the lowest PHP version with official support (active or security) on php.net, the PHP minimum of the Symfony range or the PHP minimum of any dependency. On 2.x it is PHP 8.3.
  • The floor rises only when the floor PHP version loses security support on php.net, and never by more than one minor at a time.
  • A newly required PHP extension counts as a floor change, because the host must install it.
  • The floor rises only in a family MAJOR, in every library at once; no library goes alone. The PHP requirement, the platform pin, the Rector and PHPStan targets and the CI PHP versions change together in that release.

CI ​

Each library's CI runs these jobs on every pull request and on main.

JobPHPPinPurpose
Library check8.3, 8.4, 8.5kept (8.3.0)Lint, static analysis, code style, Rector dry run, audit and tests
highest8.4, 8.5removedInstalls the highest versions the range allows and runs the tests
Family window check——Enforces the family commit-type rule: from 2.0.0 a feat: merges only while a family MINOR window is open, and a breaking change only while a family MAJOR window is open

The highest job:

  • removes the platform pin before composer update (by unsetting config.platform.php or by overriding it for the run), so Composer resolves on the real PHP of the runner;
  • in a library that depends on a Symfony component, asserts that its Symfony packages resolve to 8.x: the packages listed in its expect-majors (recipe per library). A green run that resolved Symfony 7.4 does not pass;
  • in a library with no Symfony component (ui), makes no Symfony assertion: its expect-majors is empty. The job still runs on 8.4 and 8.5 without the pin and is still required; it proves only the PHP range;
  • runs the same test suite as the library check.

The library check and the highest job come from the shared PHP library check of middag-io/actions (php-library-check). From php-library-check v1.2.0, the default php-versions is ["8.3", "8.4", "8.5"], so the library check call needs no php-versions input. The highest job is a second call of the same component, with these inputs:

InputValue in the highest callEffect
php-versions["8.4", "8.5"]Symfony 8.x needs PHP 8.4 or later, so 8.3 stays in the library check only
dependency-versionshighestRuns composer update instead of composer install
unset-platform-phptrueUnsets config.platform.php before the install, so the PHP of the runner constrains the resolution
expect-majors<vendor>/<package>:<major> itemsEach listed package must be installed at that major version, or the job fails. Empty means no assertion

Recipe per library ​

Every library runs the library check on ["8.3", "8.4", "8.5"] and the highest job on ["8.4", "8.5"]. The table lists what differs.

LibraryCall formexpect-majors of highestOwn jobs, next to the shared check
middag-php-uireusable workflowemptynone
middag-php-frameworkreusable workflowsymfony/dependency-injection:8, symfony/http-kernel:8none
middag-php-moodlereusable workflowsymfony/dependency-injection:8, symfony/http-client:8, symfony/http-foundation:8, symfony/messenger:8, symfony/psr-http-message-bridge:8, symfony/routing:8stan-matrix: PHPStan against the Moodle stubs of each Moodle version in range (4.5, 5.1, 5.2 and 5.3). engines: installs Moodle 4.5, 5.1, 5.2 and 5.3 on PostgreSQL, MySQL and MariaDB and runs the SQL of every DbSupport helper. The platform job leaves; highest replaces it
middag-php-wordpressreusable workflowsymfony/dependency-injection:8, symfony/http-foundation:8, symfony/psr-http-message-bridge:8, symfony/routing:8wordpress-matrix: PHPStan against the WordPress stubs of the latest major and the previous one (~7.1.0 and ~7.0.0). wordpress-integration: the integration suite (tests/Integration) on a real WordPress of each supported major (the newest patch of 7.0 and 7.1, checksum verified), on PHP 8.3 with a MySQL 8.4 service. The unit suite runs in the shared check
middag-php-demo-standalonereusable workflow; installs from its committed composer.locksymfony/dotenv:8the Docker image build with a smoke test (no push), and the end-to-end tests
middag-php-corecomposite action, in a matrix job of its own: its tests need a Redis service, which a reusable workflow cannot take from its callersymfony/dependency-injection:8stan-matrix: PHPStan against the Moodle stubs of each Moodle version in range
other internal librariesreusable workflow, recorded in each repositoryper librarythe OSS purity job runs in one of them (Guards)

Rules:

  • A library keeps a job of its own only for a check the shared component cannot run. A platform check that the highest job covers is not kept.
  • expect-majors lists at least one Symfony package of each library that depends on Symfony, chosen from its own require, or from require-dev when it has no runtime Symfony dependency.
  • The demo follows the library recipe: ^8.3, pin 8.3.0, its composer.lock regenerated at the pin and its Symfony constraints ^7.4 || ^8.1. It proves both ends of the Symfony range like every library; the lock its Docker image ships resolves Symfony 7.4.

The shared check also owns caching: the Composer cache, and the Rector, PHPStan and PHP-CS-Fixer caches through its tool-cache-paths input (to be released). A library adds no cache step of its own; it passes the directory its tools write to (for example .cache), and any other cache it needs is a change to the shared check.

Required checks on main ​

  • The family window check is required on main of every library.
  • The library check and the highest job are required on main of every library, with the branch up to date before merge.
  • A library adds a required check only through the organization ruleset, so every library has the same required checks.

MIDDAG © 2015-2026