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