mirror of
https://github.com/friendica/friendica
synced 2025-04-25 01:10:12 +00:00
Revert "Replace Module::init() with Constructors"
This commit is contained in:
parent
0b6e0566d7
commit
89d6c89b67
43 changed files with 921 additions and 1225 deletions
|
@ -21,8 +21,6 @@
|
|||
|
||||
namespace Friendica;
|
||||
|
||||
use Friendica\Core\L10n;
|
||||
|
||||
/**
|
||||
* This mock module enable class encapsulation of legacy global function modules.
|
||||
* After having provided the module file name, all the methods will behave like a normal Module class.
|
||||
|
@ -39,13 +37,11 @@ class LegacyModule extends BaseModule
|
|||
*/
|
||||
private $moduleName = '';
|
||||
|
||||
public function __construct(L10n $l10n, string $file_path = '', array $parameters = [])
|
||||
public function __construct(string $file_path = '', array $parameters = [])
|
||||
{
|
||||
parent::__construct($l10n, $parameters);
|
||||
parent::__construct($parameters);
|
||||
|
||||
$this->setModuleFile($file_path);
|
||||
|
||||
$this->runModuleFunction('init');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -65,6 +61,11 @@ class LegacyModule extends BaseModule
|
|||
require_once $file_path;
|
||||
}
|
||||
|
||||
public function init()
|
||||
{
|
||||
$this->runModuleFunction('init');
|
||||
}
|
||||
|
||||
public function content(): string
|
||||
{
|
||||
return $this->runModuleFunction('content');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue