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
Push — master ( 59a9cc...f4ef62 )
by
unknown
09:02
created

SuggestBuildCommand   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 22
dl 0
loc 57
rs 10
c 1
b 0
f 0
wmc 6

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 10 1
A execute() 0 24 5
1
<?php
2
3
/**
4
 * (c) Kitodo. Key to digital objects e.V. <[email protected]>
5
 *
6
 * This file is part of the Kitodo and TYPO3 projects.
7
 *
8
 * @license GNU General Public License version 3 or later.
9
 * For the full copyright and license information, please read the
10
 * LICENSE.txt file that was distributed with this source code.
11
 */
12
13
namespace Kitodo\Dlf\Command;
14
15
use Kitodo\Dlf\Common\Solr\Solr;
16
use Symfony\Component\Console\Command\Command;
17
use Symfony\Component\Console\Input\InputInterface;
18
use Symfony\Component\Console\Input\InputOption;
19
use Symfony\Component\Console\Output\OutputInterface;
20
use Symfony\Component\Console\Style\SymfonyStyle;
21
22
/**
23
 * CLI Command for sending the suggest.build=true command to the index.
24
 *
25
 * @package TYPO3
26
 * @subpackage dlf
27
 *
28
 * @access public
29
 */
30
class SuggestBuildCommand extends Command
31
{
32
33
    /**
34
     * Configure the command by defining the name, options and arguments
35
     *
36
     * @access public
37
     *
38
     * @return void
39
     */
40
    public function configure(): void
41
    {
42
        $this
43
            ->setDescription('Sending the suggest.build=true command to the index.')
44
            ->setHelp('')
45
            ->addOption(
46
                'solr',
47
                's',
48
                InputOption::VALUE_REQUIRED,
49
                '[UID|index_name] of the Solr core for suggest.build=true.'
50
            );
51
    }
52
53
    /**
54
     * Sending the suggest.build=true command.
55
     *
56
     * @access protected
57
     *
58
     * @param InputInterface $input The input parameters
59
     * @param OutputInterface $output The Symfony interface for outputs on console
60
     *
61
     * @return int
62
     */
63
    protected function execute(InputInterface $input, OutputInterface $output): int
64
    {
65
        $io = new SymfonyStyle($input, $output);
66
        $io->title($this->getDescription());
67
68
        if (empty($input->getOption('solr')) || is_array($input->getOption('solr'))) {
69
                $io->error('ERROR: Required parameter --solr|-s is missing or array.');
70
                return BaseCommand::FAILURE;
71
        }
72
73
        // Get Solr instance.
74
        $solr = Solr::getInstance($input->getOption('solr'));
75
        // Connect to Solr server.
76
        if (!$solr->ready) {
77
            $io->error('ERROR: Connection to Solr core ("' . $input->getOption('solr') . '") not possible \n');
78
            return BaseCommand::FAILURE;
79
        }
80
81
        if (!$solr->suggestBuild()) {
82
            $io->error('ERROR: Sending the command suggest.build=true to Solr core ("' . $input->getOption('solr') . '") not possible \n');
83
            return BaseCommand::FAILURE;
84
        }
85
86
        return BaseCommand::SUCCESS;
87
    }
88
}
89