WithConstructorInjection   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 12
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
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
18
/**
19
 * Model with constructor injection
20
 * @SlotFor(ConstructorInjected)
21
 *
22
 * @see ConstructorInjected
23
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
24
 */
25
class WithConstructorInjection implements AnnotatedInterface
26
{
27
28
	public function __construct(ConstructorInjected $signal = null)
29
	{
30
		if(!empty($signal))
31
		{
32
			$signal->emitted = true;
33
		}
34
	}
35
36
}
37