TSSString::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 2
1
<?php
2
/* @description     Transformation Style Sheets - Revolutionising PHP templating    *
3
 * @author          Tom Butler [email protected]                                             *
4
 * @copyright       2017 Tom Butler <[email protected]> | https://r.je/                      *
5
 * @license         http://www.opensource.org/licenses/bsd-license.php  BSD License *
6
 * @version         1.2                                                             */
7
namespace Transphporm\SheetLoader;
8
//Strings do not support caching because we cannot know when the containing PHP script has been modified
9
class TSSString implements TSSRules {
10
	private $str;
11
	private $filePath;
12
13
	public function __construct($str, $filePath) {
14
		$this->str = $str;
15
		$this->filePath = $filePath;
16
	}
17
18
	public function updateRequired($data) {
19
		return true;
20
	}
21
22
	public function getCacheKey($data) {
23
		return '';
24
	}
25
26
	public function getRules($cssToXpath, $valueParser, $sheetLoader, $indexStart) {
27
		return (new \Transphporm\Parser\Sheet($this->str, $cssToXpath, $valueParser, $this->filePath, $sheetLoader))->parse($indexStart);
28
	}
29
30
	public function write($rules, $imports = []) {
31
		return;
32
	}
33
34
	public function setCacheKey($tokens) {
35
		return;
36
	}
37
}