Rename Server register API to extend

More consistent with how extensions work
This commit is contained in:
Toby Zerner 2016-05-26 19:12:32 +09:30
parent d2bce5d756
commit ed8a145348

View File

@ -45,7 +45,7 @@ abstract class AbstractServer
/**
* @var callable[]
*/
protected $registerCallbacks = [];
protected $extendCallbacks = [];
/**
* @param null $basePath
@ -136,9 +136,9 @@ abstract class AbstractServer
/**
* @param callable $callback
*/
public function register(callable $callback)
public function extend(callable $callback)
{
$this->registerCallbacks[] = $callback;
$this->extendCallbacks[] = $callback;
}
/**
@ -193,8 +193,8 @@ abstract class AbstractServer
$app->register('Flarum\Forum\ForumServiceProvider');
$app->register('Flarum\Admin\AdminServiceProvider');
foreach ($this->registerCallbacks as $callback) {
$callback($app);
foreach ($this->extendCallbacks as $callback) {
$app->call($callback);
}
$app->register('Flarum\Extension\ExtensionServiceProvider');