Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/css-selector/Node/Specificity.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
| author | Chris Cannam |
|---|---|
| date | Mon, 23 Apr 2018 09:46:53 +0100 |
| parents | 4c8ae668cc8c |
| children | c2387f117808 |
comparison
equal
deleted
inserted
replaced
| 13:5fb285c0d0e3 | 14:1fec387a4317 |
|---|---|
| 27 { | 27 { |
| 28 const A_FACTOR = 100; | 28 const A_FACTOR = 100; |
| 29 const B_FACTOR = 10; | 29 const B_FACTOR = 10; |
| 30 const C_FACTOR = 1; | 30 const C_FACTOR = 1; |
| 31 | 31 |
| 32 /** | |
| 33 * @var int | |
| 34 */ | |
| 35 private $a; | 32 private $a; |
| 36 | |
| 37 /** | |
| 38 * @var int | |
| 39 */ | |
| 40 private $b; | 33 private $b; |
| 41 | |
| 42 /** | |
| 43 * @var int | |
| 44 */ | |
| 45 private $c; | 34 private $c; |
| 46 | 35 |
| 47 /** | 36 /** |
| 48 * Constructor. | |
| 49 * | |
| 50 * @param int $a | 37 * @param int $a |
| 51 * @param int $b | 38 * @param int $b |
| 52 * @param int $c | 39 * @param int $c |
| 53 */ | 40 */ |
| 54 public function __construct($a, $b, $c) | 41 public function __construct($a, $b, $c) |
| 57 $this->b = $b; | 44 $this->b = $b; |
| 58 $this->c = $c; | 45 $this->c = $c; |
| 59 } | 46 } |
| 60 | 47 |
| 61 /** | 48 /** |
| 62 * @param Specificity $specificity | |
| 63 * | |
| 64 * @return self | 49 * @return self |
| 65 */ | 50 */ |
| 66 public function plus(Specificity $specificity) | 51 public function plus(Specificity $specificity) |
| 67 { | 52 { |
| 68 return new self($this->a + $specificity->a, $this->b + $specificity->b, $this->c + $specificity->c); | 53 return new self($this->a + $specificity->a, $this->b + $specificity->b, $this->c + $specificity->c); |
| 80 | 65 |
| 81 /** | 66 /** |
| 82 * Returns -1 if the object specificity is lower than the argument, | 67 * Returns -1 if the object specificity is lower than the argument, |
| 83 * 0 if they are equal, and 1 if the argument is lower. | 68 * 0 if they are equal, and 1 if the argument is lower. |
| 84 * | 69 * |
| 85 * @param Specificity $specificity | |
| 86 * | |
| 87 * @return int | 70 * @return int |
| 88 */ | 71 */ |
| 89 public function compareTo(Specificity $specificity) | 72 public function compareTo(Specificity $specificity) |
| 90 { | 73 { |
| 91 if ($this->a !== $specificity->a) { | 74 if ($this->a !== $specificity->a) { |
