for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Ds;
/**
* A Vector is a sequence of values in a contiguous buffer that grows and
* shrinks automatically. It’s the most efficient sequential structure because
* a value’s index is a direct mapping to its index in the buffer, and the
* growth factor isn't bound to a specific multiple or exponent.
*
* @package Ds
*/
final class Vector implements \IteratorAggregate, \ArrayAccess, Sequence
{
use Traits\GenericCollection;
use Traits\GenericSequence;
use Traits\Capacity;
const MIN_CAPACITY = 8;
protected function getGrowthFactor(): float
return 1.5;
}
* @return whether capacity should be increased.
boolean
This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.
@return
protected function shouldIncreaseCapacity(): bool
return count($this) > $this->capacity;
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.