| Conditions | 3 |
| Paths | 4 |
| Total Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | public function create($title, $data) |
||
| 44 | { |
||
| 45 | if (!is_array($data)) { |
||
| 46 | $data = [$data]; |
||
| 47 | } |
||
| 48 | $nbLine = count($data); |
||
| 49 | |||
| 50 | $frame = new Frame(); |
||
| 51 | $frame->setWidth($this->titleWidth + $this->dataWidth + 1); |
||
| 52 | $frame->setHeight(3.5 * $nbLine); |
||
| 53 | |||
| 54 | $frame->addChild($this->factory->createLabel($title, Label::TYPE_TITLE)->setWidth($this->titleWidth)->setTranslate(true)); |
||
| 55 | |||
| 56 | foreach ($data as $i => $dataLine) { |
||
| 57 | $frame->addChild( |
||
| 58 | $this->factory->createLabel($dataLine, Label::TYPE_NORMAL) |
||
| 59 | ->setWidth($this->dataWidth) |
||
| 60 | ->setX($this->titleWidth + 1) |
||
| 61 | ->setY(-3.5 * $i) |
||
| 62 | ); |
||
| 63 | } |
||
| 64 | |||
| 65 | return $frame; |
||
| 66 | } |
||
| 67 | } |
||
| 68 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.