for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PaymentGateway\PayPalSdk\Products\Requests;
use PaymentGateway\PayPalSdk\Products\Concerns\HasCategory;
use PaymentGateway\PayPalSdk\Products\Concerns\HasDescription;
use PaymentGateway\PayPalSdk\Products\Concerns\HasHomeUrl;
use PaymentGateway\PayPalSdk\Products\Concerns\HasImageUrl;
class UpdateProductRequest
{
use HasDescription;
use HasCategory;
use HasImageUrl;
use HasHomeUrl;
protected string $id;
public function __construct(string $id)
$this->id = $id;
}
public function getId(): string
return $this->id;
public function toArray(): array
$request = [];
if ($this->description ?? null) {
$request[] = [
'op' => 'replace',
'path' => '/description',
'value' => $this->description
];
if ($this->category ?? null) {
'path' => '/category',
'value' => $this->category
if ($this->imageUrl ?? null) {
'path' => '/image_url',
'value' => $this->imageUrl
if ($this->homeUrl ?? null) {
'path' => '/home_url',
'value' => $this->homeUrl
return $request;