1 | <?php |
||
17 | class CommitMessageBuilder |
||
18 | { |
||
19 | |||
20 | /** |
||
21 | * Repository connector. |
||
22 | * |
||
23 | * @var Connector |
||
24 | */ |
||
25 | protected $repositoryConnector; |
||
26 | |||
27 | /** |
||
28 | * Revision log factory. |
||
29 | * |
||
30 | * @var RevisionLogFactory |
||
31 | */ |
||
32 | protected $revisionLogFactory; |
||
33 | |||
34 | /** |
||
35 | * Working copy conflict tracker. |
||
36 | * |
||
37 | * @var WorkingCopyConflictTracker |
||
38 | */ |
||
39 | protected $workingCopyConflictTracker; |
||
40 | |||
41 | /** |
||
42 | * Creates commit message builder instance. |
||
43 | * |
||
44 | * @param Connector $repository_connector Repository connector. |
||
45 | * @param RevisionLogFactory $revision_log_factory Revision log factory. |
||
46 | * @param WorkingCopyConflictTracker $working_copy_conflict_tracker Working copy conflict tracker. |
||
47 | */ |
||
48 | 6 | public function __construct( |
|
57 | |||
58 | /** |
||
59 | * Builds a commit message. |
||
60 | * |
||
61 | * @param string $wc_path Working copy path. |
||
62 | * @param string|null $changelist Changelist. |
||
63 | * |
||
64 | * @return string |
||
65 | */ |
||
66 | 5 | public function build($wc_path, $changelist = null) |
|
91 | |||
92 | /** |
||
93 | * Returns commit message fragment for merged revisions. |
||
94 | * |
||
95 | * @param string $wc_path Working copy path. |
||
96 | * |
||
97 | * @return string |
||
98 | */ |
||
99 | 5 | protected function getFragmentForMergedRevisions($wc_path) |
|
128 | |||
129 | /** |
||
130 | * Builds commit message heading. |
||
131 | * |
||
132 | * @param string $wc_url Working copy url. |
||
133 | * @param string $path Source path for merge operation. |
||
134 | * |
||
135 | * @return string |
||
136 | */ |
||
137 | 2 | protected function getCommitMessageHeading($wc_url, $path) |
|
141 | |||
142 | /** |
||
143 | * Returns commit message fragment for recent conflicts. |
||
144 | * |
||
145 | * @param string $wc_path Working copy path. |
||
146 | * |
||
147 | * @return string |
||
148 | */ |
||
149 | 5 | protected function getFragmentForRecentConflicts($wc_path) |
|
166 | |||
167 | } |
||
168 |
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.