Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Pull Request — master (#821)
by
unknown
03:11
created

GetTitleViewHelper::render()   B

Complexity

Conditions 7
Paths 6

Size

Total Lines 19
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 7
eloc 10
c 1
b 0
f 0
nc 6
nop 0
dl 0
loc 19
rs 8.8333
1
<?php
2
/**
3
 * (c) Kitodo. Key to digital objects e.V. <[email protected]>
4
 *
5
 * This file is part of the Kitodo and TYPO3 projects.
6
 *
7
 * @license GNU General Public License version 3 or later.
8
 * For the full copyright and license information, please read the
9
 * LICENSE.txt file that was distributed with this source code.
10
 */
11
12
namespace Kitodo\Dlf\ViewHelpers;
13
14
use Kitodo\Dlf\Common\Doc;
15
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
16
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
17
18
/**
19
 * View helper to determine display title of document.
20
 */
21
class GetTitleViewHelper extends AbstractViewHelper
22
{
23
    public function initializeArguments()
24
    {
25
        parent::initializeArguments();
26
        $this->registerArgument('document', 'array', 'Document to be considered', true);
27
        $this->registerArgument('getTitle', 'boolean', 'Show title of parent document if document has no title itself', true);
28
    }
29
30
    /**
31
     * Wraps the given value
32
     *
33
     * @return string
34
     */
35
    public function render()
36
    {
37
        $document = $this->arguments['document'];
38
        $getTitle = $this->arguments['getTitle'];
39
40
        $title = $document['title'] ?: $document['metsOrderlabel'];
41
42
        if (empty($title) && $getTitle) {
43
            $superiorTitle = Doc::getTitle($document['uid'], true);
44
            if (!empty($superiorTitle)) {
45
                $title = '[' . $superiorTitle . ']';
46
            }
47
        }
48
49
        if (empty($title)) {
50
            $title = LocalizationUtility::translate('noTitle', 'dlf') ?: '';
51
        }
52
53
        return $title;
54
    }
55
}
56