Passed
Branch new-architecture (764111)
by James
02:34
created

WebServer::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
/**
4
 * This file is, guess what, part of WebHelper.
5
 *
6
 * (c) James <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace JamesRezo\WebHelper\WebServer;
13
14
/**
15
 * Base class for webserver classes.
16
 *
17
 * name can be either apache, nginx, lighttpd, php or other webserver name
18
 *
19
 * @author james <[email protected]>
20
 */
21
abstract class WebServer implements WebServerInterface
22
{
23
    /**
24
     * the name of a webserver.
25
     *
26
     * @var string the name of a webserver
27
     */
28
    private $name;
29
30
    /**
31
     * the version of a webserver.
32
     *
33
     * @var string the version of a webserver
34
     */
35
    private $version;
36
37
    /**
38
     * Constructor.
39
     *
40
     * @param string $name    the name of a webserver
41
     * @param string $version the version of a webserver
42
     */
43 5
    public function __construct($name, $version = '')
44
    {
45 5
        $this->name = $name;
46 5
        $this->version = $version;
47 5
    }
48
49
    /**
50
     * Get the name of a webserver.
51
     *
52
     * @return string the name of the webserver
53
     */
54 1
    public function getName()
55
    {
56 1
        return $this->name;
57
    }
58
59
    /**
60
     * Get the version of a webserver.
61
     *
62
     * @return string the version of the webserver
63
     */
64 1
    public function getVersion()
65
    {
66 1
        return $this->version;
67
    }
68
}
69