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.

Issues (65)

src/Controllers/SSO/CustomerVerification.php (6 issues)

Labels
1
<?php
2
3
namespace bSecure\UniversalCheckout\Controllers\SSO;
4
5
use App\Http\Controllers\Controller;
0 ignored issues
show
The type App\Http\Controllers\Controller 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...
6
7
8
//Helper
9
use bSecure\UniversalCheckout\Helpers\AppException;
0 ignored issues
show
The type bSecure\UniversalCheckout\Helpers\AppException 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...
10
use bSecure\UniversalCheckout\Helpers\ApiResponseHandler;
11
use bSecure\UniversalCheckout\Helpers\Helper;
12
13
//Facade
14
use Validator;
0 ignored issues
show
The type Validator 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...
15
16
class CustomerVerification extends Controller
17
{
18
19
    /**
20
     * Author: Sara Hasan
21
     * Date: 26-November-2020
22
     */
23
    public function verifyCustomer($auth_code)
24
    {
25
        try {
26
            $validationErrors = $this->_checkForValidationRule( $auth_code );
27
28
            if( count( $validationErrors ) > 0 )
29
            {
30
                return ApiResponseHandler::validationError( $validationErrors );
31
            }
32
33
            $ssoCustomerProfile = $this->createSSOProfileStructure($auth_code);
34
35
            $ssoResponse = Helper::customerProfile($ssoCustomerProfile);
36
37
            if($ssoResponse['error'])
38
            {
39
                return ApiResponseHandler::failure($ssoResponse['message']);
40
            }else{
41
                $response = $ssoResponse['body'];
42
                return ApiResponseHandler::success($response, trans('bSecure::messages.customer.verification.success'));
0 ignored issues
show
It seems like $response can also be of type true; however, parameter $body of bSecure\UniversalCheckou...ponseHandler::success() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

42
                return ApiResponseHandler::success(/** @scrutinizer ignore-type */ $response, trans('bSecure::messages.customer.verification.success'));
Loading history...
The function trans was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

42
                return ApiResponseHandler::success($response, /** @scrutinizer ignore-call */ trans('bSecure::messages.customer.verification.success'));
Loading history...
43
            }
44
45
        } catch (\Exception $e) {
46
            return ApiResponseHandler::failure(trans('bSecure::messages.customer.verification.failure'), $e->getTraceAsString());
47
        }
48
    }
49
50
51
    /**
52
     * Author: Sara Hasan
53
     * Date: 27-November-2020
54
     */
55
    private function _checkForValidationRule($auth_code)
56
    {
57
        $errors = [];
58
59
        if( empty($auth_code) )
60
        {
61
            $errors[] = trans('bSecure::messages.validation.auth_code.required');
0 ignored issues
show
The function trans was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

61
            $errors[] = /** @scrutinizer ignore-call */ trans('bSecure::messages.validation.auth_code.required');
Loading history...
62
        }
63
64
        return $errors;
65
    }
66
67
    /**
68
     * Author: Sara Hasan
69
     * Date: 26-November-2020
70
     */
71
    private function createSSOProfileStructure($auth_code)
72
    {
73
        $sso_client = [];
74
75
        $sso_client['code'] = $auth_code;
76
77
        return $sso_client;
78
    }
79
80
}
81