Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/backendtea/architect


https://github.com/backendtea/architect

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# Architect

Architect helps enforce architectural decisions in your PHP projects.

For example, you can enforce that the `src/` folder does not use the `test/` folder,
or you can enforce a layered architecture, where you split up your code in a `Domain`, `Application`,
and `Infrastructure` layer, where layers can only have dependencies inward.

Architect is currently very much in beta, so any provided feedback is really helpful.

## Installation

```bash
composer require backendtea/architect --dev
```

## Usage

### Config

Architect uses a php config file, by default it uses `architect.php` in the current directory.
You can pass another file with the `-c` flag if so desired.

A basic configuration file, which checks the `src` and `tests` folder files,
and has the `layered architecture` and `no src to test` rulesets.

```php
paths(Finder::create()
->in('src')
->in('tests')
->name('*.php')
->files())
->addRule(
RuleFactory::layeredArchitecture(),
RuleFactory::noSrcToTest(),
)
;
```

## Running Architect

When you have a configuration, you can run architect with:

```bash
vendor/bin/architect
```