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 — develop ( 2cf000...ea0a44 )
by James
11:34
created

TransferRequest::authorize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * TransferRequest.php
4
 * Copyright (c) 2019 [email protected]
5
 *
6
 * This file is part of Firefly III (https://github.com/firefly-iii).
7
 *
8
 * This program is free software: you can redistribute it and/or modify
9
 * it under the terms of the GNU Affero General Public License as
10
 * published by the Free Software Foundation, either version 3 of the
11
 * License, or (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU Affero General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Affero General Public License
19
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
 */
21
22
namespace FireflyIII\Api\V1\Requests\Search;
23
24
25
use FireflyIII\Api\V1\Requests\Request;
26
use FireflyIII\Rules\IsTransferAccount;
27
28
/**
29
 * Class TransferRequest
30
 */
31
class TransferRequest extends Request
32
{
33
    /**
34
     * Authorize logged in users.
35
     *
36
     * @return bool
37
     */
38
    public function authorize(): bool
39
    {
40
        // Only allow authenticated users
41
        return auth()->check();
42
    }
43
44
    /**
45
     * @return array
46
     */
47
    public function rules(): array
48
    {
49
        return [
50
            'source'      => ['required', new IsTransferAccount],
51
            'destination' => ['required', new IsTransferAccount],
52
            'amount'      => 'required|numeric|more:0',
53
            'description' => 'required|min:1',
54
            'date'        => 'required|date',
55
        ];
56
    }
57
58
}