for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/**
* GpsLab component.
*
* @author Peter Gribanov <[email protected]>
* @copyright Copyright (c) 2011, Peter Gribanov
* @license http://opensource.org/licenses/MIT
*/
namespace GpsLab\Component\Command\Queue\Pull;
use GpsLab\Component\Command\Command;
class MemoryPullCommandQueue implements PullCommandQueue
{
* @var Command[]
private $commands = [];
* Publish command to queue.
* @param Command $command
* @return bool
public function publish(Command $command): bool
$this->commands[] = $command;
return true;
}
* Pop command from queue. Return NULL if queue is empty.
* @return Command|null
public function pull(): ?Command
return array_shift($this->commands);