Issues (5)

src/UpdateCustomerProfileRequest.php (1 issue)

Labels
Severity
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
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