Pony.fm/app/Commands/CommandBase.php

33 lines
548 B
PHP
Raw Normal View History

2015-08-31 16:19:23 +02:00
<?php
namespace App\Commands;
abstract class CommandBase
{
private $_listeners = array();
public function listen($listener)
{
$this->_listeners[] = $listener;
}
protected function notify($message, $progress)
{
foreach ($this->_listeners as $listener) {
$listener($message, $progress);
}
}
/**
* @return bool
*/
public function authorize()
{
return true;
}
/**
* @return CommandResponse
*/
public abstract function execute();
}