Automattic\WooCommerce\Vendor\Symfony\Component\CssSelector\Node
Specificity::compareTo
Returns -1 if the object specificity is lower than the argument,
0 if they are equal, and 1 if the argument is lower.
Method of the class: Specificity{}
No Hooks.
Returns
null. Nothing (null).
Usage
$Specificity = new Specificity(); $Specificity->compareTo( $specificity ): int;
- $specificity(self) (required)
- .
Specificity::compareTo() Specificity::compareTo code WC 10.7.0
public function compareTo(self $specificity): int
{
if ($this->a !== $specificity->a) {
return $this->a > $specificity->a ? 1 : -1;
}
if ($this->b !== $specificity->b) {
return $this->b > $specificity->b ? 1 : -1;
}
if ($this->c !== $specificity->c) {
return $this->c > $specificity->c ? 1 : -1;
}
return 0;
}