type fixes

This commit is contained in:
Yuri Kuznetsov
2022-03-08 21:34:09 +02:00
parent 7150f49634
commit ffbfe1ca5a
4 changed files with 21 additions and 15 deletions
+5 -4
View File
@@ -44,13 +44,13 @@ class DateTime
public const SYSTEM_DATE_FORMAT = 'Y-m-d';
private $dateFormat;
private ?string $dateFormat;
private $timeFormat;
private ?string $timeFormat;
private $timezone;
private DateTimeZone $timezone;
private $language;
private ?string $language;
public function __construct(
?string $dateFormat = 'YYYY-MM-DD',
@@ -240,6 +240,7 @@ class DateTime
/**
* @deprecated Use `convertSystemDate`.
* @param string $string
*/
public function convertSystemDateToGlobal($string): ?string
{
+13 -8
View File
@@ -42,17 +42,15 @@ use JsonException;
class Unifier
{
private $fileManager;
private FileManager $fileManager;
private $module;
private Module $module;
private $pathProvider;
private PathProvider $pathProvider;
protected $useObjects = false;
protected bool $useObjects = false;
private $unsetFileName = 'unset.json';
private $moduleList = null;
private string $unsetFileName = 'unset.json';
public function __construct(FileManager $fileManager, Module $module, PathProvider $pathProvider)
{
@@ -64,7 +62,7 @@ class Unifier
/**
* Merge data of resource files.
*
* @return array|object
* @return array<string,mixed>|\stdClass
*/
public function unify(string $path, bool $noCustom = false)
{
@@ -110,6 +108,9 @@ class Unifier
);
}
/**
* @return array<string,mixed>
*/
private function unifySingle(string $dirPath, bool $recursively)
{
$data = [];
@@ -180,6 +181,10 @@ class Unifier
return Util::unsetInArray($data, $unsets);
}
/**
* @return \stdClass|array<string,mixed>
* @throws JsonException
*/
private function getContents(string $path)
{
$fileContent = $this->fileManager->getContents($path);
@@ -31,5 +31,5 @@ namespace Espo\Core\Utils\File;
class UnifierObj extends Unifier
{
protected $useObjects = true;
protected bool $useObjects = true;
}
+2 -2
View File
@@ -37,9 +37,9 @@ use Espo\Core\Utils\Config;
*/
class Hasher
{
private $config;
private Config $config;
private $secretKeyParam = 'hashSecretKey';
private string $secretKeyParam = 'hashSecretKey';
public function __construct(Config $config)
{