PHPackages                             edefine/symfony-code-standards - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. edefine/symfony-code-standards

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

edefine/symfony-code-standards
==============================

Code standards tools for Symfony projects.

0240↓44.4%Shell

Since Jun 25Pushed 4w agoCompare

[ Source](https://github.com/eDefine/symfony-code-standards)[ Packagist](https://packagist.org/packages/edefine/symfony-code-standards)[ RSS](/packages/edefine-symfony-code-standards/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

eDefine Symfony Code Standards
==============================

[](#edefine-symfony-code-standards)

A Composer library that packages shared code-quality tooling for Symfony projects. It provides a unified CLI wrapper (`bin/code-check`) around PHPUnit, PHPCS, PHP-CS-Fixer, PHPMD, PHPStan, and Rector, along with pre-configured rulesets for each tool.

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

[](#installation)

```
composer require --dev edefine/symfony-code-standards
```

Setup
-----

[](#setup)

The `bin/code-check` script requires an `scs.ini` file in your project root. Copy the template distributed with this package and adjust paths as needed:

```
cp vendor/edefine/symfony-code-standards/scs.ini.dist scs.ini
```

`scs.ini.dist` defaults:

```
DOMAIN=http://localhost
PHPUNIT_CONFIG=vendor/edefine/symfony-code-standards/config/phpunit.dist.xml
PHPCS_CONFIG=vendor/edefine/symfony-code-standards/config/phpcs.xml.dist
PHP_CS_FIXER_CONFIG=vendor/edefine/symfony-code-standards/config/.php-cs-fixer.dist.php
PHPMD_CONFIG=vendor/edefine/symfony-code-standards/config/phpmd.xml.dist
PHPSTAN_CONFIG=vendor/edefine/symfony-code-standards/config/phpstan.neon.dist
RECTOR_CONFIG=vendor/edefine/symfony-code-standards/config/rector.php
```

Each variable must point to a readable file. You can override any of them to use a project-specific config.

Usage
-----

[](#usage)

```
vendor/bin/code-check [options] [path]
```

Running without options executes all checks.

### Analysis options

[](#analysis-options)

FlagTool`-U` / `--phpunit`PHPUnit`-C` / `--phpcs`PHPCS`-CF` / `--php-cs-fixer`PHP-CS-Fixer`-M` / `--phpmd`PHPMD`-S` / `--phpstan`PHPStan`-R` / `--rector`Rector### Miscellaneous options

[](#miscellaneous-options)

FlagDescription`-c` / `--coverage`Generate code coverage reports (requires Xdebug)`-f` / `--fix`Auto-fix issues where possible (PHP-CS-Fixer)`-q` / `--quiet`Suppress per-tool output; show only the summary table`-v` / `--verbose`Show additional per-tool output`-u` / `--usage`Print usage informationAn optional `path` argument restricts analysis to a specific file or directory.

### Examples

[](#examples)

```
# Run all checks
vendor/bin/code-check

# Run only PHPStan and Rector
vendor/bin/code-check -S -R

# Fix code style issues
vendor/bin/code-check -CF -f

# Run PHPUnit with coverage on a specific path
vendor/bin/code-check -U -c src/Module/

# Quiet mode — useful in CI where you only need the summary
vendor/bin/code-check -q
```

Tool configuration
------------------

[](#tool-configuration)

All configs live in `config/` and are ready to use as-is or as a base for project overrides.

### PHPUnit (`config/phpunit.dist.xml`)

[](#phpunit-configphpunitdistxml)

- Bootstrap: `tests/bootstrap.php`
- `requireCoverageMetadata="true"` — all source files must declare coverage metadata
- `failOnNotice` and `failOnWarning` enabled
- Symfony PHPUnit bridge extension with clock and DNS mocks scoped to the `App` namespace
- Coverage output written to `public/coverage-phpunit/`

### PHPCS (`config/phpcs.xml.dist`)

[](#phpcs-configphpcsxmldist)

- Standard: **PSR-12**
- Scans `bin/`, `public/`, `src/`, `tests/`
- Excludes `config/reference.php`

### PHP-CS-Fixer (`config/.php-cs-fixer.dist.php`)

[](#php-cs-fixer-configphp-cs-fixerdistphp)

- Ruleset: `@Symfony` + `@Symfony:risky`
- `declare_strict_types` enforced on every file
- Global namespace imports enabled (`use` statements over FQCNs in code)
- Concatenation spacing: one space around `.`
- Space before parenthesis in class definitions
- Yoda style disabled
- Single-line throw disabled
- Excludes `docker/`, `var/`, and `config/bundles.php`, `config/preload.php`, `config/reference.php`

### PHPMD (`config/phpmd.xml.dist`)

[](#phpmd-configphpmdxmldist)

Active rules:

- **Codesize** – cyclomatic complexity (threshold: 21)
- **Cleancode** – duplicated array keys, error control operator (`@`), missing imports, undefined variables
- **Controversial** – camel-case naming for classes, methods, parameters, properties, and variables; no superglobals
- **Design** – no `eval`, `exit`, `goto`, `count()` in loops, empty catch blocks, or development fragments (`var_dump` etc.)
- **Naming** – constant naming conventions
- **Unusedcode** – unused local variables, private fields, and private methods

### PHPStan (`config/phpstan.neon.dist`)

[](#phpstan-configphpstanneondist)

- Level: **7**
- Analyses `src/` and `tests/`
- `treatPhpDocTypesAsCertain: false`

### Rector (`config/rector.php`)

[](#rector-configrectorphp)

- PHP level set: **UP\_TO\_PHP\_83**
- Composer-based sets enabled: Symfony, Doctrine, PHPUnit, Twig
- Attribute sets: all enabled
- PHPStan config shared from this package
- Processes `src/` and `tests/`
- `ReadOnlyPropertyRector` skipped — Doctrine has a bug with `private readonly Uuid $id`

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance61

Regular maintenance activity

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

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

---

Top Contributors

[![sycu](https://avatars.githubusercontent.com/u/1109505?v=4)](https://github.com/sycu "sycu (15 commits)")

### Embed Badge

![Health badge](/badges/edefine-symfony-code-standards/health.svg)

```
[![Health](https://phpackages.com/badges/edefine-symfony-code-standards/health.svg)](https://phpackages.com/packages/edefine-symfony-code-standards)
```

###  Alternatives

[mediarox/module-checkout-placeholder

Show placeholders instead of labels at common checkout field's (incl. required entry mark).

111.5k](/packages/mediarox-module-checkout-placeholder)

PHPackages © 2026

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