NamedSection::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Jalle19\HaPHProxy\Section;
4
5
/**
6
 * Class NamedSection
7
 * @package Jalle19\HaPHProxy\Section
8
 * @author  Sam Stenvall <[email protected]>
9
 * @license GNU General Public License 2.0+
10
 */
11
abstract class NamedSection extends AbstractSection
12
{
13
14
	/**
15
	 * @var string
16
	 */
17
	protected $sectionLine;
18
19
20
	/**
21
	 * ListenSection constructor.
22
	 *
23
	 * @param string $sectionLine
24
	 */
25
	public function __construct($sectionLine)
26
	{
27
		$this->sectionLine = $sectionLine;
28
	}
29
30
31
	/**
32
	 * @return string the name of the section
33
	 */
34
	public function getName()
35
	{
36
		$words = explode(' ', $this->sectionLine, 2);
37
38
		return $words[1];
39
	}
40
41
}
42