Skip to content

Commit

Permalink
updating readme documentation with new expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
helyakin committed Jan 22, 2024
1 parent 4d468b9 commit f16c7f9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,15 @@ $rules[] = Rule::allClasses()
->because('we want to be sure that aggregates are final classes');
```

### Is readonly

```php
$rules[] = Rule::allClasses()
->that(new ResideInOneOfTheseNamespaces('App\Domain\ValueObjects'))
->should(new IsReadonly())
->because('we want to be sure that value objects are readonly classes');
```

### Is interface

```php
Expand Down Expand Up @@ -296,6 +305,15 @@ $rules[] = Rule::allClasses()
->because('we want to be sure that our adapters are not final classes');
```

### Is not readonly

```php
$rules[] = Rule::allClasses()
->that(new ResideInOneOfTheseNamespaces('App\Domain\Entity'))
->should(new IsNotReadonly())
->because('we want to be sure that there are no readonly entities');
```

### Is not interface

```php
Expand Down

0 comments on commit f16c7f9

Please sign in to comment.