The trait PHPUnit\Framework\TestLi...erDefaultImplementation has been deprecated: The `TestListener` interface is deprecated
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated annotation
22
use /** @scrutinizer ignore-deprecated */ TestListenerDefaultImplementation;
This trait has been deprecated. The supplier of the trait has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the trait will be
removed and what other trait to use instead.
Loading history...
23
24
private IgnoreTestPolicy $ignorePolicy;
25
26
2
public function __construct(IgnoreTestPolicy $ignorePolicy = null)
27
{
28
2
$this->ignorePolicy = $ignorePolicy ?: new NeverIgnoreTestPolicy;
29
}
30
31
2
public function endTest(Test $test, float $time): void
32
{
33
2
$testReflection = new ReflectionObject($test);
34
35
2
if ($this->ignorePolicy->shouldIgnore($testReflection))
36
1
return;
37
38
1
foreach ($testReflection->getProperties() as $prop)
39
{
40
1
if ($prop->isStatic() || strpos($prop->getDeclaringClass()->getName(), 'PHPUnit\\') === 0)
41
1
continue;
42
43
1
unset($test->{$prop->getName()});
44
}
45
}
46
}
47
48
class NeverIgnoreTestPolicy implements IgnoreTestPolicy
49
{
50
1
public function shouldIgnore(ReflectionObject $testReflection): bool
This interface has been deprecated. The supplier of the interface has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the interface will be removed and what other interface to use instead.