for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Ipag\Classes;
use Ipag\Classes\Contracts\Emptiable;
use Ipag\Classes\Contracts\ObjectSerializable;
use Ipag\Classes\Traits\EmptiableTrait;
final class Authentication implements Emptiable, ObjectSerializable
{
use EmptiableTrait;
/**
* @var string
*/
private $identification;
private $partner;
private $apiKey;
public function __construct($identification, $apiKey = null)
$this->identification = $identification;
$this->apiKey = $apiKey;
}
* @return string
public function getIdentification()
return $this->identification;
* @param string $identification
public function setIdentification($identification)
$this->identification = substr((string) $identification, 0, 50);
return $this;
public function getPartner()
return $this->partner;
* @param string $partner
public function setPartner($partner)
$this->partner = substr((string) $partner, 0, 50);
public function getApiKey()
return $this->apiKey;
* @param string $apiKey
public function setApiKey($apiKey)
public function serialize()
$_user = [
'identificacao' => urlencode($this->getIdentification()),
];
$partner = $this->getPartner();
if (!empty($partner)) {
$_user['identificacao2'] = urlencode($partner);
return $_user;