Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / caxy / php-htmldiff / lib / Caxy / HtmlDiff / Table / TablePosition.php
1 <?php
2
3 namespace Caxy\HtmlDiff\Table;
4
5 /**
6  * Class TablePosition.
7  */
8 class TablePosition
9 {
10     /**
11      * @var int
12      */
13     public $row;
14     /**
15      * @var int
16      */
17     public $cell;
18
19     /**
20      * TablePosition constructor.
21      *
22      * @param int $row
23      * @param int $cell
24      */
25     public function __construct($row, $cell)
26     {
27         $this->row = $row;
28         $this->cell = $cell;
29     }
30
31     /**
32      * @return int
33      */
34     public function getRow()
35     {
36         return $this->row;
37     }
38
39     /**
40      * @return int
41      */
42     public function getCell()
43     {
44         return $this->cell;
45     }
46
47     /**
48      * @return string
49      */
50     public function __toString()
51     {
52         return $this->row.':'.$this->cell;
53     }
54
55     /**
56      * @param TablePosition $a
57      * @param TablePosition $b
58      *
59      * @return int
60      */
61     public static function compare($a, $b)
62     {
63         if ($a->getRow() == $b->getRow()) {
64             return $a->getCell() - $b->getCell();
65         }
66
67         return $a->getRow() - $b->getRow();
68     }
69 }