UpdateCustomerProfileRequest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 16
ccs 0
cts 6
cp 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A attachData() 0 3 1
A __construct() 0 7 1
1
<?php
2
3
namespace CommerceGuys\AuthNet;
4
5
use GuzzleHttp\Client;
6
use CommerceGuys\AuthNet\DataTypes\Profile;
7
use CommerceGuys\AuthNet\Request\RequestInterface;
8
9
/**
10
 * Update an existing customer profile.
11
 *
12
 * @link http://developer.authorize.net/api/reference/index.html#customer-profiles-update-customer-profile
13
 */
14
class UpdateCustomerProfileRequest extends BaseApiRequest
15
{
16
    protected $profile;
17
18
    public function __construct(
19
        Configuration $configuration,
20
        Client $client,
21
        Profile $profile = null
22
    ) {
23
        parent::__construct($configuration, $client);
24
        $this->profile = $profile;
25
    }
26
27
    protected function attachData(RequestInterface $request)
28
    {
29
        $request->addDataType($this->profile);
0 ignored issues
show
Bug introduced by
It seems like $this->profile can also be of type null; however, parameter $data of CommerceGuys\AuthNet\Req...nterface::addDataType() does only seem to accept CommerceGuys\AuthNet\DataTypes\DataTypeInterface, 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

29
        $request->addDataType(/** @scrutinizer ignore-type */ $this->profile);
Loading history...
30
    }
31
}
32