Passed
Push — master ( fb052d...216e58 )
by Paweł
03:25
created

AbstractOutput::getSitemapFileFullPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * This file is part of Wszetko Sitemap.
7
 *
8
 * (c) Paweł Kłopotek-Główczewski <[email protected]>
9
 *
10
 * This source file is subject to the MIT license that is bundled
11
 * with this source code in the file LICENSE.
12
 */
13
14
namespace Wszetko\Sitemap\Drivers\Output;
15
16
use Wszetko\Sitemap\Interfaces\XML;
17
use Wszetko\Sitemap\Traits\Domain;
18
use Wszetko\Sitemap\Traits\IsAssoc;
19
20
/**
21
 * Class AbstractXML.
22
 *
23
 * @package Wszetko\Sitemap\Drivers\XML
24
 */
25
abstract class AbstractOutput implements XML
26
{
27
    use IsAssoc;
28
    use Domain;
29
30
    /**
31
     * @var mixed
32
     */
33
    protected $XMLWriter;
34
35
    /**
36
     * @var string
37
     */
38
    private $currentSitemap;
39
40
    /**
41
     * @var null|string
42
     */
43
    private $workDir;
44
45
    /**
46
     * @return string
47
     */
48
    public function getCurrentSitemap(): string
49
    {
50
        return $this->currentSitemap;
51
    }
52
53
    /**
54
     * @param string $currentSitemap
55
     */
56
    public function setCurrentSitemap(string $currentSitemap): void
57
    {
58
        $this->currentSitemap = $currentSitemap;
59
    }
60
61
    /**
62
     * @return null|string
63
     */
64
    public function getWorkDir(): ?string
65
    {
66
        return $this->workDir;
67
    }
68
69
    /**
70
     * @param string $dir
71
     */
72
    public function setWorkDir(string $dir): void
73
    {
74
        $this->workDir = $dir;
75
    }
76
77
    /**
78
     * @return mixed
79
     */
80
    protected function getXMLWriter()
81
    {
82
        return $this->XMLWriter;
83
    }
84
85
    /**
86
     * @return string
87
     */
88
    protected function getSitemapFileFullPath(): string
89
    {
90
        return ((string) $this->getWorkDir()) . DIRECTORY_SEPARATOR . $this->currentSitemap;
91
    }
92
}
93