1 | <?php |
||
18 | class WorkingCopyConflictTracker |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * Repository connector |
||
23 | * |
||
24 | * @var Connector |
||
25 | */ |
||
26 | protected $repositoryConnector; |
||
27 | |||
28 | /** |
||
29 | * Command config. |
||
30 | * |
||
31 | * @var CommandConfig |
||
32 | */ |
||
33 | protected $commandConfig; |
||
34 | |||
35 | /** |
||
36 | * Conflicts command. |
||
37 | * |
||
38 | * @var ConflictsCommand |
||
39 | */ |
||
40 | protected $conflictsCommand; |
||
41 | |||
42 | /** |
||
43 | * Creates working copy conflict tracker instance. |
||
44 | * |
||
45 | * @param Connector $repository_connector Repository connector. |
||
46 | * @param CommandConfig $command_config Command config. |
||
47 | */ |
||
48 | 11 | public function __construct(Connector $repository_connector, CommandConfig $command_config) |
|
54 | |||
55 | /** |
||
56 | * Adds new conflicts to previously recorded. |
||
57 | * |
||
58 | * @param string $wc_path Working copy path. |
||
59 | * |
||
60 | * @return void |
||
61 | * @throws \LogicException When working copy has no conflicts. |
||
62 | */ |
||
63 | 3 | public function add($wc_path) |
|
76 | |||
77 | /** |
||
78 | * Replaces previously recorded conflicts with new ones. |
||
79 | * |
||
80 | * @param string $wc_path Working copy path. |
||
81 | * |
||
82 | * @return void |
||
83 | * @throws \LogicException When working copy has no conflicts. |
||
84 | */ |
||
85 | 3 | public function replace($wc_path) |
|
95 | |||
96 | /** |
||
97 | * Erases previously recorded conflicts. |
||
98 | * |
||
99 | * @param string $wc_path Working copy path. |
||
100 | * |
||
101 | * @return void |
||
102 | */ |
||
103 | 1 | public function erase($wc_path) |
|
107 | |||
108 | /** |
||
109 | * Returns previously recoded conflicts. |
||
110 | * |
||
111 | * @param string $wc_path Working copy path. |
||
112 | * |
||
113 | * @return array |
||
114 | */ |
||
115 | 7 | public function getNewConflicts($wc_path) |
|
119 | |||
120 | /** |
||
121 | * Returns previously recoded conflicts. |
||
122 | * |
||
123 | * @param string $wc_path Working copy path. |
||
124 | * |
||
125 | * @return array |
||
126 | */ |
||
127 | 6 | public function getRecordedConflicts($wc_path) |
|
135 | |||
136 | /** |
||
137 | * Returns previously recoded conflicts. |
||
138 | * |
||
139 | * @param string $wc_path Working copy path. |
||
140 | * @param array $conflicts Conflicts. |
||
141 | * |
||
142 | * @return void |
||
143 | */ |
||
144 | 5 | protected function setRecordedConflicts($wc_path, array $conflicts) |
|
153 | |||
154 | } |
||
155 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.