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 — dev-extbase-fluid (#754)
by Alexander
07:57
created

ListViewController::getFieldWrap()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 2
dl 0
loc 6
rs 10
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\Controller;
13
14
use Kitodo\Dlf\Domain\Model\Metadata;
15
use TYPO3\CMS\Core\Utility\GeneralUtility;
16
use Kitodo\Dlf\Domain\Repository\MetadataRepository;
17
18
/**
19
 * Plugin 'List View' for the 'dlf' extension
20
 *
21
 * @author Sebastian Meyer <[email protected]>
22
 * @author Henrik Lochmann <[email protected]>
23
 * @author Frank Ulrich Weber <[email protected]>
24
 * @package TYPO3
25
 * @subpackage dlf
26
 * @access public
27
 */
28
class ListViewController extends AbstractController
29
{
30
31
    /**
32
     * @var MetadataRepository
33
     */
34
    protected $metadataRepository;
35
36
    /**
37
     * @param MetadataRepository $metadataRepository
38
     */
39
    public function injectMetadataRepository(MetadataRepository $metadataRepository)
40
    {
41
        $this->metadataRepository = $metadataRepository;
42
    }
43
44
    /**
45
     * The main method of the plugin
46
     *
47
     * @return void
48
     */
49
    public function mainAction()
50
    {
51
        $searchRequestData = GeneralUtility::_GPmerged('tx_dlf_search');
52
53
        $searchParams = $searchRequestData['searchParameter'];
54
        $widgetPage = $searchRequestData['widgetPage'];
55
        // solrcore is configured in search plugin and must be passed by parameter
56
        $this->settings['solrcore'] = $searchRequestData['solrcore'];
57
58
        // get all sortable metadata records
59
        $sortableMetadata = $this->metadataRepository->findByIsSortable(true);
0 ignored issues
show
Bug introduced by
The method findByIsSortable() does not exist on Kitodo\Dlf\Domain\Repository\MetadataRepository. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

59
        /** @scrutinizer ignore-call */ 
60
        $sortableMetadata = $this->metadataRepository->findByIsSortable(true);
Loading history...
60
61
        // get all metadata records to be shown in results
62
        $listedMetadata = $this->metadataRepository->findByIsListed(true);
0 ignored issues
show
Bug introduced by
The method findByIsListed() does not exist on Kitodo\Dlf\Domain\Repository\MetadataRepository. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

62
        /** @scrutinizer ignore-call */ 
63
        $listedMetadata = $this->metadataRepository->findByIsListed(true);
Loading history...
63
64
        if (is_array($searchParams) && !empty($searchParams)) {
65
            $solrResults = $this->documentRepository->findSolrByCollection('', $this->settings, $searchParams, $listedMetadata);
0 ignored issues
show
Bug introduced by
'' of type string is incompatible with the type TYPO3\CMS\Extbase\Persistence\Generic\QueryResult expected by parameter $collections of Kitodo\Dlf\Domain\Reposi...:findSolrByCollection(). ( Ignorable by Annotation )

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

65
            $solrResults = $this->documentRepository->findSolrByCollection(/** @scrutinizer ignore-type */ '', $this->settings, $searchParams, $listedMetadata);
Loading history...
66
        }
67
68
        $documents = $solrResults['documents'] ? : [];
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $solrResults does not seem to be defined for all execution paths leading up to this point.
Loading history...
69
        //$this->view->assign('metadata', $sortableMetadata);
70
        $this->view->assign('documents', $documents);
71
        $this->view->assign('widgetPage', $widgetPage);
72
        $this->view->assign('lastSearch', $searchParams);
73
74
        $this->view->assign('listedMetadata', $listedMetadata);
75
        $this->view->assign('sortableMetadata', $sortableMetadata);
76
    }
77
}
78