Completed
Pull Request — master (#47)
by
unknown
03:23
created
src/Parser/CssToXpath.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -50,6 +50,9 @@
 block discarded – undo
50 50
 		return $attr;
51 51
 	}
52 52
 
53
+	/**
54
+	 * @param string $comparator
55
+	 */
53 56
 	private static function compare($comparator, $a, $b) {
54 57
 		if ($comparator == '=') return $a == $b;
55 58
 		else if ($comparator == '!=') return $a != $b;
Please login to merge, or discard this patch.
src/Parser/Sheet.php 1 patch
Doc Comments   +19 added lines patch added patch discarded remove patch
@@ -12,6 +12,9 @@  discard block
 block discarded – undo
12 12
 	private $prefix;
13 13
 	private $valueParser;
14 14
 
15
+	/**
16
+	 * @param string $tss
17
+	 */
15 18
 	public function __construct($tss, $baseDir, Value $valueParser, $prefix = '') {
16 19
 		$this->tss = $this->stripComments($tss, '/*', '*/');
17 20
 		$this->tss = $this->stripComments($this->tss, '//', "\n");
@@ -38,6 +41,10 @@  discard block
 block discarded – undo
38 41
 		return $rules;
39 42
 	}
40 43
 
44
+	/**
45
+	 * @param string $selector
46
+	 * @param integer $index
47
+	 */
41 48
 	private function CssToRules($selector, $index, $properties) {
42 49
 		$parts = explode(',', $selector);
43 50
 		$rules = [];
@@ -60,6 +67,11 @@  discard block
 block discarded – undo
60 67
 		return $rules;
61 68
 	}
62 69
 
70
+	/**
71
+	 * @param integer $pos
72
+	 * @param integer $next
73
+	 * @param integer $indexStart
74
+	 */
63 75
 	private function processingInstructions($tss, $pos, $next, $indexStart) {
64 76
 		$rules = [];
65 77
 		while (($atPos = strpos($tss, '@', $pos)) !== false) {
@@ -90,6 +102,10 @@  discard block
 block discarded – undo
90 102
 		return ($a->depth < $b->depth) ? -1 : 1;
91 103
 	}
92 104
 
105
+	/**
106
+	 * @param string $open
107
+	 * @param string $close
108
+	 */
93 109
 	private function stripComments($str, $open, $close) {
94 110
 		$pos = 0;
95 111
 		while (($pos = strpos($str, $open, $pos)) !== false) {
@@ -100,6 +116,9 @@  discard block
 block discarded – undo
100 116
 		return $str;
101 117
 	}
102 118
 
119
+	/**
120
+	 * @param string $str
121
+	 */
103 122
 	private function getProperties($str) {
104 123
 		$stringExtractor = new StringExtractor($str);
105 124
 		$rules = explode(';', $stringExtractor);
Please login to merge, or discard this patch.
src/Hook/DataFunction.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -11,6 +11,9 @@  discard block
 block discarded – undo
11 11
 	private $data;
12 12
 	private $baseDir;
13 13
 
14
+	/**
15
+	 * @param string $baseDir
16
+	 */
14 17
 	public function __construct(\SplObjectStorage $objectStorage, $data, $baseDir) {
15 18
 		$this->dataStorage = $objectStorage;
16 19
 		$this->data = $data;
@@ -74,6 +77,9 @@  discard block
 block discarded – undo
74 77
 		return $obj;
75 78
 	}
76 79
 
80
+	/**
81
+	 * @param \Transphporm\Parser\Value $valueParser
82
+	 */
77 83
 	private function processNestedFunc($part, $obj, $valueParser, $element) {
78 84
 		if (strpos($part, '(') !== false) {
79 85
 			$subObjParser = new \Transphporm\Parser\Value($obj, $valueParser, false);
Please login to merge, or discard this patch.
src/Property/Content.php 1 patch
Doc Comments   +16 added lines patch added patch discarded remove patch
@@ -11,6 +11,9 @@  discard block
 block discarded – undo
11 11
 	private $formatter;
12 12
 
13 13
 
14
+	/**
15
+	 * @param \Transphporm\Hook\DataFunction $data
16
+	 */
14 17
 	public function __construct($data, &$headers, \Transphporm\Hook\Formatter $formatter) {
15 18
 		$this->data = $data;
16 19
 		$this->headers = &$headers;
@@ -34,6 +37,10 @@  discard block
 block discarded – undo
34 37
 		return (isset($rules['content-mode'])) ? $rules['content-mode'] : 'append';
35 38
 	}
36 39
 
40
+	/**
41
+	 * @param \DOMElement $element
42
+	 * @param \Transphporm\Hook\PseudoMatcher $pseudoMatcher
43
+	 */
37 44
 	private function processPseudo($value, $element, $pseudoMatcher) {
38 45
 		$pseudoContent = ['attr', 'header', 'before', 'after'];
39 46
 		foreach ($pseudoContent as $pseudo) {
@@ -91,6 +98,9 @@  discard block
 block discarded – undo
91 98
 		foreach ($remove as $r) $r->parentNode->removeChild($r);
92 99
 	}
93 100
 
101
+	/**
102
+	 * @param \DOMElement $element
103
+	 */
94 104
 	private function replaceContent($element, $content) {
95 105
 		//If this rule was cached, the elements that were added last time need to be removed prior to running the rule again.
96 106
 		$this->removeAdded($element);
@@ -100,12 +110,18 @@  discard block
 block discarded – undo
100 110
 		$element->setAttribute('transphporm', 'remove');
101 111
 	}
102 112
 
113
+	/**
114
+	 * @param \DOMElement $element
115
+	 */
103 116
 	private function appendContent($element, $content) {
104 117
 		foreach ($this->getNode($content, $element->ownerDocument) as $node) {
105 118
 			$element->appendChild($node);
106 119
 		}
107 120
 	}
108 121
 	
122
+	/**
123
+	 * @param \DOMElement $element
124
+	 */
109 125
 	private function removeAllChildren($element) {
110 126
 		while ($element->hasChildNodes()) $element->removeChild($element->firstChild);
111 127
 	}
Please login to merge, or discard this patch.
src/Property/Repeat.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -8,6 +8,9 @@  discard block
 block discarded – undo
8 8
 class Repeat implements \Transphporm\Property {
9 9
 	private $data;
10 10
 
11
+	/**
12
+	 * @param \Transphporm\Hook\DataFunction $data
13
+	 */
11 14
 	public function __construct($data) {
12 15
 		$this->data = $data;
13 16
 	}
@@ -34,6 +37,9 @@  discard block
 block discarded – undo
34 37
 		return false;
35 38
 	}
36 39
 
40
+	/**
41
+	 * @param \Transphporm\Hook\PseudoMatcher $pseudoMatcher
42
+	 */
37 43
 	private function createHook($newRules, $pseudoMatcher, $properties) {
38 44
 		$hook = new \Transphporm\Hook\PropertyHook($newRules, $pseudoMatcher, new \Transphporm\Parser\Value($this->data));
39 45
 		foreach ($properties as $name => $property) $hook->registerProperty($name, $property);
Please login to merge, or discard this patch.
src/Parser/Value.php 1 patch
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -49,6 +49,10 @@  discard block
 block discarded – undo
49 49
 		return $result;	
50 50
 	}
51 51
 
52
+	/**
53
+	 * @param string $function
54
+	 * @param \DOMElement $element
55
+	 */
52 56
 	private function parseString($function, $element) {
53 57
 		$result = [];
54 58
 		if ($function && in_array($function[0], ['\'', '"'])) {
@@ -102,6 +106,9 @@  discard block
 block discarded – undo
102 106
 		else return call_user_func_array([$obj, $func], $params);
103 107
 	}
104 108
 
109
+	/**
110
+	 * @param string $remaining
111
+	 */
105 112
 	private function parseNextValue($remaining, $result, $element) {
106 113
 		if (strlen($remaining) > 0 && $remaining[0] == ',') $result = array_merge($result, $this->parse(trim(substr($remaining, 1)), $element));
107 114
 		return $result;
Please login to merge, or discard this patch.