Passed
Push — develop ( 9a1b4d...3be2c9 )
by Felipe
03:49
created

ADORecordSet::count()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * PHPPgAdmin v6.0.0-RC9
5
 */
6
7
namespace PHPPgAdmin;
8
9
/**
10
 * @file
11
 * Extends ADORecordSet to let correct inference on PHPDoc params
12
 *
13
 * @package PHPPgAdmin
14
 */
15
16
/**
17
 * Extends ADORecordSet to let correct inference on PHPDoc params.
18
 *
19
 * @package PHPPgAdmin
20
 */
21
class ADORecordSet extends \ADORecordSet implements \Countable
22
{
23
    public function count()
24
    {
25
        return $this->recordCount();
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->recordCount() returns the type the which is incompatible with the return type mandated by Countable::count() of integer.

In the issue above, the returned value is violating the contract defined by the mentioned interface.

Let's take a look at an example:

interface HasName {
    /** @return string */
    public function getName();
}

class Name {
    public $name;
}

class User implements HasName {
    /** @return string|Name */
    public function getName() {
        return new Name('foo'); // This is a violation of the ``HasName`` interface
                                // which only allows a string value to be returned.
    }
}
Loading history...
26
    }
27
}
28