for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Pheanstalk\Command;
use Pheanstalk\Exception;
use Pheanstalk\Structure\Workflow;
use Pheanstalk\Structure\WorkflowInstance;
use Pheanstalk\XmlResponseParser;
/**
* The 'Cancel' command.
*
* Cancel a running workflow instance
* @author Valentin Corre
* @package Pheanstalk
* @license http://www.opensource.org/licenses/mit-license.php
*/
class CancelCommand extends AbstractCommand implements \Pheanstalk\ResponseParser
{
/** @var WorkflowInstance $workflowInstance */
private $workflowInstance;
* @param WorkflowInstance $workflowInstance The WorkflowInstance
public function __construct(WorkflowInstance $workflowInstance)
$this->workflowInstance = $workflowInstance;
}
* @inheritDoc
public function getGroup(): string
return 'instance';
public function getAction(): string
return 'cancel';
public function getFilters(): array
return [
'id' => $this->workflowInstance->getId(),
];
public function getResponseParser()
return $this;
public function parseResponse($responseLine, $responseData)
return $responseLine === 'OK';