HelloWorld::sayHello()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 2
eloc 2
nc 2
nop 1
crap 2
1
<?php
2
namespace CodeDruids\Samples;
3
4
class HelloWorld
5
{
6
	/** @var string Type of person to say hello to */
7
	public static $type = 'Acolyte';
8
9
	/**
10
	 * Simple method to say hello
11
	 * 
12
	 * @param string|null $name The name to say hello to
13
	 * @return string
14
	 */
15 2
	public static function sayHello($name = null)
16
	{
17 2
		return "Hello ".self::$type.(empty($name) ? '' : ' '.((string) $name)).'!';
18
	}
19
}
20