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 ( 729110...d7d6ce )
by
unknown
03:40
created

BaseTask::setFrom()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
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
namespace Kitodo\Dlf\Task;
13
14
use Kitodo\Dlf\Common\Helper;
15
use TYPO3\CMS\Core\Messaging\FlashMessage;
16
use TYPO3\CMS\Scheduler\Task\AbstractTask;
17
18
/**
19
 * Base class for Scheduler task classes.
20
 *
21
 * @package TYPO3
22
 * @subpackage dlf
23
 *
24
 * @access public
25
 */
26
class BaseTask extends AbstractTask
27
{
28
29
    /**
30
     * @access protected
31
     * @var bool
32
     */
33
    protected bool $dryRun = false;
34
35
    /**
36
     * @access protected
37
     * @var string
38
     */
39
    protected string $doc = 'https://';
40
41
    /**
42
     * @access protected
43
     * @var int
44
     */
45
    protected int $lib = - 1;
46
47
    /**
48
     * @access protected
49
     * @var int
50
     */
51
    protected int $pid = - 1;
52
53
    /**
54
     * @access protected
55
     * @var array
56
     */
57
    protected array $coll = [];
58
59
    /**
60
     * @access protected
61
     * @var int
62
     */
63
    protected int $solr = 0;
64
65
    /**
66
     * @access protected
67
     * @var string
68
     */
69
    protected string $owner = '';
70
71
    /**
72
     * @access protected
73
     * @var bool
74
     */
75
    protected bool $all = false;
76
77
    /**
78
     * @access protected
79
     * @var string
80
     */
81
    protected string $from = '';
82
83
    /**
84
     * @access protected
85
     * @var string
86
     */
87
    protected string $until = '';
88
89
    /**
90
     * @access protected
91
     * @var string
92
     */
93
    protected string $set = '';
94
95
    public function execute()
96
    {
97
        return true;
98
    }
99
100
    /**
101
     *
102
     * @return bool
103
     */
104
    public function isDryRun(): bool
105
    {
106
        return $this->dryRun;
107
    }
108
109
    /**
110
     *
111
     * @param bool $dryRun
112
     */
113
    public function setDryRun(bool $dryRun): void
114
    {
115
        $this->dryRun = $dryRun;
116
    }
117
118
    /**
119
     *
120
     * @return string
121
     */
122
    public function getDoc(): string
123
    {
124
        return $this->doc;
125
    }
126
127
    /**
128
     *
129
     * @param string $doc
130
     */
131
    public function setDoc(string $doc): void
132
    {
133
        $this->doc = $doc;
134
    }
135
136
    /**
137
     *
138
     * @return int
139
     */
140
    public function getLib(): int
141
    {
142
        return $this->lib;
143
    }
144
145
    /**
146
     *
147
     * @param int $lib
148
     */
149
    public function setLib(int $lib): void
150
    {
151
        $this->lib = $lib;
152
    }
153
154
    /**
155
     *
156
     * @return int
157
     */
158
    public function getPid(): int
159
    {
160
        return $this->pid;
161
    }
162
163
    /**
164
     *
165
     * @param int $pid
166
     */
167
    public function setPid(int $pid): void
168
    {
169
        $this->pid = $pid;
170
    }
171
172
    /**
173
     *
174
     * @return array
175
     */
176
    public function getColl(): array
177
    {
178
        return $this->coll;
179
    }
180
181
    /**
182
     *
183
     * @param array $coll
184
     */
185
    public function setColl(array $coll): void
186
    {
187
        $this->coll = $coll;
188
    }
189
190
    /**
191
     *
192
     * @return int
193
     */
194
    public function getSolr(): int
195
    {
196
        return $this->solr;
197
    }
198
199
    /**
200
     *
201
     * @param int $solr
202
     */
203
    public function setSolr(int $solr): void
204
    {
205
        $this->solr = $solr;
206
    }
207
208
    /**
209
     *
210
     * @return string
211
     */
212
    public function getOwner(): string
213
    {
214
        return $this->owner;
215
    }
216
217
    /**
218
     *
219
     * @param string $owner
220
     */
221
    public function setOwner(string $owner): void
222
    {
223
        $this->owner = $owner;
224
    }
225
226
    /**
227
     *
228
     * @return bool
229
     */
230
    public function isAll(): bool
231
    {
232
        return $this->all;
233
    }
234
235
    /**
236
     *
237
     * @param bool $all
238
     */
239
    public function setAll(bool $all): void
240
    {
241
        $this->all = $all;
242
    }
243
244
    /**
245
     *
246
     * @return string
247
     */
248
    public function getFrom(): string
249
    {
250
        return $this->from;
251
    }
252
253
    /**
254
     *
255
     * @param string $from
256
     */
257
    public function setFrom(string $from): void
258
    {
259
        $this->from = $from;
260
    }
261
262
    /**
263
     *
264
     * @return string
265
     */
266
    public function getUntil(): string
267
    {
268
        return $this->until;
269
    }
270
271
    /**
272
     *
273
     * @param string $until
274
     */
275
    public function setUntil(string $until): void
276
    {
277
        $this->until = $until;
278
    }
279
280
    /**
281
     *
282
     * @return string
283
     */
284
    public function getSet(): string
285
    {
286
        return $this->set;
287
    }
288
289
    /**
290
     *
291
     * @param string $set
292
     */
293
    public function setSet(string $set): void
294
    {
295
        $this->set = $set;
296
    }
297
298
    /**
299
     * Generates and adds flash messages based on a string seperated by PHP_EOL.
300
     *
301
     * @access protected
302
     *
303
     * @param string $message Messages seperated by PHP_EOL
304
     * @param int $severity
305
     *
306
     * @return void
307
     */
308
    protected function outputFlashMessages(string $message, int $severity): void
309
    {
310
        $messages = explode(PHP_EOL, $message);
311
312
        foreach ($messages as $message) {
313
            if (empty($message) || (substr_count($message, '=') == strlen($message))) {
314
                continue;
315
            }
316
317
            Helper::addMessage(
318
                $message,
319
                '',
320
                $severity == FlashMessage::ERROR ? FlashMessage::ERROR : FlashMessage::OK,
321
                true,
322
                'core.template.flashMessages'
323
            );
324
        }
325
    }
326
}
327