Conditions | 5 |
Paths | 5 |
Total Lines | 23 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
27 | 4 | public function alternateFormats(array $formats, $title = null) |
|
28 | { |
||
29 | 4 | $formatLinks = []; |
|
30 | 4 | foreach ($formats as $format => $url) { |
|
31 | // Inject format and locale parameters |
||
32 | 4 | if (mb_strpos($url, '?') === false) { |
|
33 | 3 | $url .= '?'; |
|
34 | } else { |
||
35 | 1 | $url .= '&'; |
|
36 | } |
||
37 | |||
38 | 4 | $url .= 'format=' . $format . '&lang=' . Zend_Registry::get('Zend_Locale')->getLanguage(); |
|
39 | |||
40 | 4 | $formatLinks[] = '<a class="' . $format . '" href="' . $url . '">' . self::$supportedFormats[$format]['name'] . '</a>'; |
|
41 | 4 | if ($title && isset(self::$supportedFormats[$format]['mime'])) { |
|
42 | 4 | $this->view->headLink()->appendAlternate($url, self::$supportedFormats[$format]['mime'], $title); |
|
43 | } |
||
44 | } |
||
45 | |||
46 | 4 | $result = '<p class="alternateFormats">' . $this->view->translate('Also available in:') . ' ' . implode(' | ', $formatLinks) . '</p>'; |
|
47 | |||
48 | 4 | return $result; |
|
49 | } |
||
50 | } |
||
51 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.