minor #11416 [CssSelector] Rename Specificity->compare() to compareTo() (barryvdh)

This PR was merged into the 2.6-dev branch.

Discussion
----------

[CssSelector] Rename Specificity->compare() to compareTo()

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11404
| License       | MIT
| Doc PR        | -

Update for #11404 as proposed in the comments. `compareTo` was suggested as a better name then `compare`.

Commits
-------

98873b8 Rename Specificity->compare() to compareTo()
This commit is contained in:
Fabien Potencier 2014-07-18 11:03:26 +02:00
commit 397687f345
2 changed files with 3 additions and 3 deletions

View File

@ -83,7 +83,7 @@ class Specificity
* @param Specificity $specificity
* @return int
*/
public function compare(Specificity $specificity)
public function compareTo(Specificity $specificity)
{
if ($this->a !== $specificity->a) {
return $this->a > $specificity->a ? 1 : -1;

View File

@ -39,9 +39,9 @@ class SpecificityTest extends \PHPUnit_Framework_TestCase
}
/** @dataProvider getCompareTestData */
public function testCompare(Specificity $a, Specificity $b, $result)
public function testCompareTo(Specificity $a, Specificity $b, $result)
{
$this->assertEquals($result, $a->compare($b));
$this->assertEquals($result, $a->compareTo($b));
}
public function getCompareTestData()