Passed
Branch develop (56c45f)
by Jens
02:42
created

renderAction()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 4
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 6
nc 3
nop 6
dl 0
loc 4
rs 10
c 1
b 0
f 0
1
<?
2
/**
3
 * @param bool $condition
4
 * @param string $title
5
 * @param string $class
6
 * @param string $href
7
 * @param string $icon
8
 * @param bool $onclick
9
 */
10
function renderAction($condition, $title, $class, $href, $icon, $onclick = false)
11
{ ?>
12
    <? if ($condition) : ?>
13
  <a class="btn <?= $class ?>" title="<?= $title ?>" href="<?= $href ?>"<? if ($onclick !== false) : ?> onclick="<?= $onclick ?>"<? endif ?>><i class="fa fa-<?= $icon ?>"></i></a>
0 ignored issues
show
Bug introduced by
Are you sure $onclick of type true can be used in echo? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

13
  <a class="btn <?= $class ?>" title="<?= $title ?>" href="<?= $href ?>"<? if ($onclick !== false) : ?> onclick="<?= /** @scrutinizer ignore-type */ $onclick ?>"<? endif ?>><i class="fa fa-<?= $icon ?>"></i></a>
Loading history...
14
<? endif
15
    ?>
16
<? } ?>