for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PaymentGateway\PayPalSdk\Subscriptions;
class Phone
{
private string $phoneNumber;
private ?string $phoneType = null;
public function __construct(string $phoneNumber)
$this->phoneNumber = $phoneNumber;
}
public function getPhoneNumber(): string
return $this->phoneNumber;
public function setPhoneNumber(string $phoneNumber): self
return $this;
public function getPhoneType(): ?string
return $this->phoneType;
public function setPhoneType(?string $phoneType): self
$this->phoneType = $phoneType;
public function toArray(): array
$data = [
'phone_number' => $this->phoneNumber,
];
if ($this->phoneType) {
$data['phone_type'] = $this->phoneType;
return $data;