harmonize My class
This commit is contained in:
parent
5ca7695494
commit
2dbc74d1dc
31
src/My.php
31
src/My.php
@ -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, '>=');
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user