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

TestCase

Complexity

Total Complexity 0

Size/Duplication

Total Lines 5
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 0
lcom 0
cbo 0
dl 0
loc 5
c 0
b 0
f 0

1 Method

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