Link::link()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 6
rs 10
ccs 0
cts 5
cp 0
cc 2
nc 2
nop 2
crap 6
1
<?php
2
3
namespace mQueue\View\Helper;
4
5
use Zend_View_Helper_Abstract;
6
7
class Link extends Zend_View_Helper_Abstract
8
{
9
    /**
10
     * Create a link to IMDb page for specified movie.
11
     *
12
     * @param \mQueue\Model\Movie $movie
13
     * @param bool $showUrl
14
     *
15
     * @return string
16
     */
17
    public function link(\mQueue\Model\Movie $movie, $showUrl = false): string
18
    {
19
        $url = $movie->getImdbUrl();
20
        $result = '<a class="imdb' . ($showUrl ? '' : ' hideUrl') . '" title="' . $url . '" href="' . $url . '"><span>&nbsp;' . $url . '</span></a>';
21
22
        return $result;
23
    }
24
}
25