for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Loevgaard\AltaPay\Entity;
trait AddressTrait
{
/**
* @var string
*/
private $firstName;
private $lastName;
private $address;
private $city;
private $postalCode;
private $country;
* @return string
public function getFirstName() : ?string
return $this->firstName;
}
public function getLastName() : ?string
return $this->lastName;
public function getAddress() : ?string
return $this->address;
public function getCity() : ?string
return $this->city;
public function getPostalCode() : ?string
return $this->postalCode;
public function getCountry() : ?string
return $this->country;
* @param \SimpleXMLElement $xml
public function hydrateAddress(\SimpleXMLElement $xml)
$this->firstName = isset($xml->Firstname) ? (string)$xml->Firstname : null;
$this->lastName = isset($xml->Lastname) ? (string)$xml->Lastname : null;
$this->address = isset($xml->Address) ? (string)$xml->Address : null;
$this->city = isset($xml->City) ? (string)$xml->City : null;
$this->postalCode = isset($xml->PostalCode) ? (string)$xml->PostalCode : null;
$this->country = isset($xml->Country) ? (string)$xml->Country : null;