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

TestCase

Complexity

Total Complexity 0

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMock() 0 4 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
    {
9
        public function getMock($originalClassName, $methods = [], $arguments = [], $mockClassName = '', $callOriginalConstructor = true, $callOriginalClone = true, $callAutoload = true, $cloneArguments = false, $callOriginalMethods = false, $proxyTarget = mull)
10
        {
11
            return $this->getMockBuilder($originalClassName)->getMock();
12
        }
13
    }
14
} else {
15
    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-13) 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...
16
    {
17
    }
18
}
19