1<?php
2
3
4namespace ComboStrap;
5
6
7use dokuwiki\Cache\CacheParser;
8
9/**
10 * Class CacheResult
11 * @package ComboStrap
12 *
13 * A class to tracks the cache result of each rendering by slot
14 *
15 */
16class CacheResult
17{
18    /**
19     * @var mixed|null
20     */
21    private $result;
22    /**
23     * @var CacheParser
24     */
25    private $cacheParser;
26
27
28    /**
29     * CacheReport constructor.
30     * @param CacheParser $cacheParser
31     */
32    public function __construct(CacheParser $cacheParser)
33    {
34        $this->cacheParser = $cacheParser;
35    }
36
37    public function getKey(): string
38    {
39        return $this->cacheParser->key;
40    }
41
42    public function getPath(): LocalPath
43    {
44        return LocalPath::createFromPathString($this->cacheParser->cache);
45    }
46
47    public function getMode(): string
48    {
49        return $this->cacheParser->mode;
50    }
51
52    public function getMarkupPath(): MarkupPath
53    {
54        return MarkupPath::createMarkupFromId($this->cacheParser->page);
55    }
56
57    public function getResult(): bool
58    {
59        return $this->result;
60    }
61
62    public function setResult($result): CacheResult
63    {
64        $this->result = $result;
65        return $this;
66    }
67
68}
69