| Total Complexity | 4 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | class CallableEventListenerSpec extends ObjectBehavior |
||
| 22 | { |
||
| 23 | private bool $called = false; |
||
| 24 | public function let() |
||
| 25 | { |
||
| 26 | $callable = function (object $event) { |
||
| 27 | $this->called = true; |
||
| 28 | return $event; |
||
| 29 | }; |
||
| 30 | $this->beConstructedWith($callable); |
||
| 31 | } |
||
| 32 | |||
| 33 | function it_is_initializable() |
||
| 36 | } |
||
| 37 | |||
| 38 | function it_call_callable_on_execute(Event $event) |
||
| 43 | } |
||
| 44 | } |
||
| 46 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.