Replace $parameters argument per method with static::$parameters

This commit is contained in:
Philipp 2021-11-14 20:46:25 +01:00
parent 018275919c
commit 714f0febc4
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
249 changed files with 710 additions and 775 deletions

View file

@ -297,32 +297,32 @@ class Module
Core\Hook::callAll($this->module . '_mod_init', $placeholder);
$this->module_class::init($this->module_class::getParameters());
$this->module_class::init();
$profiler->set(microtime(true) - $timestamp, 'init');
if ($server['REQUEST_METHOD'] === Router::DELETE) {
$this->module_class::delete($this->module_class::getParameters());
$this->module_class::delete();
}
if ($server['REQUEST_METHOD'] === Router::PATCH) {
$this->module_class::patch($this->module_class::getParameters());
$this->module_class::patch();
}
if ($server['REQUEST_METHOD'] === Router::POST) {
Core\Hook::callAll($this->module . '_mod_post', $post);
$this->module_class::post($this->module_class::getParameters());
$this->module_class::post();
}
if ($server['REQUEST_METHOD'] === Router::PUT) {
$this->module_class::put($this->module_class::getParameters());
$this->module_class::put();
}
Core\Hook::callAll($this->module . '_mod_afterpost', $placeholder);
$this->module_class::afterpost($this->module_class::getParameters());
$this->module_class::afterpost();
// "rawContent" is especially meant for technical endpoints.
// This endpoint doesn't need any theme initialization or other comparable stuff.
$this->module_class::rawContent($this->module_class::getParameters());
$this->module_class::rawContent();
}
}

View file

@ -352,7 +352,7 @@ class Page implements ArrayAccess
$arr = ['content' => $content];
Hook::callAll( $moduleClass::getClassName() . '_mod_content', $arr);
$content = $arr['content'];
$arr = ['content' => $moduleClass::content($moduleClass::getParameters())];
$arr = ['content' => $moduleClass::content()];
Hook::callAll($moduleClass::getClassName() . '_mod_aftercontent', $arr);
$content .= $arr['content'];
} catch (HTTPException $e) {