Pony.fm/app/Commands/CommandBase.php
2015-10-23 18:22:14 -07:00

33 lines
No EOL
561 B
PHP

<?php
namespace Poniverse\Ponyfm\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();
}