1 | <?php |
||||||
2 | |||||||
3 | namespace Sfneal\Testing\Utils\Traits; |
||||||
4 | |||||||
5 | use PHPUnit\Framework\Attributes\Test; |
||||||
0 ignored issues
–
show
|
|||||||
6 | |||||||
7 | trait AssertInterface |
||||||
8 | { |
||||||
9 | #[Test] |
||||||
10 | public function interface_exist() |
||||||
11 | { |
||||||
12 | $this->assertTrue( |
||||||
0 ignored issues
–
show
It seems like
assertTrue() must be provided by classes using this trait. How about adding it as abstract method to this trait?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
13 | interface_exists($this->interface()), |
||||||
0 ignored issues
–
show
The method
interface() does not exist on Sfneal\Testing\Utils\Traits\AssertInterface . Did you maybe mean interface_is_implemented() ?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||||||
14 | "The interface '{$this->interface()}' does not exist" |
||||||
15 | ); |
||||||
16 | } |
||||||
17 | |||||||
18 | #[Test] |
||||||
19 | public function interface_is_implemented() |
||||||
20 | { |
||||||
21 | foreach ($this->classes() as $class) { |
||||||
0 ignored issues
–
show
It seems like
classes() must be provided by classes using this trait. How about adding it as abstract method to this trait?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
22 | $this->assertArrayHasKey($this->interface(), class_implements($class)); |
||||||
0 ignored issues
–
show
It seems like
assertArrayHasKey() must be provided by classes using this trait. How about adding it as abstract method to this trait?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
23 | } |
||||||
24 | } |
||||||
25 | |||||||
26 | #[Test] |
||||||
27 | public function interface_methods_exist() |
||||||
28 | { |
||||||
29 | foreach ($this->methods() as $method) { |
||||||
0 ignored issues
–
show
The method
methods() does not exist on Sfneal\Testing\Utils\Traits\AssertInterface . Did you maybe mean interface_methods_exist() ?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||||||
30 | $this->assertTrue( |
||||||
31 | method_exists($this->interface(), $method), |
||||||
32 | "The interface '{$this->interface()}' does not have the method '{$method}'" |
||||||
33 | ); |
||||||
34 | } |
||||||
35 | } |
||||||
36 | } |
||||||
37 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths