Completed
Pull Request — master (#71)
by Sullivan
01:27
created

TestCase::getMock()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace SLLH\ComposerVersionsCheck\Tests;
4
5
// PHPUnit >=6 Backward Compatibility
6
if (class_exists('\PHPUnit\Framework\TestCase')) {
7
  abstract class TestCase extends \PHPUnit\Framework\TestCase {
8
    public function getMock($class) {
9
      return $this->getMockBuilder($class)->getMock();
10
    }
11
  }
12
} else {
13
  abstract class TestCase extends \PHPUnit_Framework_TestCase {}
0 ignored issues
show
Comprehensibility Best Practice introduced by
The type SLLH\ComposerVersionsCheck\Tests\TestCase has been defined more than once; this definition is ignored, only the first definition in this file (L7-11) is considered.

This check looks for classes that have been defined more than once in the same file.

If you can, we would recommend to use standard object-oriented programming techniques. For example, to avoid multiple types, it might make sense to create a common interface, and then multiple, different implementations for that interface.

This also has the side-effect of providing you with better IDE auto-completion, static analysis and also better OPCode caching from PHP.

Loading history...
14
}
15