Skip to content

Commit e214aec

Browse files
fain182claude
andcommitted
docs: add IsNotA rule documentation to README
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c45b25f commit e214aec

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,17 @@ $rules[] = Rule::allClasses()
352352

353353
*Note: This rule checks if a class inherits from or implements a given class/interface using PHP's `is_a()` function.*
354354

355+
### Is not a (does not inherit from or implement)
356+
357+
```php
358+
$rules[] = Rule::allClasses()
359+
->that(new ResideInOneOfTheseNamespaces('App\Domain\Event'))
360+
->should(new IsNotA('App\Domain\DeprecatedEvent'))
361+
->because('no event should extend or implement the deprecated base class');
362+
```
363+
364+
*Note: This is the symmetrical counterpart of `IsA`. It fails if a class inherits from or implements the given class/interface.*
365+
355366
### Is abstract
356367

357368
```php

0 commit comments

Comments
 (0)