Skip to content

Commit

Permalink
Fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
janedbal committed Dec 6, 2024
1 parent 91af662 commit 24f6f41
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- 🔗 **Transitive dead** member detection
- 🧹 **Automatic removal** of unused code
- 📚 **Popular libraries** support
-**Customizable** entrypoints
-**Customizable** usage providers

## Installation:

Expand Down Expand Up @@ -67,7 +67,7 @@ All those libraries are autoenabled when found within your composer dependencies
# phpstan.neon.dist
parameters:
shipmonkDeadCode:
entrypoints:
usageProviders:
phpunit:
enabled: true
```
Expand Down Expand Up @@ -95,7 +95,7 @@ use ShipMonk\PHPStan\DeadCode\Provider\SimpleMethodUsageProvider;
class ApiOutputMethodUsageProvider extends SimpleMethodUsageProvider
{

public function isEntrypointMethod(ReflectionMethod $method): bool
public function shouldMarkMethodAsUsed(ReflectionMethod $method): bool
{
return $method->getDeclaringClass()->implementsInterface(ApiOutput::class);
}
Expand Down Expand Up @@ -202,12 +202,12 @@ parameters:
#### 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`:
- The easiest way to ignore it is via custom `MethodUsageProvider`:

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

0 comments on commit 24f6f41

Please sign in to comment.