| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 5 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 28 | 7 | public function __construct(PDO $resource) |
|
| 29 | { |
||
| 30 | 7 | $this->checkEnvironment(); |
|
| 31 | 7 | if ($resource->getAttribute(\PDO::ATTR_DRIVER_NAME) != 'mysql') { |
|
| 32 | 1 | $msg = __CLASS__ . " requires pdo connection to be 'mysql'"; |
|
| 33 | 1 | throw new Exception\InvalidArgumentException($msg); |
|
| 34 | } |
||
| 35 | 7 | $this->resource = $resource; |
|
| 36 | 7 | $this->connection = new MysqlConnection($this, $resource); |
|
| 37 | 7 | } |
|
| 38 | |||
| 49 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.