InfoFile::getSize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * This file is part of the Amplexor\XConnect library
4
 *
5
 * @license http://opensource.org/licenses/MIT
6
 * @link https://github.com/amplexor-drupal/xconnect/
7
 * @version 1.0.0
8
 * @package Amplexor.XConnect
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Amplexor\XConnect\Response;
15
16
/**
17
 * Class representing a single delivery file details.
18
 */
19
class InfoFile
20
{
21
    /**
22
     * The \SimpleXml wrapper around the XML data.
23
     *
24
     * @var \SimpleXmlElement
25
     */
26
    private $xml;
27
28
29
    /**
30
     * Construct a new object by passing the SimpleXmlElement.
31
     *
32
     * @param \SimpleXmlElement
33
     */
34 27
    public function __construct(\SimpleXMLElement $xml)
35
    {
36 27
        $this->xml = $xml;
37 27
    }
38
39
    /**
40
     * Get the fileName.
41
     *
42
     * @return string
43
     */
44 6
    public function getName()
45
    {
46 6
        return (string) $this->xml->FileName;
47
    }
48
49
    /**
50
     * Get the FileSize.
51
     *
52
     * @return int
53
     */
54 3
    public function getSize()
55
    {
56 3
        return (int) $this->xml->FileSize;
57
    }
58
59
    /**
60
     * Get the filePath within the Response Zip package.
61
     *
62
     * @return string
63
     */
64 3
    public function getPath()
65
    {
66 3
        return (string) $this->xml->FileReference;
67
    }
68
69
    /**
70
     * Get the source language.
71
     *
72
     * @return string
73
     */
74 3
    public function getSourceLanguage()
75
    {
76 3
        return (string) $this->xml->SourceLangIsoCode;
77
    }
78
79
    /**
80
     * Get the target language.
81
     *
82
     * @return string
83
     */
84 3
    public function getTargetLanguage()
85
    {
86 3
        return (string) $this->xml->TargetLangIsoCode;
87
    }
88
}
89