ContactsSuggestionsExamplePlugin   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A Init() 0 4 1
A MainFabrica() 0 16 3
1
<?php
2
3
class ContactsSuggestionsExamplePlugin extends \RainLoop\Plugins\AbstractPlugin
4
{
5
	public function Init()
6
	{
7
		$this->addHook('main.fabrica', 'MainFabrica');
8
	}
9
10
	/**
11
	 * @param string $sName
12
	 * @param mixed $mResult
13
	 */
14
	public function MainFabrica($sName, &$mResult)
15
	{
16
		switch ($sName)
17
		{
18
			case 'suggestions':
19
20
				if (!\is_array($mResult))
21
				{
22
					$mResult = array();
23
				}
24
25
				include_once __DIR__.'/ContactsExampleSuggestions.php';
26
				$mResult[] = new ContactsExampleSuggestions();
27
				break;
28
		}
29
	}
30
}