PaymentMethodsCredsController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 10
c 2
b 0
f 1
dl 0
loc 45
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getCurrentPaymentMethodsCreds() 0 3 1
A onConstruct() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Canvas\Api\Controllers;
6
7
use Canvas\Models\PaymentMethodsCreds;
8
use Phalcon\Http\Response;
0 ignored issues
show
Bug introduced by
The type Phalcon\Http\Response was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
10
/**
11
 * Class LanguagesController.
12
 *
13
 * @package Canvas\Api\Controllers
14
 *
15
 */
16
class PaymentMethodsCredsController extends BaseController
17
{
18
    /*
19
     * fields we accept to create
20
     *
21
     * @var array
22
     */
23
    protected $createFields = [];
24
25
    /*
26
     * fields we accept to create
27
     *
28
     * @var array
29
     */
30
    protected $updateFields = [];
31
32
    /**
33
     * set objects.
34
     *
35
     * @return void
36
     */
37
    public function onConstruct()
38
    {
39
        $this->model = new PaymentMethodsCreds();
0 ignored issues
show
Bug Best Practice introduced by
The property model does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
40
        $this->additionalSearchFields = [
0 ignored issues
show
Bug Best Practice introduced by
The property additionalSearchFields does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
41
            ['is_deleted', ':', '0'],
42
            ['users_id', ':', $this->userData->getId()],
43
            ['companies_id', ':', '0|' . $this->userData->currentCompanyId()],
44
            ['apps_id', ':', $this->app->getId()]
45
        ];
46
    }
47
48
    /**
49
     * Get current payment methods creds
50
     *
51
     * @param mixed $id
52
     *
53
     * @method GET
54
     * @url /v1/roles-acceslist/{id}
55
     *
56
     * @return Response
57
     */
58
    public function getCurrentPaymentMethodsCreds(): Response
59
    {
60
        return $this->response($this->model->getCurrentPaymentMethodCreds());
61
    }
62
63
64
}
65