code review
parent
bdd295d5ce
commit
11796eb948
|
@ -5,7 +5,7 @@
|
|||
* @package Dotclear
|
||||
* @subpackage Plugin
|
||||
*
|
||||
* @author Jean-Christian Denis
|
||||
* @author Jean-Christian Denis and contributors
|
||||
*
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* @package Dotclear
|
||||
* @subpackage Plugin
|
||||
*
|
||||
* @author Jean-Christian Denis
|
||||
* @author Jean-Christian Denis and contributors
|
||||
*
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* @package Dotclear
|
||||
* @subpackage Plugin
|
||||
*
|
||||
* @author Jean-Christian Denis
|
||||
* @author Jean-Christian Denis and contributors
|
||||
*
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* @package Dotclear
|
||||
* @subpackage Plugin
|
||||
*
|
||||
* @author Jean-Christian Denis
|
||||
* @author Jean-Christian Denis and contributors
|
||||
*
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* @package Dotclear
|
||||
* @subpackage Plugin
|
||||
*
|
||||
* @author Jean-Christian Denis
|
||||
* @author Jean-Christian Denis and contributors
|
||||
*
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
|
|
@ -55,6 +55,7 @@ class Install
|
|||
try {
|
||||
self::update_0_8_0();
|
||||
self::putSettings();
|
||||
|
||||
return true;
|
||||
} catch (Exception $e) {
|
||||
dcCore::app()->error->add($e->getMessage());
|
||||
|
|
|
@ -36,13 +36,13 @@ use Exception;
|
|||
*/
|
||||
class Manage
|
||||
{
|
||||
/** @var improve $improve improve core instance */
|
||||
/** @var Core $improve improve core instance */
|
||||
private static $improve = null;
|
||||
/** @var string $type Current module(s) type */
|
||||
private static $type = 'plugin';
|
||||
/** @var string $module Current module id */
|
||||
private static $module = '-';
|
||||
/** @var action|null $action Current action module */
|
||||
/** @var Action|null $action Current action module */
|
||||
private static $action = null;
|
||||
|
||||
private static $init = false;
|
||||
|
@ -77,7 +77,7 @@ class Manage
|
|||
return $module;
|
||||
}
|
||||
|
||||
private static function getAction(): ?action
|
||||
private static function getAction(): ?Action
|
||||
{
|
||||
return empty($_REQUEST['config']) ? null : self::$improve->module($_REQUEST['config']);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ use Clearbricks;
|
|||
*
|
||||
* Manage autoload and some action module helpers.
|
||||
*/
|
||||
class prepend
|
||||
class Prepend
|
||||
{
|
||||
private static $init = false;
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ class Core
|
|||
'php', 'xml', 'js', 'css', 'csv', 'html', 'htm', 'txt', 'md', 'po',
|
||||
];
|
||||
|
||||
/** @var array<action> $actions Loaded actions modules */
|
||||
/** @var array<Action> $actions Loaded actions modules */
|
||||
private $actions = [];
|
||||
|
||||
/** @var array<string> $disabled Disabled actions modules */
|
||||
|
@ -60,7 +60,7 @@ class Core
|
|||
dcCore::app()->callBehavior('improveAddAction', $list);
|
||||
|
||||
foreach ($list as $action) {
|
||||
if ($action instanceof action && !isset($this->actions[$action->id()])) {
|
||||
if ($action instanceof Action && !isset($this->actions[$action->id()])) {
|
||||
if (in_array($action->id(), $disabled)) {
|
||||
$this->disabled[$action->id()] = $action->name();
|
||||
} else {
|
||||
|
@ -154,9 +154,9 @@ class Core
|
|||
*
|
||||
* @param string $id Module id
|
||||
*
|
||||
* @return action action instance
|
||||
* @return Action action instance
|
||||
*/
|
||||
public function module(string $id): ?action
|
||||
public function module(string $id): ?Action
|
||||
{
|
||||
if (empty($id)) {
|
||||
return null;
|
||||
|
@ -168,7 +168,7 @@ class Core
|
|||
/**
|
||||
* Get all loaded action modules
|
||||
*
|
||||
* @return action[] action instance
|
||||
* @return Action[] action instance
|
||||
*/
|
||||
public function modules(): array
|
||||
{
|
||||
|
@ -338,12 +338,12 @@ class Core
|
|||
/**
|
||||
* Sort modules by priority then name
|
||||
*
|
||||
* @param action $a ImproveAction instance
|
||||
* @param action $b ImproveAction instance
|
||||
* @param Action $a ImproveAction instance
|
||||
* @param Action $b ImproveAction instance
|
||||
*
|
||||
* @return integer Is higher
|
||||
*/
|
||||
private function sortModules(action $a, action $b): int
|
||||
private function sortModules(Action $a, Action $b): int
|
||||
{
|
||||
if ($a->priority() == $b->priority()) {
|
||||
return strcasecmp($a->name(), $b->name());
|
||||
|
|
|
@ -37,9 +37,6 @@ class po2php extends Action
|
|||
*/
|
||||
EOF;
|
||||
|
||||
/** @var string Settings dcstore zip url pattern */
|
||||
private $pattern = '';
|
||||
|
||||
protected function init(): bool
|
||||
{
|
||||
$this->setProperties([
|
||||
|
|
Loading…
Reference in New Issue