PHPackages                             dasann/code-sniffer - 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. [Framework](/categories/framework)
4. /
5. dasann/code-sniffer

ActivePhpcodesniffer-standard[Framework](/categories/framework)

dasann/code-sniffer
===================

Spryker Code Sniffer Standards

v1.0.0(1y ago)02MITPHPPHP &gt;=8.1

Since Feb 12Pushed 1y agoCompare

[ Source](https://github.com/dasann/code-sniffer)[ Packagist](https://packagist.org/packages/dasann/code-sniffer)[ Docs](https://spryker.com)[ RSS](/packages/dasann-code-sniffer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (4)Used By (0)

Spryker Code Sniffer
====================

[](#spryker-code-sniffer)

[![CI](https://github.com/spryker/code-sniffer/workflows/CI/badge.svg)](https://github.com/spryker/code-sniffer/actions?query=workflow%3ACI+branch%3Amaster)[![Latest Stable Version](https://camo.githubusercontent.com/a12e32ff7209665d5325d82de06c4e6b99af0b98fa474be95aca251b43bc8128/68747470733a2f2f706f7365722e707567782e6f72672f737072796b65722f636f64652d736e69666665722f762f737461626c652e737667)](https://packagist.org/packages/spryker/code-sniffer)[![Minimum PHP Version](https://camo.githubusercontent.com/7ddd0b2455db79dcdef99447ace66fe96bef3e86f039ffeda44df726d814e700/687474703a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e312d3838393242462e737667)](https://php.net/)[![PHPStan](https://camo.githubusercontent.com/f60d96f7c2579690ab6dfa8918f777fe93a02a92301c661eb38a85861a92b780/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230382d627269676874677265656e2e7376673f7374796c653d666c6174)](https://phpstan.org/)[![License](https://camo.githubusercontent.com/6eed53ed87a5a3da67fdab33d072607cd4b5960f973238467b6d2ae4c765ed29/68747470733a2f2f706f7365722e707567782e6f72672f737072796b65722f636f64652d736e69666665722f6c6963656e73652e737667)](https://packagist.org/packages/spryker/code-sniffer)[![Total Downloads](https://camo.githubusercontent.com/a9479eaaf73b5500cbe8812bf2e66f947050d9c6cceae840b587074650c9d62c/68747470733a2f2f706f7365722e707567782e6f72672f737072796b65722f636f64652d736e69666665722f642f746f74616c2e737667)](https://packagist.org/packages/spryker/code-sniffer)

This sniffer package follows [PSR-2](http://www.php-fig.org/psr/psr-2/) completely and ships with a lot of additional fixers on top (incl. PSR-12). Please see the Spryker Coding conventions for details.

[List of included sniffs.](docs/sniffs.md)

Documentation
-------------

[](#documentation)

See **[docs](docs/README.md)**.

Upstream docs: [squizlabs/PHP\_CodeSniffer/wiki](https://github.com/squizlabs/PHP_CodeSniffer/wiki)

Usage
-----

[](#usage)

### How to use in Spryker projects

[](#how-to-use-in-spryker-projects)

Make sure you include the sniffer as `require-dev` dependency:

```
composer require --dev spryker/code-sniffer

```

The Development module provides a convenience command:

```
console code:sniff:style

```

(or `console c:s:s` as shortcut)

To automatically fix fixable errors, use

```
console code:sniff:style -f

```

`-v` is useful for more info output. To run only a specific sniff, use the `-s` option. See `-h` for help.

You can also sniff a specific project level module or path:

```
console code:sniff:style [-m ModuleName] [optional-sub-path] -v

```

### How to use in any project

[](#how-to-use-in-any-project)

You can also manually invoke the phpcs/phpcbf commands:

```
vendor/bin/phpcs --standard=vendor/spryker/code-sniffer/Spryker/ruleset.xml ./
vendor/bin/phpcbf --standard=vendor/spryker/code-sniffer/Spryker/ruleset.xml ./

```

The command `phpcs` just sniffs, `phpcbf` fixes.

You probably want to ignore some folders, e.g. `--ignore=vendor/` or some of your test fixture folders.

### Standards

[](#standards)

You can always switch the standard to the stricter one named `SprykerStrict`. It is an extension of the `Spryker` standard with its own (strict) sniffs added on top.

### How to include in your IDE

[](#how-to-include-in-your-ide)

E.g. for PHPStorm:

- Open Settings -&gt; Tools -&gt; External Tools
- Add a new tool named "cs-sniffer" and set Program to `$ProjectFileDir$/vendor/bin/phpcs`, Parameters to `--standard=$ProjectFileDir$/vendor/spryker/code-sniffer/Spryker/ruleset.xml -p $FilePath$` and Working directory to `$ProjectFileDir$`.
- Add a new tool named "cs-fixer" and set Program to `$ProjectFileDir$/vendor/bin/phpcbf`, Parameters to `--standard=$ProjectFileDir$/vendor/spryker/code-sniffer/Spryker/ruleset.xml -v $FilePath$` and Working directory to `$ProjectFileDir$`.
- Remove the "Open console" if you don't want to see any output here for the fixer.
- Now set up your hotkeys under Settings -&gt; Keymap (search for cs-sniffer and cs-fixer). E.g. `Control + Comma` for sniffing, and `Control + Dot` for fixing.

You can also set up file watchers, but here you should better only whitelist certain sniffs that only add things and don't remove anything.

### How to configure the default rule set

[](#how-to-configure-the-default-rule-set)

In order to simplify command line interface, `phpcs` allows to specify [default rule set](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options#setting-the-default-coding-standard) in and [standards path](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options#setting-the-installed-standard-paths) the following way.

Assuming the following directory structure:

```
vendor/spryker/code-sniffer/                          # Base directory
                           |_ Spryker/                # Rule set name
                                      |_ ruleset.xml  # Rule set

```

The base directory and rule set can be used in configuration now.

```
vendor/bin/phpcs --config-set installed_paths vendor/spryker/code-sniffer/
vendor/bin/phpcs --config-set default_standard Spryker

```

You might need to specify full directory path. Now the tools can be used without `--standard` switch.

Using own project standard
--------------------------

[](#using-own-project-standard)

You can exchange or extend the Spryker coding standard by providing your own ruleset.xml. This can be configured in the Development module config:

```
// DevelopmentConfig.php

    /**
     * Either a relative or full path to the ruleset.xml or a name of an installed
     * standard (see `phpcs -i` for a list of available ones).
     *
     * @return string
     */
    public function getCodingStandard()
    {
        return '/path/to/your/ruleset.xml';
    }
```

If you use it for custom projects, just use `--standard` to point to your ruleset file.

Make sure that you include the Spryker core standard ruleset in your custom one, e.g.:

```

        Spryker Coding Standard for Project.
        Extends main Spryker Coding Standard.
        All sniffs in ./Sniffs/ will be auto loaded

    */src/Generated/*
    */src/Orm/*
    */tests/_support/_generated/*
    */tests/_helpers/*
    */tests/_output/*
    ./data/DE/*

```

If you want to use the `SprykerStrict` standard in your project, you should replace the string:

```

```

with this one:

```

```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance43

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 82.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 ~0 days

Total

2

Last Release

458d ago

Major Versions

0.1.0 → v1.0.02025-02-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/3a6f46aab167bf90c6634014a7228187469903b612df51fe2d2b57f67c6e1c84?d=identicon)[dasann](/maintainers/dasann)

---

Top Contributors

[![dereuromark](https://avatars.githubusercontent.com/u/39854?v=4)](https://github.com/dereuromark "dereuromark (850 commits)")[![stereomon](https://avatars.githubusercontent.com/u/1382877?v=4)](https://github.com/stereomon "stereomon (41 commits)")[![pushokwhite](https://avatars.githubusercontent.com/u/4017411?v=4)](https://github.com/pushokwhite "pushokwhite (33 commits)")[![olhalivitchuk](https://avatars.githubusercontent.com/u/77281282?v=4)](https://github.com/olhalivitchuk "olhalivitchuk (13 commits)")[![zyuzka](https://avatars.githubusercontent.com/u/12764988?v=4)](https://github.com/zyuzka "zyuzka (11 commits)")[![asmarovydlo](https://avatars.githubusercontent.com/u/15832795?v=4)](https://github.com/asmarovydlo "asmarovydlo (8 commits)")[![serhiisikachov](https://avatars.githubusercontent.com/u/18240804?v=4)](https://github.com/serhiisikachov "serhiisikachov (7 commits)")[![ehsanmx](https://avatars.githubusercontent.com/u/7711957?v=4)](https://github.com/ehsanmx "ehsanmx (7 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (6 commits)")[![gerner-spryker](https://avatars.githubusercontent.com/u/30629375?v=4)](https://github.com/gerner-spryker "gerner-spryker (5 commits)")[![geega](https://avatars.githubusercontent.com/u/1426310?v=4)](https://github.com/geega "geega (4 commits)")[![AsonUnique](https://avatars.githubusercontent.com/u/20453760?v=4)](https://github.com/AsonUnique "AsonUnique (4 commits)")[![a-sabaa](https://avatars.githubusercontent.com/u/1667759?v=4)](https://github.com/a-sabaa "a-sabaa (3 commits)")[![demkos](https://avatars.githubusercontent.com/u/2093777?v=4)](https://github.com/demkos "demkos (3 commits)")[![levacic](https://avatars.githubusercontent.com/u/1636354?v=4)](https://github.com/levacic "levacic (3 commits)")[![limeeugenia](https://avatars.githubusercontent.com/u/25685017?v=4)](https://github.com/limeeugenia "limeeugenia (3 commits)")[![sylvain-spryker](https://avatars.githubusercontent.com/u/43747610?v=4)](https://github.com/sylvain-spryker "sylvain-spryker (3 commits)")[![vol4onok](https://avatars.githubusercontent.com/u/5063777?v=4)](https://github.com/vol4onok "vol4onok (2 commits)")[![lmanzke](https://avatars.githubusercontent.com/u/7486693?v=4)](https://github.com/lmanzke "lmanzke (2 commits)")[![localheinz](https://avatars.githubusercontent.com/u/605483?v=4)](https://github.com/localheinz "localheinz (2 commits)")

---

Tags

standardsphpcsframeworkstatic analysiscodesniffer

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dasann-code-sniffer/health.svg)

```
[![Health](https://phpackages.com/badges/dasann-code-sniffer/health.svg)](https://phpackages.com/packages/dasann-code-sniffer)
```

###  Alternatives

[spryker/code-sniffer

Spryker Code Sniffer Standards

374.1M2.3k](/packages/spryker-code-sniffer)[cakephp/cakephp-codesniffer

CakePHP CodeSniffer Standards

23711.0M658](/packages/cakephp-cakephp-codesniffer)[drupal/coder

Coder is a library to review Drupal code.

3043.6M461](/packages/drupal-coder)[yiisoft/yii2-coding-standards

Yii PHP Framework Version 2 - Coding standard tools

1831.0M165](/packages/yiisoft-yii2-coding-standards)[yoast/yoastcs

PHP\_CodeSniffer rules for Yoast projects

221.1M29](/packages/yoast-yoastcs)[mayflower/mo4-coding-standard

PHP CodeSniffer ruleset implementing the MO4 coding standards extending the Symfony coding standards.

17508.3k5](/packages/mayflower-mo4-coding-standard)

PHPackages © 2026

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