Skip to content
This repository was archived by the owner on Oct 15, 2025. It is now read-only.

Commit dd785bd

Browse files
authoredMay 29, 2024
Merge pull request #10 from Lendable/merge-upstream
2 parents c882099 + 55dc839 commit dd785bd

File tree

62 files changed

+878
-121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+878
-121
lines changed
 
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Architectural test
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
phparkitect:
8+
name: PHPArkitect
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: "Checkout"
14+
uses: actions/checkout@v2
15+
16+
- name: PHPArkitect
17+
uses: docker://phparkitect/arkitect-github-actions:latest
18+
with:
19+
args: check

‎.github/workflows/build.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ jobs:
1111
build:
1212
runs-on: "ubuntu-22.04"
1313
strategy:
14+
fail-fast: false
1415
matrix:
15-
php-versions: [ '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
16+
php-versions: [ '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
1617
coverage-driver: [ 'pcov' ]
1718

1819
steps:
@@ -55,4 +56,3 @@ jobs:
5556
uses: codecov/codecov-action@v1
5657
with:
5758
token: ${{ secrets.CODECOV_TOKEN }}
58-

‎CONTRIBUTORS.md‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,30 @@ Shout out to our top contributors!
44

55
- [AlessandroMinoccheri](https://api.github.com/users/AlessandroMinoccheri)
66
- [fain182](https://api.github.com/users/fain182)
7-
- [micheleorselli](https://api.github.com/users/micheleorselli)
87
- [pfazzi](https://api.github.com/users/pfazzi)
98
- [github-actions[bot]](https://api.github.com/users/github-actions%5Bbot%5D)
10-
- [ricfio](https://api.github.com/users/ricfio)
9+
- [micheleorselli](https://api.github.com/users/micheleorselli)
1110
- [sebastianstucke87](https://api.github.com/users/sebastianstucke87)
11+
- [ricfio](https://api.github.com/users/ricfio)
1212
- [szepeviktor](https://api.github.com/users/szepeviktor)
1313
- [JulienRAVIA](https://api.github.com/users/JulienRAVIA)
14+
- [helyakin](https://api.github.com/users/helyakin)
15+
- [ben-challis](https://api.github.com/users/ben-challis)
1416
- [LuigiCardamone](https://api.github.com/users/LuigiCardamone)
1517
- [annervisser](https://api.github.com/users/annervisser)
1618
- [simivar](https://api.github.com/users/simivar)
17-
- [stephpy](https://api.github.com/users/stephpy)
18-
- [dbu](https://api.github.com/users/dbu)
1919
- [jdomenechbLendable](https://api.github.com/users/jdomenechbLendable)
20+
- [dbu](https://api.github.com/users/dbu)
21+
- [stephpy](https://api.github.com/users/stephpy)
22+
- [marmichalski](https://api.github.com/users/marmichalski)
23+
- [hgraca](https://api.github.com/users/hgraca)
2024
- [frankverhoeven](https://api.github.com/users/frankverhoeven)
2125
- [hectorespert](https://api.github.com/users/hectorespert)
2226
- [jerowork](https://api.github.com/users/jerowork)
2327
- [jkrzefski](https://api.github.com/users/jkrzefski)
2428
- [mloru](https://api.github.com/users/mloru)
29+
- [nikow13](https://api.github.com/users/nikow13)
2530
- [OskarStark](https://api.github.com/users/OskarStark)
2631
- [smortexa](https://api.github.com/users/smortexa)
2732
- [DonCallisto](https://api.github.com/users/DonCallisto)
33+
- [notcgi](https://api.github.com/users/notcgi)

‎README.md‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ $rules[] = Rule::allClasses()
236236
->that(new ResideInOneOfTheseNamespaces('App\Controller'))
237237
->should(new Extend('App\Controller\AbstractController'))
238238
->because('we want to be sure that all controllers extend AbstractController');
239+
240+
You can add multiple parameters, the violation will happen when none of them match
239241
```
240242

241243
### Has an attribute (requires PHP >= 8.0)
@@ -301,6 +303,15 @@ $rules[] = Rule::allClasses()
301303
->because('we want to be sure that aggregates are final classes');
302304
```
303305

306+
### Is readonly
307+
308+
```php
309+
$rules[] = Rule::allClasses()
310+
->that(new ResideInOneOfTheseNamespaces('App\Domain\ValueObjects'))
311+
->should(new IsReadonly())
312+
->because('we want to be sure that value objects are readonly classes');
313+
```
314+
304315
### Is interface
305316

306317
```php
@@ -346,6 +357,15 @@ $rules[] = Rule::allClasses()
346357
->because('we want to be sure that our adapters are not final classes');
347358
```
348359

360+
### Is not readonly
361+
362+
```php
363+
$rules[] = Rule::allClasses()
364+
->that(new ResideInOneOfTheseNamespaces('App\Domain\Entity'))
365+
->should(new IsNotReadonly())
366+
->because('we want to be sure that there are no readonly entities');
367+
```
368+
349369
### Is not interface
350370

351371
```php
@@ -380,14 +400,16 @@ $rules[] = Rule::allClasses()
380400
->that(new ResideInOneOfTheseNamespaces('App\Controller\Admin'))
381401
->should(new NotExtend('App\Controller\AbstractController'))
382402
->because('we want to be sure that all admin controllers not extend AbstractController for security reasons');
403+
404+
You can add multiple parameters, the violation will happen when one of them match
383405
```
384406

385407
### Don't have dependency outside a namespace
386408

387409
```php
388410
$rules[] = Rule::allClasses()
389411
->that(new ResideInOneOfTheseNamespaces('App\Domain'))
390-
->should(new NotHaveDependencyOutsideNamespace('App\Domain', ['Ramsey\Uuid']))
412+
->should(new NotHaveDependencyOutsideNamespace('App\Domain', ['Ramsey\Uuid'], true))
391413
->because('we want protect our domain except for Ramsey\Uuid');
392414
```
393415

0 commit comments

Comments
 (0)