type fixes

This commit is contained in:
Yuri Kuznetsov
2021-11-10 15:34:24 +02:00
parent d34bc6d7d2
commit 9e641e65ed
5 changed files with 61 additions and 8 deletions
@@ -46,10 +46,13 @@ class ChangePassword implements EntryPoint
{
use NoAuth;
/** @var Config */
protected $config;
/** @var ClientManager */
protected $clientManager;
/** @var EntityManager */
protected $entityManager;
public function __construct(Config $config, ClientManager $clientManager, EntityManager $entityManager)
@@ -68,7 +71,7 @@ class ChangePassword implements EntryPoint
}
$passwordChangeRequest = $this->entityManager
->getRepository('PasswordChangeRequest')
->getRDBRepository('PasswordChangeRequest')
->where([
'requestId' => $requestId,
])
@@ -54,10 +54,13 @@ class Download implements EntryPoint
'application/msexcel',
];
/** @var FileStorageManager */
protected $fileStorageManager;
/** @var Acl */
protected $acl;
/** @var EntityManager */
protected $entityManager;
public function __construct(FileStorageManager $fileStorageManager, Acl $acl, EntityManager $entityManager)
+15 -1
View File
@@ -29,6 +29,8 @@
namespace Espo\EntryPoints;
use Espo\Repositories\Attachment as AttachmentRepository;
use Espo\Core\{
Exceptions\NotFound,
Exceptions\NotFoundSilent,
@@ -54,16 +56,22 @@ class Image implements EntryPoint
protected $allowedFieldList = null;
/** @var FileStorageManager */
protected $fileStorageManager;
/** @var Acl */
protected $acl;
/** @var EntityManager */
protected $entityManager;
/** @var FileManager */
protected $fileManager;
/** @var Config */
protected $config;
/** @var Metadata */
private $metadata;
public function __construct(
@@ -172,7 +180,7 @@ class Image implements EntryPoint
return $this->fileManager->getContents($cacheFilePath);
}
$filePath = $this->entityManager->getRepository('Attachment')->getFilePath($attachment);
$filePath = $this->getAttachmentRepository()->getFilePath($attachment);
if (!$this->fileManager->isFile($filePath)) {
throw new NotFound();
@@ -358,4 +366,10 @@ class Image implements EntryPoint
{
return $this->metadata->get(['app', 'image', 'sizes']) ?? [];
}
protected function getAttachmentRepository(): AttachmentRepository
{
/** @var AttachmentRepository */
return $this->entityManager->getRepository(Attachment::ENTITY_TYPE);
}
}
+15 -3
View File
@@ -39,16 +39,28 @@ use Espo\{
Entities\User,
};
use StdClass;
use stdClass;
class Integration
{
/**
* @var EntityManager
*/
protected $entityManager;
/**
* @var User
*/
protected $user;
/**
* @var Config
*/
protected $config;
/**
* @var ConfigWriter
*/
protected $configWriter;
public function __construct(
@@ -83,7 +95,7 @@ class Integration
return $entity;
}
public function update(string $id, StdClass $data): Entity
public function update(string $id, stdClass $data): Entity
{
$this->processAccessCheck();
@@ -99,7 +111,7 @@ class Integration
$integrationsConfigData = $this->config->get('integrations') ?? (object) [];
if (!($integrationsConfigData instanceof StdClass)) {
if (!($integrationsConfigData instanceof stdClass)) {
$integrationsConfigData = (object) [];
}
+24 -3
View File
@@ -48,18 +48,39 @@ use Espo\{
class Layout
{
/**
* @var Acl
*/
protected $acl;
/**
* @var LayoutUtil
*/
protected $layout;
/**
* @var LayoutManager
*/
protected $layoutManager;
/**
* @var EntityManager
*/
protected $entityManager;
/**
* @var Metadata
*/
protected $metadata;
/**
* @var DataManager
*/
protected $dataManager;
/**
* @var User
*/
protected $user;
public function __construct(
@@ -132,7 +153,7 @@ class Layout
if ($portalId) {
$portal = $em
->getRepository('Portal')
->getRDBRepository('Portal')
->select(['layoutSetId'])
->where(['id' => $portalId])
->findOne();
@@ -146,7 +167,7 @@ class Layout
if ($teamId) {
$team = $em
->getRepository('Team')
->getRDBRepository('Team')
->select(['layoutSetId'])
->where(['id' => $teamId])
->findOne();
@@ -245,7 +266,7 @@ class Layout
}
$layout = $em
->getRepository('LayoutRecord')
->getRDBRepository('LayoutRecord')
->where([
'layoutSetId' => $setId,
'name' => $fullName,