Completed
Push — master ( ed4ef2...61bf0f )
by Cheren
02:56
created

Cache   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 1
cbo 5
dl 0
loc 23
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A _getResultFile() 0 16 2
1
<?php
2
/**
3
 * CakeCMS Core
4
 *
5
 * This file is part of the of the simple cms based on CakePHP 3.
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 *
9
 * @package   Core
10
 * @license   MIT
11
 * @copyright MIT License http://www.opensource.org/licenses/mit-license.php
12
 * @link      https://github.com/CakeCMS/Core".
13
 * @author    Sergey Kalistratov <[email protected]>
14
 */
15
16
namespace Core\Lib\Less;
17
18
use JBZoo\Utils\FS;
19
use JBZoo\Utils\Str;
20
use JBZoo\Utils\Slug;
21
use JBZoo\Less\Cache as JCache;
22
23
/**
24
 * Class Cache
25
 *
26
 * @package Union\Core\Lib\Less
27
 */
28
class Cache extends JCache
29
{
30
31
    /**
32
     * @return string
33
     */
34
    protected function _getResultFile()
35
    {
36
        //  Normalize relative path
37
        $relPath = Slug::filter($this->_hash, '_');
38
        $relPath = Str::low($relPath);
39
40
        if (!$this->_options->get('debug')) {
41
            $relPath .= '.min';
42
        }
43
44
        //  Get full clean path
45
        $fullPath = FS::real($this->_options->get('cache_path')) . '/' . $relPath . '.css';
46
        $fullPath = FS::clean($fullPath);
47
48
        return $fullPath;
49
    }
50
}
51