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

ADORecordSet   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 5
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
dl 0
loc 5
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A count() 0 3 1
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