PHPackages                             writ3it/cs\_modular-monolith - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. writ3it/cs\_modular-monolith

ActivePhpcodesniffer-standard[PSR &amp; Standards](/categories/psr-standards)

writ3it/cs\_modular-monolith
============================

PHPCS Standards for modular monoliths.

0.9.4(5y ago)213MITPHPPHP &gt;=5.6

Since Dec 30Pushed 5y ago2 watchersCompare

[ Source](https://github.com/writ3it/CS_ModularMonolith)[ Packagist](https://packagist.org/packages/writ3it/cs_modular-monolith)[ RSS](/packages/writ3it-cs-modular-monolith/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (5)Used By (0)

ModularMonolith PHP\_CodeSniffer standard
=========================================

[](#modularmonolith-php_codesniffer-standard)

PHPCS Standards for modular monolith. **This package is under development.**

[![](doc/sample.jpg)](doc/sample.jpg)

Why?
----

[](#why)

There are three good reasons.

#### Reason 1.

[](#reason-1)

PHP doesn't support Java-like packages. This standard is a liberal version of this feature (you can use or not). You can force standard while collaborating through CI/CD process.

#### Reason 2.

[](#reason-2)

Monolith is very popular architecture, but it's a hell for developers. Monolithic application (sooner or later) is often called "legacy code". The alternative - isolation provided by composer package feature often is too strong. Language-level package system offers more flexible module implementation.

#### Reason 3.

[](#reason-3)

Deptrac which has a most similar feature isn't integrated with Phpstorm. PHP\_CodeSniffer is.

Required dependencies
---------------------

[](#required-dependencies)

- squizlabs/php\_codesniffer package
- php &gt;= 5.6
- ext-simplexml

Getting started
---------------

[](#getting-started)

#### Step 1. Install standard in your project

[](#step-1-install-standard-in-your-project)

```
$ composer require --dev writ3it/cs_modular-monolith
```

#### Step 2. Create or extend your phpcs.xml.dist

[](#step-2-create-or-extend-your-phpcsxmldist)

If you have another ruleset file, add the following lines:

```

```

Full example file (Symfony):

```

    bin/
    config/
    public/
    src/
    tests/

```

#### Step 3. Create modules.xml

[](#step-3-create-modulesxml)

modules.xml describes your modules hierarchy and limits module interface to the public source code.

Example file:

```

```

[See file overview](doc/modules_xml_overview.md)

#### Step 4. (CLI) Test your code!

[](#step-4-cli-test-your-code)

Execute in your project root directory:

```
./vendor/bin/phpcs
```

#### Step 4. (PhpStorm) Test your code **on-the-fly**!

[](#step-4-phpstorm-test-your-code-on-the-fly)

[See instructions from JetBrains.](https://www.jetbrains.com/help/phpstorm/using-php-code-sniffer.html)

TODO
----

[](#todo)

- Validation of modules boundaries. (MVP, 1.0)
- Validation of nested modules boundaries.(MVP, 1.0)
- Possible to define public module interface that is accessible through boundaries. (MVP, 1.0)
- Usability improvements. (MVP, 1.0)
- Tests. (1.0)
- Documentation. (1.0)
- Configuration validation. (future)
- Drawing of modules dependency net. (possibly)
- Validation of length of dependency paths. (possibly)
- Validation of dependency cycles. (possibly)

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

[](#contributing)

Before first release contributing is not possible but feel free to make issues.

License
-------

[](#license)

MIT License, [see details.](LICENSE)

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

1957d ago

### Community

Maintainers

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

---

Top Contributors

[![writ3it](https://avatars.githubusercontent.com/u/42292507?v=4)](https://github.com/writ3it "writ3it (41 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/writ3it-cs-modular-monolith/health.svg)

```
[![Health](https://phpackages.com/badges/writ3it-cs-modular-monolith/health.svg)](https://phpackages.com/packages/writ3it-cs-modular-monolith)
```

###  Alternatives

[automattic/vipwpcs

PHP\_CodeSniffer rules (sniffs) to enforce WordPress VIP minimum coding conventions

25510.2M145](/packages/automattic-vipwpcs)[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)[orisai/coding-standard

Strict PHP coding standard

19193.5k62](/packages/orisai-coding-standard)

PHPackages © 2026

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