harmonize My class

This commit is contained in:
Jean-Christian Paul Denis 2023-05-08 10:44:32 +02:00
parent 5ca7695494
commit 2dbc74d1dc
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951

View File

@ -17,17 +17,18 @@ namespace Dotclear\Plugin\postExpired;
use dcCore;
/**
* Module definiton shortcut.
* This module definiton.
*/
class My
{
/** @var string This plugin meta type */
/** @var string This module meta type */
public const META_TYPE = 'post_expired';
/** @var string This module required php version */
public const PHP_MIN = '7.4';
/**
* This module id.
*
* @return string The module id
*/
public static function id(): string
{
@ -36,12 +37,28 @@ class My
/**
* This module name.
*
* @return string The module translated name
*/
public static function name(): string
{
return __((string) dcCore::app()->plugins->moduleInfo(self::id(), 'name'));
$name = dcCore::app()->plugins->moduleInfo(self::id(), 'name');
return __(is_string($name) ? $name : self::id());
}
/**
* This module path.
*/
public static function path(): string
{
return dirname(__DIR__);
}
/**
* Check this module PHP version compliant.
*/
public static function phpCompliant(): bool
{
return version_compare(phpversion(), self::PHP_MIN, '>=');
}
/**