andrewdyer / andrewdyer/command-bus
Middleware validation allows objects without a real execute method
Đang mở
- Ngôn ngữ chính
- PHP
- Star
- 0
- Fork
- 0
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
The `CommandBus::addMiddleware()` uses `is_callable([$middleware, 'execute'])` to validate that middleware has a public `execute()` method. However, `is_callable()` returns `true` for any object implementing `__call()`, even if no concrete `execute()` method exists — contradicting the exception message and documented contract.
Fix: Replace the `is_callable()` check with `method_exists()` + `ReflectionMethod::isPublic():`
```php
isPublic()) {
throw new InvalidArgumentException(...);
}
```
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.