1 | <?php |
||
2 | |||
3 | namespace AraneaDev\Electrum\App\Api; |
||
4 | |||
5 | use App\Http\Controllers\Controller; |
||
0 ignored issues
–
show
|
|||
6 | use AraneaDev\Electrum\Electrum; |
||
7 | use Illuminate\Http\Request; |
||
8 | |||
9 | /** |
||
10 | * Class RequestsController. |
||
11 | */ |
||
12 | class RequestsController extends Controller |
||
13 | { |
||
14 | /** @var Electrum */ |
||
15 | protected $electrum; |
||
16 | |||
17 | /** |
||
18 | * RequestsController constructor. |
||
19 | * |
||
20 | * @param Electrum $electrum |
||
21 | */ |
||
22 | public function __construct(Electrum $electrum) |
||
23 | { |
||
24 | $this->middleware(config('electrum.web_interface.middleware', ['web', 'auth'])); |
||
25 | $this->electrum = $electrum; |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * Show all payment requests. |
||
30 | * |
||
31 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
||
32 | */ |
||
33 | public function index() |
||
34 | { |
||
35 | return response()->json($this->electrum->getRequests()); |
||
0 ignored issues
–
show
|
|||
36 | } |
||
37 | |||
38 | /** |
||
39 | * Show a payment request. |
||
40 | * |
||
41 | * @param $address |
||
42 | * @return \Illuminate\Http\JsonResponse |
||
43 | */ |
||
44 | public function show($address) |
||
45 | { |
||
46 | return response()->json($this->electrum->getRequest($address)); |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * Create a payment request. |
||
51 | * |
||
52 | * @param Request $request |
||
53 | * @return \Illuminate\Http\JsonResponse |
||
54 | */ |
||
55 | public function create(Request $request) |
||
56 | { |
||
57 | $request->validate([ |
||
58 | 'amount' => 'required|numeric|min:0', |
||
59 | 'expires' => 'required|integer|min:0', |
||
60 | 'memo' => 'nullable', |
||
61 | ]); |
||
62 | |||
63 | return response()->json($this->electrum->createRequest( |
||
64 | $request->get('amount'), |
||
65 | $request->get('memo'), |
||
66 | $request->get('expires') |
||
67 | )); |
||
68 | } |
||
69 | |||
70 | /** |
||
71 | * Remove a payment request. |
||
72 | * |
||
73 | * @param $address |
||
74 | * @return \Illuminate\Http\JsonResponse |
||
75 | */ |
||
76 | public function destroy($address) |
||
77 | { |
||
78 | return response()->json($this->electrum->clearRequest($address)); |
||
79 | } |
||
80 | |||
81 | /** |
||
82 | * Remove all payment requests. |
||
83 | * |
||
84 | * @return \Illuminate\Http\JsonResponse |
||
85 | */ |
||
86 | public function clear() |
||
87 | { |
||
88 | return response()->json($this->electrum->clearRequests()); |
||
89 | } |
||
90 | } |
||
91 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths