PHPackages                             spryker/architecture-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. spryker/architecture-sniffer

ActiveLibrary[Framework](/categories/framework)

spryker/architecture-sniffer
============================

Spryker Architecture Sniffer

0.5.9(2mo ago)142.7M↓17.9%2[10 issues](https://github.com/spryker/architecture-sniffer/issues)[3 PRs](https://github.com/spryker/architecture-sniffer/pulls)20MITPHPPHP &gt;=8.2CI passing

Since Apr 8Pushed 2mo ago66 watchersCompare

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

READMEChangelog (10)Dependencies (10)Versions (24)Used By (20)

Architecture Sniffer
====================

[](#architecture-sniffer)

[![CI](https://github.com/spryker/architecture-sniffer/workflows/CI/badge.svg?branch=master)](https://github.com/spryker/architecture-sniffer/actions/workflows/ci.yml)[![Coverage](https://camo.githubusercontent.com/44ba8322a3bd09adaa76cd96cb8bc55a77821ba37c3460c890d742aceb97482c/68747470733a2f2f636f6465636f762e696f2f67682f737072796b65722f6172636869746563747572652d736e69666665722f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d34414b434b4d52673347)](https://codecov.io/gh/spryker/architecture-sniffer)[![Latest Stable Version](https://camo.githubusercontent.com/f4bb38eceebdf9001215bd312357aecf59c8124141a0898b1e2dba6074a98585/68747470733a2f2f706f7365722e707567782e6f72672f737072796b65722f6172636869746563747572652d736e69666665722f762f737461626c652e737667)](https://packagist.org/packages/spryker/architecture-sniffer)[![Minimum PHP Version](https://camo.githubusercontent.com/34a8f393a435452ec3ef7edcb506c3efa0e879b3d8b337d3e1f73e849bf56cc5/687474703a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e322d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/6406aba2f1f5dd0f5b25e0b748f7c8c6c9c974d9db12d617605de69f7aa41350/68747470733a2f2f706f7365722e707567782e6f72672f737072796b65722f6172636869746563747572652d736e69666665722f6c6963656e73652e737667)](https://packagist.org/packages/spryker/architecture-sniffer)[![Total Downloads](https://camo.githubusercontent.com/0c79739e123fe7e0032f0cec7fd42df4ada460d2f8493728cc4c1a9cefec2f0a/68747470733a2f2f706f7365722e707567782e6f72672f737072796b65722f6172636869746563747572652d736e69666665722f642f746f74616c2e737667)](https://packagist.org/packages/spryker/architecture-sniffer)

Architecture Sniffer for Spryker core, eco-system and applications.

Priority Levels
---------------

[](#priority-levels)

- `1`: API and critical
- `2`: Non critical (nice to have)
- `3`: Experimental (inspected code needs further fixing)

We use and recommend minimum priority `2` by default for local and CI checks.

Note: Lower priorities (higher numbers) always include the higher priorities (lower numbers).

Usage
-----

[](#usage)

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

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

```

### Spryker Usage

[](#spryker-usage)

When using Spryker you can use the Spryker CLI console command for it:

```
console code:sniff:architecture [-m ModuleName] [optional-sub-path] -v [-p priority]

```

Verbose output is recommended here.

### Manual Usage

[](#manual-usage)

You can also manually run the Architecture Sniffer from console by using:

```
vendor/bin/phpmd src/Pyz/ (xml|text|html) vendor/spryker/architecture-sniffer/src/ruleset.xml --minimumpriority=2

```

Note: Lower priorities always include the higher priorities in the validation process.

### Including the sniffer in PHPStorm

[](#including-the-sniffer-in-phpstorm)

Add a new custom ruleset under `Editor -> Inspections -> PHP -> PHP Mess Detector validation`. Name it `Architecture Sniffer` for example.

The customer ruleset is defined in `vendor/spryker/architecture-sniffer/src/ruleset.xml`

### Check Mess Detector Settings

[](#check-mess-detector-settings)

Under `Framework & Languages -> PHP -> Mess Detector` you need to define the configuration and set the path to your phpmd (vendor/bin/phpmd). Use local and run `Validate` to see if it works.

Writing new sniffs
------------------

[](#writing-new-sniffs)

Add them to inside src folder and add tests in `tests` with the same folder structure. Don't forget to update `ruleset.xml`.

Every sniff needs a description as full sentence:

```
    protected const RULE = 'Every Foo needs Bar.';

    /**
     * @return string
     */
    public function getDescription(): string
    {
        return static::RULE;
    }
```

Every sniff needs to implement either the `ClassAware`, `FunctionAware`, `InterfaceAware`, or `MethodAware` interface to be recognised. To validate that sniffer recognises your rule, check if your rule is listed in Zed UI &gt; Maintenance &gt; Architecture sniffer.

Also note:

- The rule names must be unique across the rulesets.
- Each rule should contain only one "check".
- Each rule always outputs also the reason (violation), not just the occurrence.

### Setup

[](#setup)

Run

```
./setup.sh

```

and

```
php composer.phar install

```

### Testing

[](#testing)

Don't forget to test your changes:

```
php phpunit.phar

```

### Running code-sniffer on this project

[](#running-code-sniffer-on-this-project)

Make sure this repository is Spryker coding standard conform:

```
php composer.phar cs-check

```

If you want to fix the fixable errors, use

```
php composer.phar cs-fix

```

Once everything is green you can make a PR with your changes.

###  Health Score

60

—

FairBetter than 99% of packages

Maintenance69

Regular maintenance activity

Popularity48

Moderate usage in the ecosystem

Community41

Growing community involvement

Maturity75

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~240 days

Recently: every ~350 days

Total

16

Last Release

87d ago

PHP version history (6 changes)0.1.0PHP &gt;=5.4.16

0.4.1PHP &gt;=7.1

0.5.1PHP &gt;=7.3

0.5.7PHP &gt;=7.4

0.5.8PHP &gt;=8.1

0.5.9PHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10738957?v=4)[Spryker Bot](/maintainers/spryker-bot)[@spryker-bot](https://github.com/spryker-bot)

---

Top Contributors

[![dereuromark](https://avatars.githubusercontent.com/u/39854?v=4)](https://github.com/dereuromark "dereuromark (138 commits)")[![zyuzka](https://avatars.githubusercontent.com/u/12764988?v=4)](https://github.com/zyuzka "zyuzka (73 commits)")[![stereomon](https://avatars.githubusercontent.com/u/1382877?v=4)](https://github.com/stereomon "stereomon (51 commits)")[![pushokwhite](https://avatars.githubusercontent.com/u/4017411?v=4)](https://github.com/pushokwhite "pushokwhite (25 commits)")[![geega](https://avatars.githubusercontent.com/u/1426310?v=4)](https://github.com/geega "geega (22 commits)")[![gerner-spryker](https://avatars.githubusercontent.com/u/30629375?v=4)](https://github.com/gerner-spryker "gerner-spryker (11 commits)")[![a-sabaa](https://avatars.githubusercontent.com/u/1667759?v=4)](https://github.com/a-sabaa "a-sabaa (10 commits)")[![olhalivitchuk](https://avatars.githubusercontent.com/u/77281282?v=4)](https://github.com/olhalivitchuk "olhalivitchuk (9 commits)")[![profuel](https://avatars.githubusercontent.com/u/3640652?v=4)](https://github.com/profuel "profuel (8 commits)")[![asaulenko](https://avatars.githubusercontent.com/u/20285714?v=4)](https://github.com/asaulenko "asaulenko (6 commits)")[![FabianWesner](https://avatars.githubusercontent.com/u/2893035?v=4)](https://github.com/FabianWesner "FabianWesner (4 commits)")[![alex-galych](https://avatars.githubusercontent.com/u/18210425?v=4)](https://github.com/alex-galych "alex-galych (3 commits)")[![gechetspr](https://avatars.githubusercontent.com/u/42143273?v=4)](https://github.com/gechetspr "gechetspr (3 commits)")[![spryker-release-bot](https://avatars.githubusercontent.com/u/26904324?v=4)](https://github.com/spryker-release-bot "spryker-release-bot (3 commits)")[![romanhavrylko](https://avatars.githubusercontent.com/u/70894038?v=4)](https://github.com/romanhavrylko "romanhavrylko (3 commits)")[![asmarovydlo](https://avatars.githubusercontent.com/u/15832795?v=4)](https://github.com/asmarovydlo "asmarovydlo (3 commits)")[![AsonUnique](https://avatars.githubusercontent.com/u/20453760?v=4)](https://github.com/AsonUnique "AsonUnique (2 commits)")[![oliwier-spryker](https://avatars.githubusercontent.com/u/13624598?v=4)](https://github.com/oliwier-spryker "oliwier-spryker (2 commits)")[![vitaliiivanovspryker](https://avatars.githubusercontent.com/u/70893950?v=4)](https://github.com/vitaliiivanovspryker "vitaliiivanovspryker (2 commits)")[![PhilinTv](https://avatars.githubusercontent.com/u/376033?v=4)](https://github.com/PhilinTv "PhilinTv (1 commits)")

---

Tags

standardsframeworkarchitecturesniffer

###  Code Quality

TestsCodeception

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/spryker-architecture-sniffer/health.svg)

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.7k509.9M17.0k](/packages/laravel-framework)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[silverstripe/framework

The SilverStripe framework

7213.5M2.5k](/packages/silverstripe-framework)[pestphp/pest-plugin-arch

The Arch plugin for Pest PHP.

4145.8M4.0k](/packages/pestphp-pest-plugin-arch)[lucidarch/lucid

An architecture for scalable software.

326307.6k2](/packages/lucidarch-lucid)[pestphp/pest-plugin-drift

The Pest Drift Plugin

734.0M74](/packages/pestphp-pest-plugin-drift)

PHPackages © 2026

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