GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

getCardsPresenters()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 8
rs 9.4285
cc 2
eloc 6
nc 2
nop 1
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
0 ignored issues
show
Documentation introduced by
There is no parameter named $mappings_collection. Did you maybe mean $mapping_collection?

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 method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
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