diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Plugin.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Plugin.php index c79847e7a..9c68aa76c 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Plugin.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Plugin.php @@ -13,11 +13,12 @@ class Plugin extends \RainLoop\Config\AbstractConfig { if (\count($aMap)) { $aResultMap = array(); - foreach ($aMap as /* @var $oProperty \RainLoop\Plugins\Property */ $oProperty) { - if ($oProperty) { - $mValue = $oProperty->DefaultValue(); - $sValue = \is_array($mValue) && isset($mValue[0]) ? $mValue[0] : $mValue; - $aResultMap[$oProperty->Name()] = array($sValue, ''); + foreach ($aMap as $oProperty) { + if ($oProperty instanceof \RainLoop\Plugins\Property) { + $aResultMap[$oProperty->Name()] = array( + $oProperty->DefaultValue(), + '' + ); } } @@ -28,6 +29,7 @@ class Plugin extends \RainLoop\Config\AbstractConfig } } +// parent::__construct('plugin-'.$sPluginName.'.ini', '; SnappyMail plugin ('.$sPluginName.')'); parent::__construct('plugin-'.$sPluginName.'.json'); } diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Plugins/Property.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Plugins/Property.php index 4a223800e..3e73f8c67 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Plugins/Property.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Plugins/Property.php @@ -4,55 +4,31 @@ namespace RainLoop\Plugins; class Property implements \JsonSerializable { - /** - * @var string - */ - private $sName; + private string $sName; /** * @var mixed */ private $mValue; - /** - * @var string - */ - private $sLabel; + private string $sLabel = ''; - /** - * @var string - */ - private $sDesc; + private string $sDesc = ''; - /** - * @var int - */ - private $iType; + private int $iType = \RainLoop\Enumerations\PluginPropertyType::STRING; - /** - * @var bool - */ - private $bAllowedInJs; + private bool $bAllowedInJs = false; /** * @var mixed */ - private $mDefaultValue; + private $mDefaultValue = ''; - /** - * @var string - */ - private $sPlaceholder; + private string $sPlaceholder = ''; function __construct(string $sName) { $this->sName = $sName; - $this->iType = \RainLoop\Enumerations\PluginPropertyType::STRING; - $this->mDefaultValue = ''; - $this->sLabel = ''; - $this->sDesc = ''; - $this->bAllowedInJs = false; - $this->sPlaceholder = ''; } public static function NewInstance(string $sName) : self