PHPackages                             valkyrja/phpcsfixer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. valkyrja/phpcsfixer

ActiveProject[DevOps &amp; Deployment](/categories/devops)

valkyrja/phpcsfixer
===================

PHP CS Fixer for the Valkyrja Project.

v26.1.4(1w ago)01.9k—7.4%MITPHPPHP &gt;=8.4CI passing

Since Apr 15Pushed 1w agoCompare

[ Source](https://github.com/valkyrjaio/ci-phpcsfixer-php)[ Packagist](https://packagist.org/packages/valkyrja/phpcsfixer)[ Docs](https://www.valkyrja.io/)[ RSS](/packages/valkyrja-phpcsfixer/feed)WikiDiscussions 26.x Synced 1w ago

READMEChangelog (7)Dependencies (1)Versions (18)Used By (0)

[ ![](https://raw.githubusercontent.com/valkyrjaio/art/refs/heads/master/long-banner/orange/php.png)](https://valkyrja.io)

Valkyrja PHP CS Fixer
=====================

[](#valkyrja-php-cs-fixer)

Shared PHP CS Fixer configuration for Valkyrja PHP projects — a reusable rule set and workflow that enforce consistent code style across consuming repositories.

 [![PHP Version Require](https://camo.githubusercontent.com/2fd0374ee8a095d368783d31db7f596bc0d71f8b7b534cbf4653e260a67944c1/68747470733a2f2f706f7365722e707567782e6f72672f76616c6b79726a612f706870637366697865722f726571756972652f706870)](https://packagist.org/packages/valkyrja/phpcsfixer) [![Latest Stable Version](https://camo.githubusercontent.com/f629ec54e3c4793faee7bddea7698e34c3924d2b572c9a1f091da5ecad8e1c47/68747470733a2f2f706f7365722e707567782e6f72672f76616c6b79726a612f706870637366697865722f76)](https://packagist.org/packages/valkyrja/phpcsfixer) [![License](https://camo.githubusercontent.com/ceb629fe8f981c824c325f08a262b4fed4fecc897f1c1e8996a102ebeb6fcea4/68747470733a2f2f706f7365722e707567782e6f72672f76616c6b79726a612f706870637366697865722f6c6963656e7365)](https://packagist.org/packages/valkyrja/phpcsfixer) [![CI Status](https://github.com/valkyrjaio/ci-phpcsfixer-php/actions/workflows/ci.yml/badge.svg?branch=26.x)](https://github.com/valkyrjaio/ci-phpcsfixer-php/actions/workflows/ci.yml?query=branch%3A26.x) [![Scrutinizer](https://camo.githubusercontent.com/6eb969f613ed848cb6e2864ff41ba2ce561d6c0238cd3127b0045879c99f5c01/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f76616c6b79726a61696f2f63692d706870637366697865722d7068702f6261646765732f7175616c6974792d73636f72652e706e673f623d32362e78)](https://scrutinizer-ci.com/g/valkyrjaio/ci-phpcsfixer-php/?branch=26.x) [![Coverage Status](https://camo.githubusercontent.com/ba1e33b3c03741438e5216f8b4e9efcf6fd246cbb9cd99487a6ec7a82b9d1f26/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f76616c6b79726a61696f2f63692d706870637366697865722d7068702f62616467652e7376673f6272616e63683d32362e78)](https://coveralls.io/github/valkyrjaio/ci-phpcsfixer-php?branch=26.x) [![Psalm Shepherd](https://camo.githubusercontent.com/a74696dbd36d315a998c91fc5ab787858545e17d57c37bcadb880fdad78adcaf/68747470733a2f2f73686570686572642e6465762f6769746875622f76616c6b79726a61696f2f63692d706870637366697865722d7068702f636f7665726167652e737667)](https://shepherd.dev/github/valkyrjaio/ci-phpcsfixer-php) [![Maintainability Rating](https://camo.githubusercontent.com/19b30aed856851cd6d1bf9e24315d3f606f9f94e9628edcc9a75d946fafd0428/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d76616c6b79726a61696f5f70687063736669786572266d65747269633d7371616c655f726174696e67)](https://sonarcloud.io/summary/new_code?id=valkyrjaio_phpcsfixer)

Installation
------------

[](#installation)

```
composer require valkyrja/phpcsfixer

```

Usage
-----

[](#usage)

Call `Rules::getConfig()` from your `.php-cs-fixer.php` configuration file and set the finder on the returned config:

```
// .php-cs-fixer.php
use Valkyrja\Fixer\Rules;
use PhpCsFixer\Finder;

$finder = Finder::create()
    ->in(__DIR__ . '/src')
    ->in(__DIR__ . '/tests');

$header = expects($this->once())->method('run');

```

**`yoda_style`**

Yoda conditions are disabled — the variable goes on the left:

```
// bad (yoda)
if (null === $value) { ... }
// good
if ($value === null) { ... }

```

Workflows
---------

[](#workflows)

The [`_workflow-call.yml`](.github/workflows/_workflow-call.yml) reusable workflow runs PHP CS Fixer against the calling repository's source. It is designed to be called from other repositories via `workflow_call`.

### Inputs

[](#inputs)

InputTypeDefaultDescription`paths`string—**Required.** YAML filter spec with two keys: `ci` (CI config files that trigger a base-branch fetch) and `files` (all files that trigger the check).`post-pr-comment`boolean`true`Post a PR comment on failure and remove it on success. Disable when the calling workflow handles its own reporting.`composer-options`string`''`Extra flags passed to every `composer install` step (e.g. `--ignore-platform-req=ext-openswoole`).`php-version`string`'8.4'`PHP version to use.`ci-directory`string`'.github/ci/phpcsfixer'`Path to the CI directory containing `composer.json` and the tool config.`extensions`string`'mbstring, intl'`PHP extensions to install via `shivammathur/setup-php`.### Usage

[](#usage-1)

```
jobs:
  phpcsfixer:
    uses: valkyrjaio/ci-phpcsfixer-php/.github/workflows/_workflow-call.yml@26.x
    permissions:
      pull-requests: write
      contents: read
    with:
      php-version: '8.4'
      paths: |
        ci:
          - '.github/ci/phpcsfixer/**'
          - '.github/workflows/phpcsfixer.yml'
        files:
          - '.github/ci/phpcsfixer/**'
          - '.github/workflows/phpcsfixer.yml'
          - 'src/**/*.php'
          - 'composer.json'
    secrets: inherit
```

`secrets: inherit` is required to pass the `VALKYRJA_GHA_APP_ID` and `VALKYRJA_GHA_PRIVATE_KEY` org secrets used for PR comments.

Contributing
------------

[](#contributing)

See [`CONTRIBUTING.md`](https://github.com/valkyrjaio/.github/blob/master/CONTRIBUTING.md) for the submission process and [`VOCABULARY.md`](https://github.com/valkyrjaio/.github/blob/master/VOCABULARY.md) for the terminology used across Valkyrja.

Security Issues
---------------

[](#security-issues)

If you discover a security vulnerability, please follow our [disclosure procedure](https://github.com/valkyrjaio/.github/blob/master/SECURITY.md).

License
-------

[](#license)

Licensed under the [MIT license](https://opensource.org/licenses/MIT). See [`LICENSE.md`](./LICENSE.md).

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance98

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 55.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

8

Last Release

8d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fbb43a59fb790365b014e53f82e3f26893867e4a47a249fc92962b6dc76878f2?d=identicon)[MelechMizrachi](/maintainers/MelechMizrachi)

---

Top Contributors

[![MelechMizrachi](https://avatars.githubusercontent.com/u/1179171?v=4)](https://github.com/MelechMizrachi "MelechMizrachi (58 commits)")[![valkyrja-volundr[bot]](https://avatars.githubusercontent.com/in/2462900?v=4)](https://github.com/valkyrja-volundr[bot] "valkyrja-volundr[bot] (46 commits)")

---

Tags

ciPhpCsFixervalkyrja

### Embed Badge

![Health badge](/badges/valkyrja-phpcsfixer/health.svg)

```
[![Health](https://phpackages.com/badges/valkyrja-phpcsfixer/health.svg)](https://phpackages.com/packages/valkyrja-phpcsfixer)
```

###  Alternatives

[saggre/phpdocumentor-markdown

Markdown template for phpDocumentor3

2293.1k41](/packages/saggre-phpdocumentor-markdown)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
