type fixes

This commit is contained in:
Yuri Kuznetsov
2022-03-18 14:30:23 +02:00
parent 50f7165963
commit 1f48e3d005
2 changed files with 6 additions and 1 deletions
@@ -65,6 +65,9 @@ class FunctionFactory
$this->classNameMap = $classNameMap;
}
/**
* @return \Espo\Core\Formula\Functions\BaseFunction|\Espo\Core\Formula\Functions\Base
*/
public function create(string $name, ?Entity $entity = null, ?stdClass $variables = null): object
{
if ($this->classNameMap && array_key_exists($name, $this->classNameMap)) {
@@ -105,6 +108,7 @@ class FunctionFactory
$object->setAttributeFetcher($this->attributeFetcher);
}
/** @var \Espo\Core\Formula\Functions\BaseFunction|\Espo\Core\Formula\Functions\Base */
return $object;
}
}
@@ -27,7 +27,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Formula\Functions\DateTimeGroup;
namespace Espo\Core\Formula\Functions\DatetimeGroup;
use Espo\Core\Di;
@@ -93,6 +93,7 @@ class ClosestType extends BaseFunction implements Di\ConfigAware
$format = 'Y-m-d H:i:s';
/** @var DateTime */
$dt = DateTime::createFromFormat($format, $value, new DateTimeZone($timezone));
$valueTimestamp = $dt->getTimestamp();