WithMethodInjection::reactOn()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * This software package is licensed under `AGPL-3.0-only, proprietary` license[s].
5
 *
6
 * @package maslosoft/signals
7
 * @license AGPL-3.0-only, proprietary
8
 *
9
 * @copyright Copyright (c) Peter Maselkowski <[email protected]>
10
 * @link https://maslosoft.com/signals/
11
 */
12
13
namespace Maslosoft\SignalsExamples;
14
15
use Maslosoft\Addendum\Interfaces\AnnotatedInterface;
16
use Maslosoft\SignalsExamples\Signals\ConstructorInjected;
17
use Maslosoft\SignalsExamples\Signals\MethodInjected;
18
19
/**
20
 * Model with method injection
21
 *
22
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
23
 */
24
class WithMethodInjection implements AnnotatedInterface
25
{
26
27
	/**
28
	 * @SlotFor(MethodInjected)
29
	 * @param MethodInjected $signal
30
	 */
31
	public function reactOn(MethodInjected $signal)
32
	{
33
		$signal->emitted = true;
34
	}
35
36
}
37