mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-30 16:47:59 +01:00
29 lines
No EOL
479 B
PHP
29 lines
No EOL
479 B
PHP
<?php
|
|
|
|
namespace 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();
|
|
} |