1
|
|
|
<?php |
2
|
|
|
declare(strict_types=1); |
3
|
|
|
/** |
4
|
|
|
* TransactionController.php |
5
|
|
|
* Copyright (c) 2019 [email protected] |
6
|
|
|
* |
7
|
|
|
* This file is part of Firefly III (https://github.com/firefly-iii). |
8
|
|
|
* |
9
|
|
|
* This program is free software: you can redistribute it and/or modify |
10
|
|
|
* it under the terms of the GNU Affero General Public License as |
11
|
|
|
* published by the Free Software Foundation, either version 3 of the |
12
|
|
|
* License, or (at your option) any later version. |
13
|
|
|
* |
14
|
|
|
* This program is distributed in the hope that it will be useful, |
15
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
16
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17
|
|
|
* GNU Affero General Public License for more details. |
18
|
|
|
* |
19
|
|
|
* You should have received a copy of the GNU Affero General Public License |
20
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
21
|
|
|
*/ |
22
|
|
|
|
23
|
|
|
namespace FireflyIII\Api\V1\Controllers\Search; |
24
|
|
|
|
25
|
|
|
use FireflyIII\Api\V1\Controllers\Controller; |
26
|
|
|
use Illuminate\Http\Request; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* Class TransactionController |
30
|
|
|
*/ |
31
|
|
|
class TransactionController extends Controller |
32
|
|
|
{ |
33
|
|
|
/** @var string */ |
34
|
|
|
public const SEARCH_ALL = 'all'; |
35
|
|
|
/** @var string */ |
36
|
|
|
public const SEARCH_DESCRIPTION = 'description'; |
37
|
|
|
/** @var string */ |
38
|
|
|
public const SEARCH_NOTES = 'notes'; |
39
|
|
|
/** @var string */ |
40
|
|
|
public const SEARCH_ACCOUNTS = 'accounts'; |
41
|
|
|
/** @var array */ |
42
|
|
|
private $validFields; |
43
|
|
|
|
44
|
|
|
public function __construct() |
45
|
|
|
{ |
46
|
|
|
parent::__construct(); |
47
|
|
|
$this->validFields = [ |
48
|
|
|
self::SEARCH_ALL, |
49
|
|
|
self::SEARCH_DESCRIPTION, |
50
|
|
|
self::SEARCH_NOTES, |
51
|
|
|
self::SEARCH_ACCOUNTS, |
52
|
|
|
]; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* @param Request $request |
57
|
|
|
* |
58
|
|
|
* @return void |
59
|
|
|
*/ |
60
|
|
|
public function search(Request $request): void |
|
|
|
|
61
|
|
|
{ |
62
|
|
|
die('the route is present but nobody\'s home.'); |
|
|
|
|
63
|
|
|
} |
64
|
|
|
} |
65
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.