update phpstan, ref
This commit is contained in:
@@ -312,7 +312,7 @@ class AclManager
|
||||
|
||||
$interface = $this->entityActionInterfaceMap[$action] ?? null;
|
||||
|
||||
if ($interface && $checker instanceof $interface) {
|
||||
if ($interface && $checker instanceof $interface && method_exists($checker, $methodName)) {
|
||||
return $checker->$methodName($user, $entity, $data);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Espo\Core\Action;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Params
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ use SensitiveParameter;
|
||||
/**
|
||||
* An auth token data. Used for auth token creation.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Data
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace Espo\Core\Authentication;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class AuthenticationData
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ use UnexpectedValueException;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Rsa implements Key
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ use RuntimeException;
|
||||
/**
|
||||
* JWT token.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Token
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ use JsonException;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Header
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ use JsonException;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Payload
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace Espo\Core\Authentication\Login;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class MetadataParams
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace Espo\Core\Authentication\Logout;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Params
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace Espo\Core\Authentication\Logout;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Result
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@ use stdClass;
|
||||
/**
|
||||
* An authentication result.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Result
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Espo\Core\Authentication\Result;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Data
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ use Espo\Core\Utils\Util;
|
||||
/**
|
||||
* Command parameters.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Params
|
||||
{
|
||||
|
||||
@@ -33,8 +33,6 @@ use Espo\Core\Field\Address\AddressBuilder;
|
||||
|
||||
/**
|
||||
* An address value object. Immutable.
|
||||
*
|
||||
* @immutable
|
||||
*/
|
||||
class Address
|
||||
{
|
||||
|
||||
@@ -36,8 +36,6 @@ use InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* A currency value object. Immutable.
|
||||
*
|
||||
* @immutable
|
||||
*/
|
||||
class Currency
|
||||
{
|
||||
|
||||
@@ -39,8 +39,6 @@ use RuntimeException;
|
||||
|
||||
/**
|
||||
* A date value object. Immutable.
|
||||
*
|
||||
* @immutable
|
||||
*/
|
||||
class Date implements DateTimeable
|
||||
{
|
||||
|
||||
@@ -39,8 +39,6 @@ use RuntimeException;
|
||||
|
||||
/**
|
||||
* A date-time value object. Immutable.
|
||||
*
|
||||
* @immutable
|
||||
*/
|
||||
class DateTime implements DateTimeable
|
||||
{
|
||||
|
||||
@@ -39,8 +39,6 @@ use RuntimeException;
|
||||
|
||||
/**
|
||||
* A date-time or date. Immutable.
|
||||
*
|
||||
* @immutable
|
||||
*/
|
||||
class DateTimeOptional implements DateTimeable
|
||||
{
|
||||
|
||||
@@ -35,8 +35,6 @@ use FILTER_VALIDATE_EMAIL;
|
||||
|
||||
/**
|
||||
* An email address value. Immutable.
|
||||
*
|
||||
* @immutable
|
||||
*/
|
||||
class EmailAddress
|
||||
{
|
||||
|
||||
@@ -34,8 +34,6 @@ use RuntimeException;
|
||||
/**
|
||||
* An email address group. Contains a list of email addresses. One email address is set as primary.
|
||||
* If not empty, then there always should be a primary address. Immutable.
|
||||
*
|
||||
* @immutable
|
||||
*/
|
||||
class EmailAddressGroup
|
||||
{
|
||||
|
||||
@@ -33,8 +33,6 @@ use RuntimeException;
|
||||
|
||||
/**
|
||||
* A link value object. Immutable.
|
||||
*
|
||||
* @immutable
|
||||
*/
|
||||
class Link
|
||||
{
|
||||
|
||||
@@ -33,8 +33,6 @@ use RuntimeException;
|
||||
|
||||
/**
|
||||
* A link-multiple value object. Immutable.
|
||||
*
|
||||
* @immutable
|
||||
*/
|
||||
class LinkMultiple
|
||||
{
|
||||
|
||||
@@ -33,8 +33,6 @@ use RuntimeException;
|
||||
|
||||
/**
|
||||
* A link-multiple item. Immutable.
|
||||
*
|
||||
* @immutable
|
||||
*/
|
||||
class LinkMultipleItem
|
||||
{
|
||||
|
||||
@@ -34,8 +34,6 @@ use RuntimeException;
|
||||
|
||||
/**
|
||||
* A link-parent value object. Immutable.
|
||||
*
|
||||
* @immutable
|
||||
*/
|
||||
class LinkParent
|
||||
{
|
||||
|
||||
@@ -33,8 +33,6 @@ use RuntimeException;
|
||||
|
||||
/**
|
||||
* A phone number value. Immutable.
|
||||
*
|
||||
* @immutable
|
||||
*/
|
||||
class PhoneNumber
|
||||
{
|
||||
|
||||
@@ -34,8 +34,6 @@ use RuntimeException;
|
||||
/**
|
||||
* A phone number group. Contains a list of phone numbers. One phone number is set as primary.
|
||||
* If not empty, then there always should be a primary number. Immutable.
|
||||
*
|
||||
* @immutable
|
||||
*/
|
||||
class PhoneNumberGroup
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace Espo\Core\FieldProcessing\Loader;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Params
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace Espo\Core\FieldProcessing\Saver;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Params
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace Espo\Core\Mail\Account;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class ImapParams
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace Espo\Core\Mail\Account\Storage;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Params
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Espo\Core\Mail\Importer;
|
||||
use Espo\Entities\EmailFilter;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Data
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Espo\Core\Mail;
|
||||
/**
|
||||
* Sender parameters.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class SenderParams
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ use RuntimeException;
|
||||
/**
|
||||
* SMTP parameters.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class SmtpParams
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ use Espo\Core\Select\SearchParams;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Params
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Espo\Core\MassAction;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Result
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace Espo\Core\MassAction;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class ServiceParams
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace Espo\Core\MassAction;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class ServiceResult
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace Espo\Core\Notification\AssignmentNotificator;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Params
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace Espo\Core\Record;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class CreateParams
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace Espo\Core\Record;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class DeleteParams
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace Espo\Core\Record;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class FindParams
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace Espo\Core\Record;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class ReadParams
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace Espo\Core\Record;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class UpdateParams
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ use Espo\Core\Select\SearchParams;
|
||||
use InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Item
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ use InvalidArgumentException;
|
||||
/**
|
||||
* Order parameters.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Params
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ use stdClass;
|
||||
/**
|
||||
* Search parameters.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class SearchParams
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Espo\Core\Select\Text\Filter;
|
||||
use Espo\ORM\Query\Part\WhereItem;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Data
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace Espo\Core\Select\Text;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class FilterParams
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ use Espo\ORM\Query\Part\Expression;
|
||||
use InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Data
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace Espo\Core\Select\Text\FullTextSearch\DataComposer;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Params
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Espo\Core\Select\Where\Converter;
|
||||
/**
|
||||
* Where converter parameters.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
* @since 9.0.0
|
||||
*/
|
||||
class Params
|
||||
|
||||
@@ -37,7 +37,7 @@ use RuntimeException;
|
||||
/**
|
||||
* A where item.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Item
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ use InvalidArgumentException;
|
||||
/**
|
||||
* Where parameters.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Params
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Espo\Core\Utils\Client\ActionRenderer;
|
||||
use Espo\Core\Utils\Client\Script;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Params
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ use Espo\ORM\Defs\Params\AttributeParam;
|
||||
use Espo\ORM\Type\AttributeType;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class AttributeDefs
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Espo\Core\Utils\Database\Orm\Defs;
|
||||
use Espo\ORM\Defs\Params\EntityParam;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class EntityDefs
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ use Espo\Core\Utils\Util;
|
||||
use Espo\ORM\Defs\Params\IndexParam;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class IndexDefs
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace Espo\Core\Utils\Resource\FileReader;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Params
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ use UnexpectedValueException;
|
||||
/**
|
||||
* Raw attribute values of multiple records.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Values
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ use InvalidArgumentException;
|
||||
use UnexpectedValueException;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class DateRange
|
||||
{
|
||||
|
||||
@@ -1091,15 +1091,9 @@ class BaseEntity implements Entity
|
||||
|
||||
$copy = (object) [];
|
||||
|
||||
foreach (get_object_vars($value) as $k => $item) {
|
||||
foreach (get_object_vars($value) as $key => $item) {
|
||||
/** @var stdClass|mixed[]|scalar|null $item */
|
||||
|
||||
$key = $k;
|
||||
|
||||
if (!is_string($key)) {
|
||||
$key = strval($key);
|
||||
}
|
||||
|
||||
if (is_object($item)) {
|
||||
$copy->$key = $this->cloneObject($item);
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace Espo\ORM;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class DatabaseParams
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ use RuntimeException;
|
||||
/**
|
||||
* Delete parameters.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Delete implements Query
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ use RuntimeException;
|
||||
/**
|
||||
* Insert parameters.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Insert implements Query
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ use RuntimeException;
|
||||
/**
|
||||
* LOCK TABLE parameters.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class LockTable implements Query
|
||||
{
|
||||
|
||||
@@ -35,8 +35,6 @@ use RuntimeException;
|
||||
|
||||
/**
|
||||
* A complex expression. Can be a function or a simple column reference. Immutable.
|
||||
*
|
||||
* @immutable
|
||||
*/
|
||||
class Expression implements WhereItem
|
||||
{
|
||||
|
||||
@@ -35,8 +35,6 @@ use RuntimeException;
|
||||
|
||||
/**
|
||||
* A join item. Immutable.
|
||||
*
|
||||
* @immutable
|
||||
*/
|
||||
class Join
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ use RuntimeException;
|
||||
/**
|
||||
* An order item. Immutable.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Order
|
||||
{
|
||||
|
||||
@@ -35,7 +35,8 @@ use Iterator;
|
||||
/**
|
||||
* A list of order items.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*
|
||||
* @implements Iterator<Order>
|
||||
*/
|
||||
class OrderList implements Iterator
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Espo\ORM\Query\Part;
|
||||
/**
|
||||
* A select item. Immutable.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Selection
|
||||
{
|
||||
|
||||
@@ -34,8 +34,6 @@ use Espo\ORM\Query\Part\WhereItem;
|
||||
|
||||
/**
|
||||
* AND-group. Immutable.
|
||||
*
|
||||
* @immutable
|
||||
*/
|
||||
class AndGroup implements WhereItem
|
||||
{
|
||||
@@ -86,6 +84,7 @@ class AndGroup implements WhereItem
|
||||
new WhereClause() :
|
||||
new self();
|
||||
|
||||
/** @phpstan-ignore-next-line */
|
||||
$obj->rawValue = $whereClause;
|
||||
|
||||
return $obj;
|
||||
|
||||
@@ -37,8 +37,6 @@ use RuntimeException;
|
||||
|
||||
/**
|
||||
* Compares an expression to a value or another expression. Immutable.
|
||||
*
|
||||
* @immutable
|
||||
*/
|
||||
class Comparison implements WhereItem
|
||||
{
|
||||
|
||||
@@ -34,8 +34,6 @@ use Espo\ORM\Query\Select;
|
||||
|
||||
/**
|
||||
* An EXISTS-operator. Immutable.
|
||||
*
|
||||
* @immutable
|
||||
*/
|
||||
class Exists implements WhereItem
|
||||
{
|
||||
|
||||
@@ -33,8 +33,6 @@ use Espo\ORM\Query\Part\WhereItem;
|
||||
|
||||
/**
|
||||
* A NOT-operator. Immutable.
|
||||
*
|
||||
* @immutable
|
||||
*/
|
||||
class Not implements WhereItem
|
||||
{
|
||||
|
||||
@@ -33,8 +33,6 @@ use Espo\ORM\Query\Part\WhereItem;
|
||||
|
||||
/**
|
||||
* OR-group. Immutable.
|
||||
*
|
||||
* @immutable
|
||||
*/
|
||||
class OrGroup implements WhereItem
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ use Espo\ORM\Query\Part\Where\AndGroup;
|
||||
/**
|
||||
* A where-clause. Immutable.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class WhereClause extends AndGroup
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ use RuntimeException;
|
||||
/**
|
||||
* Select parameters.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*
|
||||
* @todo Add validation and normalization.
|
||||
*/
|
||||
|
||||
@@ -34,7 +34,7 @@ use RuntimeException;
|
||||
/**
|
||||
* Union parameters.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Union implements SelectingQuery
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ use RuntimeException;
|
||||
/**
|
||||
* Update parameters.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Update implements Query
|
||||
{
|
||||
|
||||
@@ -1196,8 +1196,7 @@ abstract class BaseQueryComposer implements QueryComposer
|
||||
$entityType = $entity->getEntityType();
|
||||
|
||||
if (strpos($attribute, ':') && !Util::isArgumentString($attribute)) {
|
||||
/** @var int $delimiterPosition */
|
||||
$delimiterPosition = strpos($attribute, ':');
|
||||
$delimiterPosition = (int) strpos($attribute, ':');
|
||||
$function = substr($attribute, 0, $delimiterPosition);
|
||||
$attribute = substr($attribute, $delimiterPosition + 1);
|
||||
|
||||
@@ -1211,38 +1210,29 @@ abstract class BaseQueryComposer implements QueryComposer
|
||||
$function = strtoupper($this->sanitize($function));
|
||||
}
|
||||
|
||||
$argumentPartList = null;
|
||||
if (!$function) {
|
||||
return $this->getFunctionArgumentPart($entity, $attribute, $distinct, $params);
|
||||
|
||||
if ($function) {
|
||||
$arguments = $attribute;
|
||||
|
||||
$argumentList = Util::parseArgumentListFromFunctionContent($arguments);
|
||||
|
||||
$argumentPartList = [];
|
||||
|
||||
foreach ($argumentList as $argument) {
|
||||
$argumentPartList[] = $this->getFunctionArgumentPart($entity, $argument, $distinct, $params);
|
||||
}
|
||||
|
||||
$part = implode(', ', $argumentPartList);
|
||||
} else {
|
||||
$part = $this->getFunctionArgumentPart($entity, $attribute, $distinct, $params);
|
||||
}
|
||||
|
||||
if ($function) {
|
||||
/** @var string[] $argumentPartList */
|
||||
$argumentList = Util::parseArgumentListFromFunctionContent($attribute);
|
||||
|
||||
$part = $this->getFunctionPart(
|
||||
$function,
|
||||
$part,
|
||||
$params,
|
||||
$entityType,
|
||||
$distinct,
|
||||
$argumentPartList
|
||||
);
|
||||
$argumentPartList = [];
|
||||
|
||||
foreach ($argumentList as $argument) {
|
||||
$argumentPartList[] = $this->getFunctionArgumentPart($entity, $argument, $distinct, $params);
|
||||
}
|
||||
|
||||
return $part;
|
||||
$part = implode(', ', $argumentPartList);
|
||||
|
||||
return $this->getFunctionPart(
|
||||
$function,
|
||||
$part,
|
||||
$params,
|
||||
$entityType,
|
||||
$distinct,
|
||||
$argumentPartList
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1300,7 +1290,7 @@ abstract class BaseQueryComposer implements QueryComposer
|
||||
$entityType = $entity->getEntityType();
|
||||
|
||||
if (strpos($argument, '.')) {
|
||||
list($relName, $attribute) = explode('.', $argument);
|
||||
[$relName, $attribute] = explode('.', $argument);
|
||||
}
|
||||
|
||||
if (!empty($relName)) {
|
||||
@@ -1390,12 +1380,12 @@ abstract class BaseQueryComposer implements QueryComposer
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $params
|
||||
* @param array<string, mixed> $params
|
||||
*/
|
||||
protected function getAttributeOrderSql(
|
||||
Entity $entity,
|
||||
string $attribute,
|
||||
?array &$params,
|
||||
array &$params,
|
||||
string $order
|
||||
): string {
|
||||
|
||||
@@ -1465,13 +1455,13 @@ abstract class BaseQueryComposer implements QueryComposer
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $params
|
||||
* @param array<string, mixed> $params
|
||||
*/
|
||||
protected function getAttributeSql(
|
||||
Entity $entity,
|
||||
string $attribute,
|
||||
string $type,
|
||||
?array &$params = null,
|
||||
array &$params = [],
|
||||
?string $alias = null
|
||||
): string {
|
||||
|
||||
@@ -2154,7 +2144,7 @@ abstract class BaseQueryComposer implements QueryComposer
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $params
|
||||
* @param array<string, mixed> $params
|
||||
* @param mixed $orderBy
|
||||
* @param mixed $order
|
||||
*/
|
||||
@@ -2162,7 +2152,7 @@ abstract class BaseQueryComposer implements QueryComposer
|
||||
Entity $entity,
|
||||
$orderBy = null,
|
||||
$order = null,
|
||||
?array &$params = null,
|
||||
array &$params = [],
|
||||
bool $noCustom = false
|
||||
): ?string {
|
||||
|
||||
@@ -2234,7 +2224,7 @@ abstract class BaseQueryComposer implements QueryComposer
|
||||
return $this->getAttributeOrderSql($entity, $orderBy, $params, $order);
|
||||
}
|
||||
|
||||
$fieldPath = $this->getAttributePathForOrderBy($entity, $orderBy, $params ?? []);
|
||||
$fieldPath = $this->getAttributePathForOrderBy($entity, $orderBy, $params);
|
||||
|
||||
if ($fieldPath === null || $fieldPath === '') {
|
||||
throw new LogicException("Could not handle 'order' for '".$entity->getEntityType()."'.");
|
||||
@@ -2244,11 +2234,11 @@ abstract class BaseQueryComposer implements QueryComposer
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $params
|
||||
* @param array<string, mixed> $params
|
||||
* @param mixed $orderBy
|
||||
* @param mixed $order
|
||||
*/
|
||||
protected function getOrderPart(Entity $entity, $orderBy = null, $order = null, &$params = null): ?string
|
||||
protected function getOrderPart(Entity $entity, $orderBy = null, $order = null, &$params = []): ?string
|
||||
{
|
||||
return $this->getOrderExpressionPart($entity, $orderBy, $order, $params);
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ class Util
|
||||
self::getAllAttributesFromComplexExpressionImplementation($argument, $list);
|
||||
}
|
||||
|
||||
return $list;
|
||||
return $list ?? [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,7 +34,7 @@ use Espo\ORM\Repository\Option\Traits\Options;
|
||||
/**
|
||||
* Mass-relate options.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class MassRelateOptions
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ use Espo\ORM\Repository\Option\Traits\Options;
|
||||
/**
|
||||
* Relate options.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class RelateOptions
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ use Espo\ORM\Repository\Option\Traits\Options;
|
||||
/**
|
||||
* Remove options.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class RemoveOptions
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ use Espo\ORM\Repository\Option\Traits\Options;
|
||||
/**
|
||||
* Save options.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class SaveOptions
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ use Espo\ORM\Repository\Option\Traits\Options;
|
||||
/**
|
||||
* Unrelate options.
|
||||
*
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class UnrelateOptions
|
||||
{
|
||||
|
||||
@@ -89,7 +89,7 @@ class ExternalAccount extends Record implements Di\HookManagerAware
|
||||
$client = $this->getClient($integration, $userId);
|
||||
|
||||
if ($client && method_exists($client, 'ping')) {
|
||||
/** @var @bool */
|
||||
/** @var bool */
|
||||
return $client->ping();
|
||||
}
|
||||
} catch (Exception) {}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Espo\Tools\Attachment;
|
||||
use Espo\Core\Exceptions\Error;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class FieldData
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Espo\Tools\Attachment;
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class FileData
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace Espo\Tools\EmailTemplate;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Params
|
||||
{
|
||||
|
||||
@@ -577,8 +577,6 @@ class PhpSpreadsheetProcessor implements ProcessorInterface
|
||||
|
||||
$cell = $sheet->getCell($coordinate);
|
||||
|
||||
assert($cell !== null);
|
||||
|
||||
$hyperLink = $cell->getHyperlink();
|
||||
|
||||
$hyperLink->setUrl($link);
|
||||
|
||||
@@ -35,7 +35,7 @@ use Espo\Core\Select\Where\Item as WhereItem;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Params
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Espo\Tools\Export\Processor;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Params
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace Espo\Tools\Export;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Result
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace Espo\Tools\Export;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class ServiceResult
|
||||
{
|
||||
|
||||
@@ -607,7 +607,7 @@ class FieldManager
|
||||
|
||||
private function setTooltipText(string $scope, string $name, string $value): void
|
||||
{
|
||||
if ($value && $value !== '') {
|
||||
if ($value !== '' && $value) {
|
||||
$this->language->set($scope, 'tooltips', $name, $value);
|
||||
$this->baseLanguage->set($scope, 'tooltips', $name, $value);
|
||||
} else {
|
||||
@@ -877,7 +877,7 @@ class FieldManager
|
||||
?string $type,
|
||||
string $scope,
|
||||
string $name,
|
||||
&$defs = null,
|
||||
&$defs = [],
|
||||
$options = []
|
||||
): void {
|
||||
|
||||
|
||||
@@ -890,7 +890,7 @@ class Import
|
||||
return intval($value);
|
||||
|
||||
case Entity::BOOL:
|
||||
if ($value && strtolower($value) !== 'false' && $value !== '0') {
|
||||
if ($value !== '0' && $value && strtolower($value) !== 'false') {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ use stdClass;
|
||||
use TypeError;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Params
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Espo\Tools\Import;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
* @immutable
|
||||
* Immutable.
|
||||
*/
|
||||
class Result
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user