Passed
Pull Request — master (#31)
by Josh
03:43
created
lib/Caxy/HtmlDiff/AbstractDiff.php 1 patch
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -147,6 +147,10 @@  discard block
 block discarded – undo
147 147
         return "</".$tag.">";
148 148
     }
149 149
 
150
+    /**
151
+     * @param string $str
152
+     * @param string $start
153
+     */
150 154
     protected function getStringBetween($str, $start, $end)
151 155
     {
152 156
         $expStr = explode( $start, $str, 2 );
@@ -162,6 +166,9 @@  discard block
 block discarded – undo
162 166
         return '';
163 167
     }
164 168
 
169
+    /**
170
+     * @param string $html
171
+     */
165 172
     protected function purifyHtml($html, $tags = null)
166 173
     {
167 174
         if ( class_exists( 'Tidy' ) && false ) {
Please login to merge, or discard this patch.
lib/Caxy/HtmlDiff/ListDiff.php 1 patch
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -505,6 +505,7 @@  discard block
 block discarded – undo
505 505
      * @param string $oldList
506 506
      * @param array $match
507 507
      * @param array $index
508
+     * @param string $type
508 509
      * @return string
509 510
      */
510 511
     protected function addListElementToContent($newList, $oldList, array $match, array $index, $type)
@@ -588,7 +589,7 @@  discard block
 block discarded – undo
588 589
     /**
589 590
      * Converts the list (li) content arrays to string.
590 591
      *
591
-     * @param array $listContentArray
592
+     * @param string $listContentArray
592 593
      * @return string
593 594
      */
594 595
     protected function convertListContentArrayToString($listContentArray)
Please login to merge, or discard this patch.
lib/Caxy/HtmlDiff/Match.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -8,6 +8,9 @@
 block discarded – undo
8 8
     public $startInNew;
9 9
     public $size;
10 10
 
11
+    /**
12
+     * @param integer $size
13
+     */
11 14
     public function __construct($startInOld, $startInNew, $size)
12 15
     {
13 16
         $this->startInOld = $startInOld;
Please login to merge, or discard this patch.
lib/Caxy/HtmlDiff/ListDiff/DiffList.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -14,6 +14,9 @@
 block discarded – undo
14 14
 
15 15
     protected $endTag;
16 16
 
17
+    /**
18
+     * @param null|string $listType
19
+     */
17 20
     public function __construct($listType, $startTag, $endTag, $listItems = array(), $attributes = array())
18 21
     {
19 22
         $this->listType = $listType;
Please login to merge, or discard this patch.
lib/Caxy/HtmlDiff/ListDiffNew.php 1 patch
Doc Comments   +12 added lines patch added patch discarded remove patch
@@ -217,12 +217,18 @@  discard block
 block discarded – undo
217 217
         return $diffList;
218 218
     }
219 219
 
220
+    /**
221
+     * @param string $type
222
+     */
220 223
     protected function isOpeningListTag($word, $type = null)
221 224
     {
222 225
         $filter = $type !== null ? array('<' . $type) : array('<ul', '<ol', '<dl');
223 226
         return in_array(substr($word, 0, 3), $filter);
224 227
     }
225 228
 
229
+    /**
230
+     * @param string $type
231
+     */
226 232
     protected function isClosingListTag($word, $type = null)
227 233
     {
228 234
         $filter = $type !== null ? array('</' . $type) : array('</ul', '</ol', '</dl');
@@ -230,6 +236,9 @@  discard block
 block discarded – undo
230 236
         return in_array(substr($word, 0, 4), $filter);
231 237
     }
232 238
 
239
+    /**
240
+     * @param string $type
241
+     */
233 242
     protected function isOpeningListItemTag($word, $type = null)
234 243
     {
235 244
         $filter = $type !== null ? array('<' . $type) : array('<li', '<dd', '<dt');
@@ -237,6 +246,9 @@  discard block
 block discarded – undo
237 246
         return in_array(substr($word, 0, 3), $filter);
238 247
     }
239 248
 
249
+    /**
250
+     * @param string $type
251
+     */
240 252
     protected function isClosingListItemTag($word, $type = null)
241 253
     {
242 254
         $filter = $type !== null ? array('</' . $type) : array('</li', '</dd', '</dt');
Please login to merge, or discard this patch.
lib/Caxy/HtmlDiff/HtmlDiff.php 1 patch
Doc Comments   +43 added lines patch added patch discarded remove patch
@@ -173,6 +173,9 @@  discard block
 block discarded – undo
173 173
         $this->processInsertOperation( $operation, "diffmod" );
174 174
     }
175 175
 
176
+    /**
177
+     * @param string $cssClass
178
+     */
176 179
     protected function processInsertOperation($operation, $cssClass)
177 180
     {
178 181
         $text = array();
@@ -190,6 +193,9 @@  discard block
 block discarded – undo
190 193
         $this->insertTag( "ins", $cssClass, $text );
191 194
     }
192 195
 
196
+    /**
197
+     * @param string $cssClass
198
+     */
193 199
     protected function processDeleteOperation($operation, $cssClass)
194 200
     {
195 201
         $text = array();
@@ -231,6 +237,10 @@  discard block
 block discarded – undo
231 237
         return $this->diffElements($oldText, $newText, $stripWrappingTags);
232 238
     }
233 239
 
240
+    /**
241
+     * @param string $oldText
242
+     * @param string $newText
243
+     */
234 244
     protected function diffElements($oldText, $newText, $stripWrappingTags = true)
235 245
     {
236 246
         $wrapStart = '';
@@ -253,6 +263,10 @@  discard block
 block discarded – undo
253 263
         return $wrapStart . $diff->build() . $wrapEnd;
254 264
     }
255 265
 
266
+    /**
267
+     * @param string $oldText
268
+     * @param string $newText
269
+     */
256 270
     protected function diffList($oldText, $newText)
257 271
     {
258 272
         $diff = new ListDiffNew($oldText, $newText, $this->encoding, $this->specialCaseTags, $this->groupDiffs);
@@ -261,6 +275,10 @@  discard block
 block discarded – undo
261 275
         return $diff->build();
262 276
     }
263 277
 
278
+    /**
279
+     * @param string $oldText
280
+     * @param string $newText
281
+     */
264 282
     protected function diffTables($oldText, $newText)
265 283
     {
266 284
         $diff = new TableDiff($oldText, $newText, $this->encoding, $this->specialCaseTags, $this->groupDiffs);
@@ -325,6 +343,9 @@  discard block
 block discarded – undo
325 343
         return null;
326 344
     }
327 345
 
346
+    /**
347
+     * @param string $text
348
+     */
328 349
     protected function isListPlaceholder($text)
329 350
     {
330 351
         return $this->isPlaceholderType($text, array('ol', 'dl', 'ul'));
@@ -365,6 +386,9 @@  discard block
 block discarded – undo
365 386
         return in_array($text, $criteria, $strict);
366 387
     }
367 388
 
389
+    /**
390
+     * @param string $text
391
+     */
368 392
     protected function isTablePlaceholder($text)
369 393
     {
370 394
         return in_array($text, array(
@@ -372,6 +396,10 @@  discard block
 block discarded – undo
372 396
         ), true);
373 397
     }
374 398
 
399
+    /**
400
+     * @param Operation $operation
401
+     * @param integer $posInNew
402
+     */
375 403
     protected function findIsolatedDiffTagsInOld($operation, $posInNew)
376 404
     {
377 405
         $offset = $posInNew - $operation->startInNew;
@@ -379,6 +407,9 @@  discard block
 block discarded – undo
379 407
         return $this->oldIsolatedDiffTags[$operation->startInOld + $offset];
380 408
     }
381 409
 
410
+    /**
411
+     * @param string $tag
412
+     */
382 413
     protected function insertTag($tag, $cssClass, &$words)
383 414
     {
384 415
         while (true) {
@@ -440,11 +471,17 @@  discard block
 block discarded – undo
440 471
         return $condition == 'tag' ? $this->isTag( $word ) : !$this->isTag( $word );
441 472
     }
442 473
 
474
+    /**
475
+     * @param string $text
476
+     */
443 477
     protected function wrapText($text, $tagName, $cssClass)
444 478
     {
445 479
         return sprintf( '<%1$s class="%2$s">%3$s</%1$s>', $tagName, $cssClass, $text );
446 480
     }
447 481
 
482
+    /**
483
+     * @param string $condition
484
+     */
448 485
     protected function extractConsecutiveWords(&$words, $condition)
449 486
     {
450 487
         $indexOfFirstTag = null;
@@ -537,6 +574,12 @@  discard block
 block discarded – undo
537 574
         return $matchingBlocks;
538 575
     }
539 576
 
577
+    /**
578
+     * @param integer $startInOld
579
+     * @param integer $endInOld
580
+     * @param integer $startInNew
581
+     * @param integer $endInNew
582
+     */
540 583
     protected function findMatchingBlocks($startInOld, $endInOld, $startInNew, $endInNew, &$matchingBlocks)
541 584
     {
542 585
         $match = $this->findMatch( $startInOld, $endInOld, $startInNew, $endInNew );
Please login to merge, or discard this patch.
lib/Caxy/HtmlDiff/Table/Table.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -39,6 +39,9 @@
 block discarded – undo
39 39
         return isset($this->rows[$index]) ? $this->rows[$index] : null;
40 40
     }
41 41
 
42
+    /**
43
+     * @param double $position
44
+     */
42 45
     public function insertRows($rows, $position = null)
43 46
     {
44 47
         if ($position === null) {
Please login to merge, or discard this patch.
lib/Caxy/HtmlDiff/Table/TableDiff.php 1 patch
Doc Comments   +25 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,6 +58,9 @@  discard block
 block discarded – undo
58 58
 
59 59
     protected $strategy = self::STRATEGY_MATCHING;
60 60
 
61
+    /**
62
+     * @param string $encoding
63
+     */
61 64
     public function __construct($oldText, $newText, $encoding, $specialCaseTags, $groupDiffs)
62 65
     {
63 66
         parent::__construct($oldText, $newText, $encoding, $specialCaseTags, $groupDiffs);
@@ -278,6 +281,10 @@  discard block
 block discarded – undo
278 281
         }
279 282
     }
280 283
 
284
+    /**
285
+     * @param TableRow[] $oldRows
286
+     * @param TableRow[] $newRows
287
+     */
281 288
     protected function processEqualOperation($operation, $oldRows, $newRows, &$appliedRowSpans)
282 289
     {
283 290
         $targetOldRows = array_values(array_slice($oldRows, $operation->startInOld, $operation->endInOld - $operation->startInOld));
@@ -292,6 +299,10 @@  discard block
 block discarded – undo
292 299
         }
293 300
     }
294 301
 
302
+    /**
303
+     * @param TableRow[] $oldRows
304
+     * @param TableRow[] $newRows
305
+     */
295 306
     protected function processReplaceOperation($operation, $oldRows, $newRows, &$appliedRowSpans)
296 307
     {
297 308
         $this->processDeleteOperation($operation, $oldRows, $newRows, $appliedRowSpans, true);
@@ -312,6 +323,12 @@  discard block
 block discarded – undo
312 323
         return $matches;
313 324
     }
314 325
 
326
+    /**
327
+     * @param integer $startInOld
328
+     * @param integer $endInOld
329
+     * @param integer $startInNew
330
+     * @param integer $endInNew
331
+     */
315 332
     protected function findRowMatches($newMatchData, $startInOld, $endInOld, $startInNew, $endInNew, &$matches)
316 333
     {
317 334
         $match = $this->findRowMatch($newMatchData, $startInOld, $endInOld, $startInNew, $endInNew);
@@ -639,6 +656,9 @@  discard block
 block discarded – undo
639 656
         $this->newTable = $this->parseTableStructure(mb_convert_encoding($this->newText, 'HTML-ENTITIES', 'UTF-8'));
640 657
     }
641 658
 
659
+    /**
660
+     * @param string $text
661
+     */
642 662
     protected function parseTableStructure($text)
643 663
     {
644 664
         $dom = new \DOMDocument();
@@ -704,6 +724,10 @@  discard block
 block discarded – undo
704 724
         return trim($domDocument->saveHTML());
705 725
     }
706 726
 
727
+    /**
728
+     * @param \DOMElement $node
729
+     * @param string $html
730
+     */
707 731
     protected function setInnerHtml($node, $html)
708 732
     {
709 733
         // DOMDocument::loadHTML does not allow empty strings.
@@ -738,7 +762,7 @@  discard block
 block discarded – undo
738 762
     }
739 763
 
740 764
     /**
741
-     * @param        $tableRow
765
+     * @param        TableRow|null $tableRow
742 766
      * @param        $currentColumn
743 767
      * @param        $targetColumn
744 768
      * @param        $currentCell
Please login to merge, or discard this patch.