for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/*
* Copyright (C) 2018 Sebastian Böttger <[email protected]>
* You may use, distribute and modify this code under the
* terms of the MIT license.
*
* You should have received a copy of the MIT license with
* this file. If not, please visit: https://opensource.org/licenses/mit-license.php
*/
namespace Seboettg\Collection\Queue;
/**
* Trait QueueTrait
* @property $array Base array of this data structure
* @package Seboettg\Collection\Queue
$array
0
trait QueueTrait
{
* {@inheritdoc}
public function enqueue($item)
$this->array = array_merge([$item], $this->array);
array
return $this;
}
public function dequeue()
return array_pop($this->array);
public function count(): int
return count($this->array);