These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Spatie\SchemaOrg; |
||
4 | |||
5 | interface Type |
||
0 ignored issues
–
show
|
|||
6 | { |
||
7 | /** |
||
8 | * Return an array representation of the type. If the array contains child |
||
9 | * types, their context needs to be stripped if it's the same. |
||
10 | * |
||
11 | * @return array |
||
12 | */ |
||
13 | public function toArray(): array; |
||
14 | |||
15 | /** |
||
16 | * Create a json-ld script tag for this type, built from the data that |
||
17 | * `toArray` returns. |
||
18 | * |
||
19 | * @return string |
||
20 | */ |
||
21 | public function toScript(): string; |
||
22 | |||
23 | /** |
||
24 | * Create a json-ld script tag for this type, built from the data that |
||
25 | * `toArray` returns. |
||
26 | * |
||
27 | * @return string |
||
28 | */ |
||
29 | public function __toString(): string; |
||
30 | } |
||
31 |
This check looks for classes that have been defined more than once.
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.