Park   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 73
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 8
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 73
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getParkFile() 0 4 1
A getAuthor() 0 4 1
A getDescription() 0 4 1
A getPreviewImage() 0 4 1
A isEncrypted() 0 4 1
A getFilesPrefix() 0 4 1
A getCoasterCount() 0 4 1
1
<?php
2
3
namespace Thepixeldeveloper\Nolimits2PackageLoader;
4
5
use SimpleXMLElement;
6
7
class Park
8
{
9
    /**
10
     * @var SimpleXMLElement
11
     */
12
    protected $parkXML;
13
14
    /**
15
     * Park constructor.
16
     *
17
     * @param SimpleXMLElement $simpleXMLElement
18
     */
19
    public function __construct(SimpleXMLElement $simpleXMLElement)
20
    {
21
        $this->parkXML = $simpleXMLElement;
22
    }
23
24
    /**
25
     * @return string
26
     */
27
    public function getParkFile()
28
    {
29
        return (string) $this->parkXML->parkfile;
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    public function getAuthor()
36
    {
37
        return (string) $this->parkXML->author;
38
    }
39
40
    /**
41
     * @return string
42
     */
43
    public function getDescription()
44
    {
45
        return (string) trim($this->parkXML->description);
46
    }
47
48
    /**
49
     * @return string
50
     */
51
    public function getPreviewImage()
52
    {
53
        return (string) $this->parkXML->previewimage;
54
    }
55
56
    /**
57
     * @return bool
58
     */
59
    public function isEncrypted()
60
    {
61
        return (string) $this->parkXML->encrypted === 'true';
62
    }
63
64
    /**
65
     * @return string
66
     */
67
    public function getFilesPrefix()
68
    {
69
        return (string) $this->parkXML->filesprefix;
70
    }
71
72
    /**
73
     * @return int
74
     */
75
    public function getCoasterCount()
76
    {
77
        return count($this->parkXML->coaster);
78
    }
79
}
80