Completed
Push — master ( b204a6...201771 )
by Tim
05:41
created

DatabaseRecordLinkBuilder::build()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 3
nc 2
nop 4
1
<?php
2
3
declare(strict_types=1);
4
5
namespace HDNET\Calendarize\Typolink;
6
7
/**
8
 * DatabaseRecordLinkBuilder.
9
 */
10
class DatabaseRecordLinkBuilder extends \TYPO3\CMS\Frontend\Typolink\DatabaseRecordLinkBuilder
11
{
12
    public function build(array &$linkDetails, string $linkText, string $target, array $conf): array
13
    {
14
        if (isset($linkDetails['identifier']) && 'tx_calendarize_domain_model_event' === $linkDetails['identifier']) {
15
            $eventId = $linkDetails['uid'];
0 ignored issues
show
Unused Code introduced by
$eventId is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
16
17
            // @todo handle Link Building
18
        }
19
20
        parent::build($linkDetails, $linkText, $target, $conf);
21
    }
22
}
23