fix missing class imports, exceptions and undefined properties (#2112)

* fix exception

* fix missing imports

* fix access to an undefined property
This commit is contained in:
Arkadiy
2021-10-15 14:46:45 +02:00
committed by GitHub
parent ea71675701
commit 4ae383033a
36 changed files with 55 additions and 4 deletions
@@ -29,6 +29,7 @@
namespace Espo\Controllers;
use Espo\Core\Exceptions\Error;
use Espo\Core\{
Controllers\Record,
Api\Request,
@@ -42,6 +42,8 @@ class TwoFactorEmail
{
private $service;
private $user;
public function __construct(Service $service, User $user)
{
$this->service = $service;
@@ -42,6 +42,8 @@ class TwoFactorSms
{
private $service;
private $user;
public function __construct(Service $service, User $user)
{
$this->service = $service;
@@ -44,6 +44,8 @@ class UserSecurity
{
private $service;
private $user;
public function __construct(Service $service, User $user)
{
$this->service = $service;
@@ -29,6 +29,7 @@
namespace Espo\Core;
use Espo\Core\Exceptions\Error;
use Espo\Entities\Portal as PortalEntity;
use Espo\Entities\User as UserEntity;
@@ -86,6 +86,8 @@ class Authentication
private $twoFactorLoginFactory;
private $authTokenManager;
private $hookManager;
private $log;
@@ -43,6 +43,8 @@ class Data
private $loggedUser = null;
private $status = null;
private $failReason = null;
private $data = [];
+2
View File
@@ -52,6 +52,8 @@ class Container implements ContainerInterface
private $configuration = null;
private $bindingContainer;
private $injectableFactory;
public function __construct(
@@ -68,7 +68,7 @@ class ValidatorFactory
$className = $this->getClassName($entityType, $field);
if (!$className) {
throw RuntimeException("Validator for '{$entityType}.{$field}' does not exist.");
throw new RuntimeException("Validator for '{$entityType}.{$field}' does not exist.");
}
return $this->injectableFactory->create($className);
@@ -49,6 +49,8 @@ class Evaluator
private $attributeFetcher;
private $injectableFactory;
private $parsedHash;
public function __construct(InjectableFactory $injectableFactory, array $functionClassNameMap = [])
@@ -41,7 +41,7 @@ class ValueType extends BaseFunction
public function process(ArgumentList $args)
{
if (!count($args)) {
throw Error("Bad value.");
throw new Error("Bad value.");
}
$value = $args[0]->getData();
@@ -41,7 +41,7 @@ class VariableType extends BaseFunction
public function process(ArgumentList $args)
{
if (!count($args)) {
throw Error("No variable name.");
throw new Error("No variable name.");
}
$name = $args[0]->getData();
@@ -65,6 +65,8 @@ class Htmlizer
private $dateTime;
private $number;
private $config;
private $acl;
@@ -35,6 +35,8 @@ use Espo\Core\Mail\Mail\Storage\Imap;
class MessageWrapper
{
private $parser;
private $storage;
private $id;
@@ -53,6 +53,7 @@ class SelectManagerFactory
private $user;
private $acl;
private $aclManager;
private $injectableFactory;
private $classFinder;
@@ -355,7 +355,7 @@ class ItemGeneralConverter implements ItemConverter
}
if (!$arrayAttributeLink || !$arrayAttribute) {
throw Error("Bad where item.");
throw new Error("Bad where item.");
}
$arrayEntityType = $entityDefs->getRelation($arrayAttributeLink)->getForeignEntityType();
@@ -29,6 +29,8 @@
namespace Espo\Core\Upgrades\Actions\Base;
use Espo\Core\Exceptions\Error;
class Delete extends \Espo\Core\Upgrades\Actions\Base
{
public function run($data)
@@ -37,6 +37,8 @@ class RelationManager
{
private $metadata;
private $config;
public function __construct(Metadata $metadata, Config $config)
{
$this->metadata = $metadata;
@@ -32,6 +32,7 @@ namespace Espo\Core\WebSocket;
use Espo\Core\Utils\Log;
use stdClass;
use Throwable;
class Submission
{
@@ -29,6 +29,9 @@
namespace Espo\Modules\Crm\Controllers;
use Espo\Core\Exceptions\Forbidden;
use Espo\Core\Exceptions\BadRequest;
class CaseObj extends \Espo\Core\Controllers\Record
{
protected $name = 'Case';
@@ -29,6 +29,8 @@
namespace Espo\Modules\Crm\Controllers;
use Espo\Core\Exceptions\BadRequest;
class KnowledgeBaseArticle extends \Espo\Core\Controllers\Record
{
public function postActionGetCopiedAttachments($params, $data, $request)
@@ -30,6 +30,7 @@
namespace Espo\Modules\Crm\Controllers;
use Espo\Core\Exceptions\BadRequest;
use Espo\Core\Exceptions\Error;
class Lead extends \Espo\Core\Controllers\Record
{
@@ -30,6 +30,7 @@
namespace Espo\Modules\Crm\Controllers;
use Espo\Core\Exceptions\BadRequest;
use Espo\Core\Exceptions\Error;
class Target extends \Espo\Core\Controllers\Record
{
@@ -29,6 +29,7 @@
namespace Espo\Modules\Crm\Services;
use Espo\Core\Exceptions\BadRequest;
use Espo\Core\Exceptions\Forbidden;
use Espo\Core\Exceptions\NotFound;
use Espo\Core\Exceptions\Error;
@@ -34,6 +34,7 @@ use Espo\Modules\Crm\Business\Event\Invitations;
use Espo\Services\Email as EmailService;
use Espo\Core\Exceptions\NotFound;
use Espo\Core\Exceptions\BadRequest;
use Espo\Core\Di;
@@ -36,6 +36,7 @@ use Espo\ORM\Query\Select;
use Espo\Core\Exceptions\NotFound;
use Espo\Core\Exceptions\BadRequest;
use Espo\Core\Exceptions\Forbidden;
use Espo\Core\Exceptions\Error;
use Espo\Core\{
Record\Collection as RecordCollection,
@@ -29,6 +29,8 @@
namespace Espo\ORM\Query;
use RuntimeException;
class DeleteBuilder implements Builder
{
use SelectingBuilderTrait;
@@ -32,6 +32,7 @@ namespace Espo\ORM\QueryComposer;
use Espo\ORM\{
Query\LockTable as LockTableQuery,
};
use LogicException;
class MysqlQueryComposer extends BaseQueryComposer
{
@@ -49,6 +49,8 @@ class Preferences implements Repository,
use Di\ConfigSetter;
use Di\EntityManagerSetter;
protected $entityFactory;
public function __construct(
EntityManager $entityManager,
EntityFactory $entityFactory
@@ -36,6 +36,7 @@ use Espo\Core\ExternalAccount\ClientManager;
use Espo\Core\Exceptions\Error;
use Espo\Core\Exceptions\NotFound;
use Espo\Core\Exceptions\NotFoundSilent;
use Espo\Core\Exceptions\Forbidden;
use Espo\Core\Record\ReadParams;
@@ -35,6 +35,7 @@ use Espo\{
};
use Espo\Core\{
Exceptions\Forbidden,
Exceptions\NotFound,
Exceptions\Error,
Utils\Util,
+1
View File
@@ -35,6 +35,7 @@ use Espo\ORM\{
};
use Espo\Core\{
Exceptions\NotFound,
Exceptions\Error,
Exceptions\Forbidden,
Select\SearchParams,
+2
View File
@@ -104,6 +104,8 @@ class Stream
private $selectBuilderFactory;
private $userAclManagerProvider;
private $noteAccessControl;
private $recordServiceContainer;
@@ -30,6 +30,7 @@
namespace Espo\Tools\FieldManager;
use Espo\Core\{
Exceptions\BadRequest,
Exceptions\Error,
Exceptions\Conflict,
Container,
+2
View File
@@ -94,6 +94,8 @@ class Import
private $jobSchedulerFactory;
private $recordServiceContainer;
private $log;
public function __construct(
@@ -48,6 +48,8 @@ class PrinterController
private $injectableFactory;
private $engine;
public function __construct(
Metadata $metadata,
InjectableFactory $injectableFactory,