LinkRenderUrl::isApplicable()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 2
ccs 1
cts 1
cp 1
crap 1
rs 10
1
<?php
2
declare(strict_types=1);
3
4
namespace Nexendrie\Menu;
5
6
use Nette\Utils\Validators;
7
8
/**
9
 * LinkRenderUrl
10
 *
11
 * @author Jakub Konečný
12
 */
13 1
final class LinkRenderUrl extends BaseLinkRender {
14
  public function isApplicable(string $link): bool {
15 1
    return Validators::isUrl($link);
16
  }
17
  
18
  public function renderLink(string $link): string {
19 1
    if(!$this->isApplicable($link)) {
20 1
      return "";
21
    }
22 1
    return $link;
23
  }
24
}
25
?>