Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/backendtea/architect
https://github.com/backendtea/architect
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/backendtea/architect
- Owner: BackEndTea
- License: mit
- Created: 2024-08-11T17:18:54.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-20T07:28:20.000Z (5 months ago)
- Last Synced: 2024-09-19T16:08:16.096Z (4 months ago)
- Language: PHP
- Size: 31.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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
```