1 | <?php |
||
23 | class ModuleConflict |
||
24 | { |
||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private $conflictingToken; |
||
29 | |||
30 | /** |
||
31 | * @var string[] |
||
32 | */ |
||
33 | private $moduleNames; |
||
34 | |||
35 | /** |
||
36 | * Creates the conflict. |
||
37 | * |
||
38 | * @param string $conflictingToken The token that caused the conflict. |
||
39 | * @param string[] $moduleNames The names of the modules claiming the |
||
40 | * token. |
||
41 | */ |
||
42 | 28 | public function __construct($conflictingToken, array $moduleNames) |
|
53 | |||
54 | /** |
||
55 | * Returns the conflicting repository path. |
||
56 | * |
||
57 | * @return string The conflicting repository path. |
||
58 | */ |
||
59 | 22 | public function getConflictingToken() |
|
63 | |||
64 | /** |
||
65 | * Returns the names of the modules causing the conflict. |
||
66 | * |
||
67 | * @return string[] The name of the first conflicting module. |
||
|
|||
68 | */ |
||
69 | 22 | public function getModuleNames() |
|
73 | |||
74 | /** |
||
75 | * Returns whether the conflict involves a given module name. |
||
76 | * |
||
77 | * @param string $moduleName A module name. |
||
78 | * |
||
79 | * @return bool Returns `true` if the module caused the conflict. |
||
80 | */ |
||
81 | 1 | public function involvesModule($moduleName) |
|
85 | |||
86 | /** |
||
87 | * Returns the opposing module names in the conflict. |
||
88 | * |
||
89 | * @param string $moduleName The name of a module. |
||
90 | * |
||
91 | * @return string[] Returns the names of the opposing modules or an empty |
||
92 | * array if the module is not involved in the conflict. |
||
93 | */ |
||
94 | 1 | public function getOpponents($moduleName) |
|
106 | } |
||
107 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.