Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is
duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
21
/**
22
* This is an Collision Phpunit Adapter implementation.
23
*
24
* @internal
25
*/
26
final class Printer extends \PHPUnit\Util\Printer implements \PHPUnit\Framework\TestListener
The interface PHPUnit\Framework\TestListener has been deprecated with message: Use the `TestHook` interfaces instead
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be
removed from the class and what other constant to use instead.
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
39
/**
40
* This is an Collision Phpunit Adapter implementation.
41
*
42
* @internal
43
*/
44
final class Printer implements \PHPUnit\TextUI\ResultPrinter
The type NunoMaduro\Collision\Adapters\Phpunit\Printer has been defined more than once; this definition is ignored, only the first definition in this file (L26-29) 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...
45
{
46
use PrinterContents;
47
48
/**
49
* Intentionally left blank as we output things on events of the listener.
50
*/
51
public function printResult(\PHPUnit\Framework\TestResult $result): void
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.