for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Guillermoandrae\DynamoDb\Contract;
/**
* Trait for limit aware operations.
*
* @author Guillermo A. Fisher <[email protected]>
*/
trait LimitAwareOperationTrait
{
* @var int The result offset.
protected int $offset = 0;
* @var int|null The result limit.
protected ?int $limit = 0;
* Registers the result offset with this object.
* @param integer $offset The result offset.
* @return static An implementation of this trait.
final public function setOffset(int $offset): static
$this->offset = $offset;
return $this;
}
* Registers the result limit with this object.
* @param integer|null $limit The result limit.
final public function setLimit(?int $limit): static
$this->limit = $limit;
public function toArray(): array
return [
'Limit' => $this->offset + $this->limit
];