1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Copyright (c) Enalean, 2013. All Rights Reserved. |
4
|
|
|
* |
5
|
|
|
* This file is a part of Tuleap. |
6
|
|
|
* |
7
|
|
|
* Tuleap is free software; you can redistribute it and/or modify |
8
|
|
|
* it under the terms of the GNU General Public License as published by |
9
|
|
|
* the Free Software Foundation; either version 2 of the License, or |
10
|
|
|
* (at your option) any later version. |
11
|
|
|
* |
12
|
|
|
* Tuleap is distributed in the hope that it will be useful, |
13
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15
|
|
|
* GNU General Public License for more details. |
16
|
|
|
* |
17
|
|
|
* You should have received a copy of the GNU General Public License |
18
|
|
|
* along with Tuleap. If not, see <http://www.gnu.org/licenses/>. |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
class Cardwall_RendererBoardBuilder { |
22
|
|
|
|
23
|
|
|
/** @var Cardwall_CardInCellPresenterBuilder */ |
24
|
|
|
private $presenter_builder; |
25
|
|
|
|
26
|
|
|
/** @var Tracker_ArtifactFactory */ |
27
|
|
|
private $artifact_factory; |
28
|
|
|
|
29
|
|
|
private $swimline_factory; |
30
|
|
|
|
31
|
|
|
public function __construct(Cardwall_CardInCellPresenterBuilder $presenter_builder, Tracker_ArtifactFactory $artifact_factory, Cardwall_SwimlineFactory $swimline_factory) { |
32
|
|
|
$this->presenter_builder = $presenter_builder; |
33
|
|
|
$this->artifact_factory = $artifact_factory; |
34
|
|
|
$this->swimline_factory = $swimline_factory; |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* Get the board |
39
|
|
|
* |
40
|
|
|
* @param array $artifact_ids |
41
|
|
|
* @param Cardwall_OnTop_Config_ColumnCollection $columns |
42
|
|
|
* @param Cardwall_MappingCollection $mappings_collection |
|
|
|
|
43
|
|
|
* @return \Cardwall_Board |
44
|
|
|
*/ |
45
|
|
|
public function getBoard(array $artifact_ids, Cardwall_OnTop_Config_ColumnCollection $columns, Cardwall_MappingCollection $mapping_collection) { |
46
|
|
|
return new Cardwall_Board($this->getSwimlines($artifact_ids, $columns), $columns, $mapping_collection); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
private function getSwimlines(array $artifact_ids, Cardwall_OnTop_Config_ColumnCollection $columns) { |
50
|
|
|
return array(new Cardwall_SwimlineTrackerRenderer($this->swimline_factory->getCells( |
51
|
|
|
$columns, |
52
|
|
|
$this->getCardsPresenters($artifact_ids) |
53
|
|
|
))); |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
protected function getCardsPresenters(array $artifact_ids) { |
57
|
|
|
$cards = array(); |
58
|
|
|
foreach ($artifact_ids as $id) { |
59
|
|
|
$artifact = $this->artifact_factory->getArtifactById($id); |
60
|
|
|
$cards[] = $this->presenter_builder->getCardInCellPresenter($artifact, Cardwall_SwimlineTrackerRenderer::FAKE_SWIMLINE_ID_FOR_TRACKER_RENDERER); |
61
|
|
|
} |
62
|
|
|
return $cards; |
63
|
|
|
} |
64
|
|
|
} |
65
|
|
|
?> |
66
|
|
|
|
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$ireland
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.