Skip to content

Commit

Permalink
Readme: mention interface methods (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
janedbal authored Nov 21, 2024
1 parent 81ceba1 commit 305fd8d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,21 @@ parameters:
#### Private constructors:
- Those are never reported as dead as those are often used to deny class instantiation

#### Interface methods:
- If you never call interface method over the interface, but only over its implementors, it gets reported as dead
- But you may want to keep the interface method to force some unification across implementors
- The easiest way to ignore it is via custom `MethodEntrypointProvider`:

```php
class IgnoreDeadInterfaceMethodsProvider extends SimpleMethodEntrypointProvider
{
public function isEntrypointMethod(ReflectionMethod $method): bool
{
return $method->getDeclaringClass()->isInterface();
}
}
```


## Future scope:
- Dead class constant detection
Expand Down

0 comments on commit 305fd8d

Please sign in to comment.