ringierimu / ringier-code-style
Ringier SA PHP Code Style
Package info
github.com/RingierIMU/ringier-code-style
Type:project
pkg:composer/ringierimu/ringier-code-style
Requires
- php: ^8.3
Requires (Dev)
- carthage-software/mago: ^1.57
- composer/composer: ^2.10
- ergebnis/composer-normalize: ^2.54
- laravel-zero/framework: ^13.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- 1.x-dev
- 1.0.1
- 1.0.0
- 0.6.91
- 0.6.90
- 0.6.89
- 0.6.88
- 0.6.87
- 0.6.86
- 0.6.85
- 0.6.84
- 0.6.82
- 0.6.81
- 0.6.80
- 0.6.79
- 0.6.78
- 0.6.76
- 0.6.75
- 0.6.74
- 0.6.73
- 0.6.72
- 0.6.71
- 0.6.70
- 0.6.69
- 0.6.68
- 0.6.67
- 0.6.66
- 0.6.65
- 0.6.64
- 0.6.63
- 0.6.62
- 0.6.61
- 0.6.60
- 0.6.58
- 0.6.57
- 0.6.56
- 0.6.55
- 0.6.54
- 0.6.53
- 0.6.52
- 0.6.51
- 0.6.50
- 0.6.49
- 0.6.48
- 0.6.47
- 0.6.46
- 0.6.45
- 0.6.44
- 0.6.42
- 0.6.41
- 0.6.40
- 0.6.39
- 0.6.38
- 0.6.37
- 0.6.36
- 0.6.35
- 0.6.34
- 0.6.33
- 0.6.32
- 0.6.31
- 0.6.30
- 0.6.29
- 0.6.28
- 0.6.27
- 0.6.22
- 0.6.21
- 0.6.20
- 0.6.18
- 0.6.17
- 0.6.16
- 0.6.15
- 0.6.14
- 0.6.13
- 0.6.12
- 0.6.11
- 0.6.10
- 0.6.9
- 0.6.8
- 0.6.7
- 0.6.6
- 0.6.5
- 0.6.4
- 0.6.3
- 0.6.2
- 0.6.1
- 0.6.0
- 0.5.8
- 0.5.7
- 0.5.6
- 0.5.5
- 0.5.4
- 0.5.3
- 0.5.2
- 0.5.1
- 0.5.0
- 0.4.1
- 0.4.0
- 0.3.0
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1
- dev-main
This package is auto-updated.
Last update: 2026-11-10 16:37:35 UTC
README
RingierSA PHP Code Style
Installation
composer require ringierimu/ringier-code-style --dev
Usage
Fix code style
vendor/bin/ringier-code-style fix ...files...
Create the mago config file for IDE compatibility
vendor/bin/ringier-code-style config:dump --all
Upgrading from 0.x
1.0 formats with mago instead of PHP CS Fixer.
config:dump --php-cs-fixer,--styleci,--pintand--phpcsare removed, and the command errors if they are passed. Replace them in your composer scripts withconfig:dump --mago, or drop the call:fixfalls back to the bundledmago.toml.- StyleCI is no longer supported. Disable it for the repository and delete
.styleci.yml; otherwise it reverts mago's formatting. Delete.php-cs-fixer.phptoo. fixandfix:stdinno longer accept PHP CS Fixer's options (--config,--dry-run, …), so an IDE's PHP CS Fixer integration pointed at this binary stops working.fixnow exits non-zero when a file fails to parse.- Re-dump the CI workflow with
config:dump --workflow --force. 1.x callsfix-code-style.yml@1.x; the old@maincaller keeps installing 0.x.
Fix code style automatically on every pull request
fix-code-style.yml is a reusable workflow. It fixes the PHP files a pull request touches and
commits the result straight back to the PR branch. Drop the caller into your repository with:
vendor/bin/ringier-code-style config:dump --workflow
which writes:
# .github/workflows/ringier-code-style.yml name: ringier-code-style on: pull_request: concurrency: # Cancel superseded runs on rapid pushes so two runs never race to commit fixes. group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true jobs: ringier-code-style: # The job lives in the fixer's own repo, so a fix to it reaches every consuming repo. # Pin to a release tag: https://github.com/RingierIMU/ringier-code-style/releases uses: RingierIMU/ringier-code-style/.github/workflows/fix-code-style.yml@1.x with: runs-on: ubicloud-standard-2-arm secrets: # Organisation secrets: the Client ID and private key of a GitHub App installed on # this repository with the Contents: read and write permission. app-client-id: ${{ secrets.PR_SIGNING_BOT_CLIENT_ID }} app-private-key: ${{ secrets.PR_SIGNING_BOT_PRIVATE_KEY }}
Both with: inputs are optional: php-version defaults to 8.3 and runs-on to
ubuntu-latest.
The two secrets are the Client ID and private key of a GitHub App installed on your repository
with the Contents: read and write permission. In the RingierIMU organisation they already exist
as the organisation secrets PR_SIGNING_BOT_CLIENT_ID and PR_SIGNING_BOT_PRIVATE_KEY; grant your
repository access to them rather than creating a second app.
A GitHub App is used rather than the default GITHUB_TOKEN for two reasons:
- Commits made with
GITHUB_TOKENdo not trigger further workflow runs, so the pull request's required checks would never report against the style commit and the PR would stay blocked. - The commit is created through GitHub's GraphQL API, which signs it with GitHub's own key. It therefore shows as Verified and is accepted on branches that require signed commits.
Pull requests opened from forks are skipped, because forks receive no secrets.
Contriubutions
Update dependencies
make update-dependencies
Release
Run the Release workflow from the Actions tab
(.github/workflows/release.yml). It builds the PHAR,
commits it, tags it and publishes the release with the binary attached.
- Leave version blank to bump the patch of the latest 1.x tag, or type an explicit
1.MINOR.PATCHto release something else. The first 1.x release needs1.0.0typed in. - Tick dry-run to build and verify without committing, tagging or publishing. The PHAR is uploaded as a run artifact so it can be inspected.
The workflow only runs from the 1.x branch (0.x is released from main), refuses a version
that is not 1.x or is already tagged, and fails if the PHAR it built does not report the right
version, does not carry the current stubs/ content or cannot format a snippet — the release
commit is only made once those checks pass.
It needs the organisation secrets PR_SIGNING_BOT_CLIENT_ID and
PR_SIGNING_BOT_PRIVATE_KEY (the same GitHub App used by the code style workflow) so the
release commit lands Verified.
Build a binary locally
Not needed to release — the workflow above does it. To build one for testing:
make build VERSION=0.6.31