for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Mapado\RestClientSdk\Mapping;
/**
* Class Attribute
*
* @author Julien Deniau <[email protected]>
*/
class Attribute
{
* @var string
private $serializedKey;
private $type;
* @var bool
private $isIdentifier;
private $attributeName;
* @throws \InvalidArgumentException
public function __construct(
string $serializedKey,
?string $attributeName = null,
?string $type = null,
bool $isIdentifier = false
) {
if (empty($serializedKey)) {
throw new \InvalidArgumentException('attribute name must be set');
}
$this->serializedKey = $serializedKey;
$this->attributeName = $attributeName ?? $this->serializedKey;
$this->type = $type ?? 'string';
$this->isIdentifier = $isIdentifier;
public function getSerializedKey(): string
return $this->serializedKey;
public function setSerializedKey(string $serializedKey): self
return $this;
public function getType(): string
return $this->type;
public function setType(string $type): self
$this->type = $type;
public function isIdentifier(): bool
return $this->isIdentifier;
public function setIsIdentifier(bool $isIdentifier): self
public function getAttributeName(): string
return $this->attributeName;
public function setAttributeName(string $attributeName): self
$this->attributeName = $attributeName;