andrewdyer / andrewdyer/command-bus
Handler validation allows objects without a real handle 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::register()` uses `is_callable([$handler, 'handle'])` to validate that a handler has a public `handle()` method. However, is_callable() returns `true` for any object implementing `__call()`, even if no concrete `handle()` 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á.