EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
update phpstan, ref
Yuri Kuznetsove92b200eb32f
diff --git a/application/Espo/Core/AclManager.php b/application/Espo/Core/AclManager.phpindex fc03b14755..b7af052a08 100644--- a/application/Espo/Core/AclManager.php+++ b/application/Espo/Core/AclManager.php@@ -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);}diff --git a/application/Espo/Core/Action/Params.php b/application/Espo/Core/Action/Params.phpindex 6389f77d17..b4fecfd14d 100644--- a/application/Espo/Core/Action/Params.php+++ b/application/Espo/Core/Action/Params.php@@ -32,7 +32,7 @@ namespace Espo\Core\Action;use RuntimeException;/**- * @immutable+ * Immutable.*/class Params{diff --git a/application/Espo/Core/Authentication/AuthToken/Data.php b/application/Espo/Core/Authentication/AuthToken/Data.phpindex e6069c3b74..613f155424 100644--- a/application/Espo/Core/Authentication/AuthToken/Data.php+++ b/application/Espo/Core/Authentication/AuthToken/Data.php@@ -35,7 +35,7 @@ use SensitiveParameter;/*** An auth token data. Used for auth token creation.*- * @immutable+ * Immutable.*/class Data{diff --git a/application/Espo/Core/Authentication/AuthenticationData.php b/application/Espo/Core/Authentication/AuthenticationData.phpindex 56fd9a766b..d306ec0d4b 100644--- a/application/Espo/Core/Authentication/AuthenticationData.php+++ b/application/Espo/Core/Authentication/AuthenticationData.php@@ -30,7 +30,7 @@namespace Espo\Core\Authentication;/**- * @immutable+ * Immutable.*/class AuthenticationData{diff --git a/application/Espo/Core/Authentication/Jwt/Keys/Rsa.php b/application/Espo/Core/Authentication/Jwt/Keys/Rsa.phpindex 2aadf67e32..dbdf5b25d7 100644--- a/application/Espo/Core/Authentication/Jwt/Keys/Rsa.php+++ b/application/Espo/Core/Authentication/Jwt/Keys/Rsa.php@@ -34,7 +34,7 @@ use UnexpectedValueException;use stdClass;/**- * @immutable+ * Immutable.*/class Rsa implements Key{diff --git a/application/Espo/Core/Authentication/Jwt/Token.php b/application/Espo/Core/Authentication/Jwt/Token.phpindex 254da51403..7a18f37c98 100644--- a/application/Espo/Core/Authentication/Jwt/Token.php+++ b/application/Espo/Core/Authentication/Jwt/Token.php@@ -36,7 +36,7 @@ use RuntimeException;/*** JWT token.*- * @immutable+ * Immutable.*/class Token{diff --git a/application/Espo/Core/Authentication/Jwt/Token/Header.php b/application/Espo/Core/Authentication/Jwt/Token/Header.phpindex ebd8245536..2fb2e3f606 100644--- a/application/Espo/Core/Authentication/Jwt/Token/Header.php+++ b/application/Espo/Core/Authentication/Jwt/Token/Header.php@@ -35,7 +35,7 @@ use JsonException;use stdClass;/**- * @immutable+ * Immutable.*/class Header{diff --git a/application/Espo/Core/Authentication/Jwt/Token/Payload.php b/application/Espo/Core/Authentication/Jwt/Token/Payload.phpindex e459103347..829c4d8fdb 100644--- a/application/Espo/Core/Authentication/Jwt/Token/Payload.php+++ b/application/Espo/Core/Authentication/Jwt/Token/Payload.php@@ -35,7 +35,7 @@ use JsonException;use stdClass;/**- * @immutable+ * Immutable.*/class Payload{diff --git a/application/Espo/Core/Authentication/Login/MetadataParams.php b/application/Espo/Core/Authentication/Login/MetadataParams.phpindex 7c1b69d382..80ec4acaf5 100644--- a/application/Espo/Core/Authentication/Login/MetadataParams.php+++ b/application/Espo/Core/Authentication/Login/MetadataParams.php@@ -30,7 +30,7 @@namespace Espo\Core\Authentication\Login;/**- * @immutable+ * Immutable.*/class MetadataParams{diff --git a/application/Espo/Core/Authentication/Logout/Params.php b/application/Espo/Core/Authentication/Logout/Params.phpindex 62b950b210..e287c5a793 100644--- a/application/Espo/Core/Authentication/Logout/Params.php+++ b/application/Espo/Core/Authentication/Logout/Params.php@@ -30,7 +30,7 @@namespace Espo\Core\Authentication\Logout;/**- * @immutable+ * Immutable.*/class Params{diff --git a/application/Espo/Core/Authentication/Logout/Result.php b/application/Espo/Core/Authentication/Logout/Result.phpindex 03c02637a1..4f71316bed 100644--- a/application/Espo/Core/Authentication/Logout/Result.php+++ b/application/Espo/Core/Authentication/Logout/Result.php@@ -30,7 +30,7 @@namespace Espo\Core\Authentication\Logout;/**- * @immutable+ * Immutable.*/class Result{diff --git a/application/Espo/Core/Authentication/Result.php b/application/Espo/Core/Authentication/Result.phpindex 7c500200a2..f976f8a1b2 100644--- a/application/Espo/Core/Authentication/Result.php+++ b/application/Espo/Core/Authentication/Result.php@@ -37,7 +37,7 @@ use stdClass;/*** An authentication result.*- * @immutable+ * Immutable.*/class Result{diff --git a/application/Espo/Core/Authentication/Result/Data.php b/application/Espo/Core/Authentication/Result/Data.phpindex 049ec42fd7..f0f6cf14c2 100644--- a/application/Espo/Core/Authentication/Result/Data.php+++ b/application/Espo/Core/Authentication/Result/Data.php@@ -32,7 +32,7 @@ namespace Espo\Core\Authentication\Result;use stdClass;/**- * @immutable+ * Immutable.*/class Data{diff --git a/application/Espo/Core/Console/Command/Params.php b/application/Espo/Core/Console/Command/Params.phpindex 041bbdb5b4..71341b7dfb 100644--- a/application/Espo/Core/Console/Command/Params.php+++ b/application/Espo/Core/Console/Command/Params.php@@ -34,7 +34,7 @@ use Espo\Core\Utils\Util;/*** Command parameters.*- * @immutable+ * Immutable.*/class Params{diff --git a/application/Espo/Core/Field/Address.php b/application/Espo/Core/Field/Address.phpindex 2705a90bcf..c30eaa5ef5 100644--- a/application/Espo/Core/Field/Address.php+++ b/application/Espo/Core/Field/Address.php@@ -33,8 +33,6 @@ use Espo\Core\Field\Address\AddressBuilder;/*** An address value object. Immutable.- *- * @immutable*/class Address{diff --git a/application/Espo/Core/Field/Currency.php b/application/Espo/Core/Field/Currency.phpindex b28ebe4c82..7b14ac1c6c 100644--- a/application/Espo/Core/Field/Currency.php+++ b/application/Espo/Core/Field/Currency.php@@ -36,8 +36,6 @@ use InvalidArgumentException;/*** A currency value object. Immutable.- *- * @immutable*/class Currency{diff --git a/application/Espo/Core/Field/Date.php b/application/Espo/Core/Field/Date.phpindex a245ce49b4..e278d6d58d 100644--- a/application/Espo/Core/Field/Date.php+++ b/application/Espo/Core/Field/Date.php@@ -39,8 +39,6 @@ use RuntimeException;/*** A date value object. Immutable.- *- * @immutable*/class Date implements DateTimeable{diff --git a/application/Espo/Core/Field/DateTime.php b/application/Espo/Core/Field/DateTime.phpindex ebca7d2ba7..7ec4fadc9d 100644--- a/application/Espo/Core/Field/DateTime.php+++ b/application/Espo/Core/Field/DateTime.php@@ -39,8 +39,6 @@ use RuntimeException;/*** A date-time value object. Immutable.- *- * @immutable*/class DateTime implements DateTimeable{diff --git a/application/Espo/Core/Field/DateTimeOptional.php b/application/Espo/Core/Field/DateTimeOptional.phpindex 35d94729af..5036a04616 100644--- a/application/Espo/Core/Field/DateTimeOptional.php+++ b/application/Espo/Core/Field/DateTimeOptional.php@@ -39,8 +39,6 @@ use RuntimeException;/*** A date-time or date. Immutable.- *- * @immutable*/class DateTimeOptional implements DateTimeable{diff --git a/application/Espo/Core/Field/EmailAddress.php b/application/Espo/Core/Field/EmailAddress.phpindex 17d24e2064..3bf0d73662 100644--- a/application/Espo/Core/Field/EmailAddress.php+++ b/application/Espo/Core/Field/EmailAddress.php@@ -35,8 +35,6 @@ use FILTER_VALIDATE_EMAIL;/*** An email address value. Immutable.- *- * @immutable*/class EmailAddress{diff --git a/application/Espo/Core/Field/EmailAddressGroup.php b/application/Espo/Core/Field/EmailAddressGroup.phpindex 3c41bdfe20..ae8f00df82 100644--- a/application/Espo/Core/Field/EmailAddressGroup.php+++ b/application/Espo/Core/Field/EmailAddressGroup.php@@ -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{diff --git a/application/Espo/Core/Field/Link.php b/application/Espo/Core/Field/Link.phpindex 1c1d9a5c10..7e7ace6264 100644--- a/application/Espo/Core/Field/Link.php+++ b/application/Espo/Core/Field/Link.php@@ -33,8 +33,6 @@ use RuntimeException;/*** A link value object. Immutable.- *- * @immutable*/class Link{diff --git a/application/Espo/Core/Field/LinkMultiple.php b/application/Espo/Core/Field/LinkMultiple.phpindex 991edc990f..9bd9d5788e 100644--- a/application/Espo/Core/Field/LinkMultiple.php+++ b/application/Espo/Core/Field/LinkMultiple.php@@ -33,8 +33,6 @@ use RuntimeException;/*** A link-multiple value object. Immutable.- *- * @immutable*/class LinkMultiple{diff --git a/application/Espo/Core/Field/LinkMultipleItem.php b/application/Espo/Core/Field/LinkMultipleItem.phpindex d756076d00..dc5714c3f0 100644--- a/application/Espo/Core/Field/LinkMultipleItem.php+++ b/application/Espo/Core/Field/LinkMultipleItem.php@@ -33,8 +33,6 @@ use RuntimeException;/*** A link-multiple item. Immutable.- *- * @immutable*/class LinkMultipleItem{diff --git a/application/Espo/Core/Field/LinkParent.php b/application/Espo/Core/Field/LinkParent.phpindex 6978dd78c9..816248fc60 100644--- a/application/Espo/Core/Field/LinkParent.php+++ b/application/Espo/Core/Field/LinkParent.php@@ -34,8 +34,6 @@ use RuntimeException;/*** A link-parent value object. Immutable.- *- * @immutable*/class LinkParent{diff --git a/application/Espo/Core/Field/PhoneNumber.php b/application/Espo/Core/Field/PhoneNumber.phpindex d1a4478e6d..05019b0473 100644--- a/application/Espo/Core/Field/PhoneNumber.php+++ b/application/Espo/Core/Field/PhoneNumber.php@@ -33,8 +33,6 @@ use RuntimeException;/*** A phone number value. Immutable.- *- * @immutable*/class PhoneNumber{diff --git a/application/Espo/Core/Field/PhoneNumberGroup.php b/application/Espo/Core/Field/PhoneNumberGroup.phpindex 0fb6dc9c0f..1bd4735dc1 100644--- a/application/Espo/Core/Field/PhoneNumberGroup.php+++ b/application/Espo/Core/Field/PhoneNumberGroup.php@@ -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{diff --git a/application/Espo/Core/FieldProcessing/Loader/Params.php b/application/Espo/Core/FieldProcessing/Loader/Params.phpindex f13cacb33e..3c1a6b7926 100644--- a/application/Espo/Core/FieldProcessing/Loader/Params.php+++ b/application/Espo/Core/FieldProcessing/Loader/Params.php@@ -30,7 +30,7 @@namespace Espo\Core\FieldProcessing\Loader;/**- * @immutable+ * Immutable.*/class Params{diff --git a/application/Espo/Core/FieldProcessing/Saver/Params.php b/application/Espo/Core/FieldProcessing/Saver/Params.phpindex 1bffe362cc..6e0ba454bc 100644--- a/application/Espo/Core/FieldProcessing/Saver/Params.php+++ b/application/Espo/Core/FieldProcessing/Saver/Params.php@@ -30,7 +30,7 @@namespace Espo\Core\FieldProcessing\Saver;/**- * @immutable+ * Immutable.*/class Params{diff --git a/application/Espo/Core/Mail/Account/ImapParams.php b/application/Espo/Core/Mail/Account/ImapParams.phpindex 5bb253bec1..e0675c70e4 100644--- a/application/Espo/Core/Mail/Account/ImapParams.php+++ b/application/Espo/Core/Mail/Account/ImapParams.php@@ -30,7 +30,7 @@namespace Espo\Core\Mail\Account;/**- * @immutable+ * Immutable.*/class ImapParams{diff --git a/application/Espo/Core/Mail/Account/Storage/Params.php b/application/Espo/Core/Mail/Account/Storage/Params.phpindex 4fcfe12436..ad7e297ac7 100644--- a/application/Espo/Core/Mail/Account/Storage/Params.php+++ b/application/Espo/Core/Mail/Account/Storage/Params.php@@ -30,7 +30,7 @@namespace Espo\Core\Mail\Account\Storage;/**- * @immutable+ * Immutable.*/class Params{diff --git a/application/Espo/Core/Mail/Importer/Data.php b/application/Espo/Core/Mail/Importer/Data.phpindex 767836606a..de4a9c7af9 100644--- a/application/Espo/Core/Mail/Importer/Data.php+++ b/application/Espo/Core/Mail/Importer/Data.php@@ -32,7 +32,7 @@ namespace Espo\Core\Mail\Importer;use Espo\Entities\EmailFilter;/**- * @immutable+ * Immutable.*/class Data{diff --git a/application/Espo/Core/Mail/SenderParams.php b/application/Espo/Core/Mail/SenderParams.phpindex 76a9f37d2d..417e286cc9 100644--- a/application/Espo/Core/Mail/SenderParams.php+++ b/application/Espo/Core/Mail/SenderParams.php@@ -32,7 +32,7 @@ namespace Espo\Core\Mail;/*** Sender parameters.*- * @immutable+ * Immutable.*/class SenderParams{diff --git a/application/Espo/Core/Mail/SmtpParams.php b/application/Espo/Core/Mail/SmtpParams.phpindex 4f73f3d6eb..2640ef3cc5 100644--- a/application/Espo/Core/Mail/SmtpParams.php+++ b/application/Espo/Core/Mail/SmtpParams.php@@ -34,7 +34,7 @@ use RuntimeException;/*** SMTP parameters.*- * @immutable+ * Immutable.*/class SmtpParams{diff --git a/application/Espo/Core/MassAction/Params.php b/application/Espo/Core/MassAction/Params.phpindex 114d128a6c..6fc05fa6c5 100644--- a/application/Espo/Core/MassAction/Params.php+++ b/application/Espo/Core/MassAction/Params.php@@ -34,7 +34,7 @@ use Espo\Core\Select\SearchParams;use RuntimeException;/**- * @immutable+ * Immutable.*/class Params{diff --git a/application/Espo/Core/MassAction/Result.php b/application/Espo/Core/MassAction/Result.phpindex b7a396cf71..bfd62c251b 100644--- a/application/Espo/Core/MassAction/Result.php+++ b/application/Espo/Core/MassAction/Result.php@@ -32,7 +32,7 @@ namespace Espo\Core\MassAction;use RuntimeException;/**- * @immutable+ * Immutable.*/class Result{diff --git a/application/Espo/Core/MassAction/ServiceParams.php b/application/Espo/Core/MassAction/ServiceParams.phpindex 88f9fecdaa..a74add4905 100644--- a/application/Espo/Core/MassAction/ServiceParams.php+++ b/application/Espo/Core/MassAction/ServiceParams.php@@ -30,7 +30,7 @@namespace Espo\Core\MassAction;/**- * @immutable+ * Immutable.*/class ServiceParams{diff --git a/application/Espo/Core/MassAction/ServiceResult.php b/application/Espo/Core/MassAction/ServiceResult.phpindex aefbdd3ddb..d50f998f42 100644--- a/application/Espo/Core/MassAction/ServiceResult.php+++ b/application/Espo/Core/MassAction/ServiceResult.php@@ -30,7 +30,7 @@namespace Espo\Core\MassAction;/**- * @immutable+ * Immutable.*/class ServiceResult{diff --git a/application/Espo/Core/Notification/AssignmentNotificator/Params.php b/application/Espo/Core/Notification/AssignmentNotificator/Params.phpindex b6b3914b69..2387da6431 100644--- a/application/Espo/Core/Notification/AssignmentNotificator/Params.php+++ b/application/Espo/Core/Notification/AssignmentNotificator/Params.php@@ -30,7 +30,7 @@namespace Espo\Core\Notification\AssignmentNotificator;/**- * @immutable+ * Immutable.*/class Params{diff --git a/application/Espo/Core/Record/CreateParams.php b/application/Espo/Core/Record/CreateParams.phpindex ad6781f70c..745eb16c5c 100644--- a/application/Espo/Core/Record/CreateParams.php+++ b/application/Espo/Core/Record/CreateParams.php@@ -30,7 +30,7 @@namespace Espo\Core\Record;/**- * @immutable+ * Immutable.*/class CreateParams{diff --git a/application/Espo/Core/Record/DeleteParams.php b/application/Espo/Core/Record/DeleteParams.phpindex 4e6fdca693..e668b9b147 100644--- a/application/Espo/Core/Record/DeleteParams.php+++ b/application/Espo/Core/Record/DeleteParams.php@@ -30,7 +30,7 @@namespace Espo\Core\Record;/**- * @immutable+ * Immutable.*/class DeleteParams{diff --git a/application/Espo/Core/Record/FindParams.php b/application/Espo/Core/Record/FindParams.phpindex 94cc2fa68c..1f9a7917a8 100644--- a/application/Espo/Core/Record/FindParams.php+++ b/application/Espo/Core/Record/FindParams.php@@ -30,7 +30,7 @@namespace Espo\Core\Record;/**- * @immutable+ * Immutable.*/class FindParams{diff --git a/application/Espo/Core/Record/ReadParams.php b/application/Espo/Core/Record/ReadParams.phpindex 8f362687e4..7dac9f7ac2 100644--- a/application/Espo/Core/Record/ReadParams.php+++ b/application/Espo/Core/Record/ReadParams.php@@ -30,7 +30,7 @@namespace Espo\Core\Record;/**- * @immutable+ * Immutable.*/class ReadParams{diff --git a/application/Espo/Core/Record/UpdateParams.php b/application/Espo/Core/Record/UpdateParams.phpindex 00ec5b9ed0..e9f3e70900 100644--- a/application/Espo/Core/Record/UpdateParams.php+++ b/application/Espo/Core/Record/UpdateParams.php@@ -30,7 +30,7 @@namespace Espo\Core\Record;/**- * @immutable+ * Immutable.*/class UpdateParams{diff --git a/application/Espo/Core/Select/Order/Item.php b/application/Espo/Core/Select/Order/Item.phpindex 6bb2ae6a5f..1553fb5f4d 100644--- a/application/Espo/Core/Select/Order/Item.php+++ b/application/Espo/Core/Select/Order/Item.php@@ -34,7 +34,7 @@ use Espo\Core\Select\SearchParams;use InvalidArgumentException;/**- * @immutable+ * Immutable.*/class Item{diff --git a/application/Espo/Core/Select/Order/Params.php b/application/Espo/Core/Select/Order/Params.phpindex a4d1fe7eb5..ae2d4bf823 100644--- a/application/Espo/Core/Select/Order/Params.php+++ b/application/Espo/Core/Select/Order/Params.php@@ -36,7 +36,7 @@ use InvalidArgumentException;/*** Order parameters.*- * @immutable+ * Immutable.*/class Params{diff --git a/application/Espo/Core/Select/SearchParams.php b/application/Espo/Core/Select/SearchParams.phpindex b83982ab22..f5b5f89407 100644--- a/application/Espo/Core/Select/SearchParams.php+++ b/application/Espo/Core/Select/SearchParams.php@@ -38,7 +38,7 @@ use stdClass;/*** Search parameters.*- * @immutable+ * Immutable.*/class SearchParams{diff --git a/application/Espo/Core/Select/Text/Filter/Data.php b/application/Espo/Core/Select/Text/Filter/Data.phpindex 07334663a2..cf59e9e245 100644--- a/application/Espo/Core/Select/Text/Filter/Data.php+++ b/application/Espo/Core/Select/Text/Filter/Data.php@@ -32,7 +32,7 @@ namespace Espo\Core\Select\Text\Filter;use Espo\ORM\Query\Part\WhereItem;/**- * @immutable+ * Immutable.*/class Data{diff --git a/application/Espo/Core/Select/Text/FilterParams.php b/application/Espo/Core/Select/Text/FilterParams.phpindex 638c0300aa..f3c7965617 100644--- a/application/Espo/Core/Select/Text/FilterParams.php+++ b/application/Espo/Core/Select/Text/FilterParams.php@@ -30,7 +30,7 @@namespace Espo\Core\Select\Text;/**- * @immutable+ * Immutable.*/class FilterParams{diff --git a/application/Espo/Core/Select/Text/FullTextSearch/Data.php b/application/Espo/Core/Select/Text/FullTextSearch/Data.phpindex ba71242919..d924630ab3 100644--- a/application/Espo/Core/Select/Text/FullTextSearch/Data.php+++ b/application/Espo/Core/Select/Text/FullTextSearch/Data.php@@ -34,7 +34,7 @@ use Espo\ORM\Query\Part\Expression;use InvalidArgumentException;/**- * @immutable+ * Immutable.*/class Data{diff --git a/application/Espo/Core/Select/Text/FullTextSearch/DataComposer/Params.php b/application/Espo/Core/Select/Text/FullTextSearch/DataComposer/Params.phpindex 516714a1a9..a99393f232 100644--- a/application/Espo/Core/Select/Text/FullTextSearch/DataComposer/Params.php+++ b/application/Espo/Core/Select/Text/FullTextSearch/DataComposer/Params.php@@ -30,7 +30,7 @@namespace Espo\Core\Select\Text\FullTextSearch\DataComposer;/**- * @immutable+ * Immutable.*/class Params{diff --git a/application/Espo/Core/Select/Where/Converter/Params.php b/application/Espo/Core/Select/Where/Converter/Params.phpindex 831ea6e964..5ebd32988f 100644--- a/application/Espo/Core/Select/Where/Converter/Params.php+++ b/application/Espo/Core/Select/Where/Converter/Params.php@@ -32,7 +32,7 @@ namespace Espo\Core\Select\Where\Converter;/*** Where converter parameters.*- * @immutable+ * Immutable.* @since 9.0.0*/class Paramsdiff --git a/application/Espo/Core/Select/Where/Item.php b/application/Espo/Core/Select/Where/Item.phpindex d200921cf3..e042d3fa01 100644--- a/application/Espo/Core/Select/Where/Item.php+++ b/application/Espo/Core/Select/Where/Item.php@@ -37,7 +37,7 @@ use RuntimeException;/*** A where item.*- * @immutable+ * Immutable.*/class Item{diff --git a/application/Espo/Core/Select/Where/Params.php b/application/Espo/Core/Select/Where/Params.phpindex 203d2288c7..cc613eb8f1 100644--- a/application/Espo/Core/Select/Where/Params.php+++ b/application/Espo/Core/Select/Where/Params.php@@ -34,7 +34,7 @@ use InvalidArgumentException;/*** Where parameters.*- * @immutable+ * Immutable.*/class Params{diff --git a/application/Espo/Core/Utils/Client/ActionRenderer/Params.php b/application/Espo/Core/Utils/Client/ActionRenderer/Params.phpindex 448ce58bbf..4f9fc1ad6d 100644--- a/application/Espo/Core/Utils/Client/ActionRenderer/Params.php+++ b/application/Espo/Core/Utils/Client/ActionRenderer/Params.php@@ -32,7 +32,7 @@ namespace Espo\Core\Utils\Client\ActionRenderer;use Espo\Core\Utils\Client\Script;/**- * @immutable+ * Immutable.*/class Params{diff --git a/application/Espo/Core/Utils/Database/Orm/Defs/AttributeDefs.php b/application/Espo/Core/Utils/Database/Orm/Defs/AttributeDefs.phpindex e382d8568e..7f2ed5ebb1 100644--- a/application/Espo/Core/Utils/Database/Orm/Defs/AttributeDefs.php+++ b/application/Espo/Core/Utils/Database/Orm/Defs/AttributeDefs.php@@ -34,7 +34,7 @@ use Espo\ORM\Defs\Params\AttributeParam;use Espo\ORM\Type\AttributeType;/**- * @immutable+ * Immutable.*/class AttributeDefs{diff --git a/application/Espo/Core/Utils/Database/Orm/Defs/EntityDefs.php b/application/Espo/Core/Utils/Database/Orm/Defs/EntityDefs.phpindex 9fa0749a5f..a7b0746361 100644--- a/application/Espo/Core/Utils/Database/Orm/Defs/EntityDefs.php+++ b/application/Espo/Core/Utils/Database/Orm/Defs/EntityDefs.php@@ -32,7 +32,7 @@ namespace Espo\Core\Utils\Database\Orm\Defs;use Espo\ORM\Defs\Params\EntityParam;/**- * @immutable+ * Immutable.*/class EntityDefs{diff --git a/application/Espo/Core/Utils/Database/Orm/Defs/IndexDefs.php b/application/Espo/Core/Utils/Database/Orm/Defs/IndexDefs.phpindex d6e7fdcdc8..ccd31bedc4 100644--- a/application/Espo/Core/Utils/Database/Orm/Defs/IndexDefs.php+++ b/application/Espo/Core/Utils/Database/Orm/Defs/IndexDefs.php@@ -33,7 +33,7 @@ use Espo\Core\Utils\Util;use Espo\ORM\Defs\Params\IndexParam;/**- * @immutable+ * Immutable.*/class IndexDefs{diff --git a/application/Espo/Core/Utils/Resource/FileReader/Params.php b/application/Espo/Core/Utils/Resource/FileReader/Params.phpindex b643b9a19a..670000a45d 100644--- a/application/Espo/Core/Utils/Resource/FileReader/Params.php+++ b/application/Espo/Core/Utils/Resource/FileReader/Params.php@@ -30,7 +30,7 @@namespace Espo\Core\Utils\Resource\FileReader;/**- * @immutable+ * Immutable.*/class Params{diff --git a/application/Espo/Modules/Crm/Tools/Lead/Convert/Values.php b/application/Espo/Modules/Crm/Tools/Lead/Convert/Values.phpindex 6372147c7f..122e2d509e 100644--- a/application/Espo/Modules/Crm/Tools/Lead/Convert/Values.php+++ b/application/Espo/Modules/Crm/Tools/Lead/Convert/Values.php@@ -36,7 +36,7 @@ use UnexpectedValueException;/*** Raw attribute values of multiple records.*- * @immutable+ * Immutable.*/class Values{diff --git a/application/Espo/Modules/Crm/Tools/Opportunity/Report/DateRange.php b/application/Espo/Modules/Crm/Tools/Opportunity/Report/DateRange.phpindex bbed32caed..36874915dd 100644--- a/application/Espo/Modules/Crm/Tools/Opportunity/Report/DateRange.php+++ b/application/Espo/Modules/Crm/Tools/Opportunity/Report/DateRange.php@@ -35,7 +35,7 @@ use InvalidArgumentException;use UnexpectedValueException;/**- * @immutable+ * Immutable.*/class DateRange{diff --git a/application/Espo/ORM/BaseEntity.php b/application/Espo/ORM/BaseEntity.phpindex 86a325d1c8..60dcda24a8 100644--- a/application/Espo/ORM/BaseEntity.php+++ b/application/Espo/ORM/BaseEntity.php@@ -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);diff --git a/application/Espo/ORM/DatabaseParams.php b/application/Espo/ORM/DatabaseParams.phpindex a8082dc733..ef5fb0da8a 100644--- a/application/Espo/ORM/DatabaseParams.php+++ b/application/Espo/ORM/DatabaseParams.php@@ -30,7 +30,7 @@namespace Espo\ORM;/**- * @immutable+ * Immutable.*/class DatabaseParams{diff --git a/application/Espo/ORM/Query/Delete.php b/application/Espo/ORM/Query/Delete.phpindex 5c10a359aa..1ecbd2ebe6 100644--- a/application/Espo/ORM/Query/Delete.php+++ b/application/Espo/ORM/Query/Delete.php@@ -34,7 +34,7 @@ use RuntimeException;/*** Delete parameters.*- * @immutable+ * Immutable.*/class Delete implements Query{diff --git a/application/Espo/ORM/Query/Insert.php b/application/Espo/ORM/Query/Insert.phpindex 748fdee859..abd4ab9838 100644--- a/application/Espo/ORM/Query/Insert.php+++ b/application/Espo/ORM/Query/Insert.php@@ -34,7 +34,7 @@ use RuntimeException;/*** Insert parameters.*- * @immutable+ * Immutable.*/class Insert implements Query{diff --git a/application/Espo/ORM/Query/LockTable.php b/application/Espo/ORM/Query/LockTable.phpindex 25f7b55d20..fae5cace6e 100644--- a/application/Espo/ORM/Query/LockTable.php+++ b/application/Espo/ORM/Query/LockTable.php@@ -34,7 +34,7 @@ use RuntimeException;/*** LOCK TABLE parameters.*- * @immutable+ * Immutable.*/class LockTable implements Query{diff --git a/application/Espo/ORM/Query/Part/Expression.php b/application/Espo/ORM/Query/Part/Expression.phpindex d7bf596d2c..17fa0d8658 100644--- a/application/Espo/ORM/Query/Part/Expression.php+++ b/application/Espo/ORM/Query/Part/Expression.php@@ -35,8 +35,6 @@ use RuntimeException;/*** A complex expression. Can be a function or a simple column reference. Immutable.- *- * @immutable*/class Expression implements WhereItem{diff --git a/application/Espo/ORM/Query/Part/Join.php b/application/Espo/ORM/Query/Part/Join.phpindex 467123914b..282c181659 100644--- a/application/Espo/ORM/Query/Part/Join.php+++ b/application/Espo/ORM/Query/Part/Join.php@@ -35,8 +35,6 @@ use RuntimeException;/*** A join item. Immutable.- *- * @immutable*/class Join{diff --git a/application/Espo/ORM/Query/Part/Order.php b/application/Espo/ORM/Query/Part/Order.phpindex 450cbc2821..4aa473e3ec 100644--- a/application/Espo/ORM/Query/Part/Order.php+++ b/application/Espo/ORM/Query/Part/Order.php@@ -34,7 +34,7 @@ use RuntimeException;/*** An order item. Immutable.*- * @immutable+ * Immutable.*/class Order{diff --git a/application/Espo/ORM/Query/Part/OrderList.php b/application/Espo/ORM/Query/Part/OrderList.phpindex d809d83cac..376b05bfea 100644--- a/application/Espo/ORM/Query/Part/OrderList.php+++ b/application/Espo/ORM/Query/Part/OrderList.php@@ -35,7 +35,8 @@ use Iterator;/*** A list of order items.*- * @immutable+ * Immutable.+ ** @implements Iterator<Order>*/class OrderList implements Iteratordiff --git a/application/Espo/ORM/Query/Part/Selection.php b/application/Espo/ORM/Query/Part/Selection.phpindex e9b12b9910..961fb1f5d0 100644--- a/application/Espo/ORM/Query/Part/Selection.php+++ b/application/Espo/ORM/Query/Part/Selection.php@@ -32,7 +32,7 @@ namespace Espo\ORM\Query\Part;/*** A select item. Immutable.*- * @immutable+ * Immutable.*/class Selection{diff --git a/application/Espo/ORM/Query/Part/Where/AndGroup.php b/application/Espo/ORM/Query/Part/Where/AndGroup.phpindex c777f3de71..a8c3d74745 100644--- a/application/Espo/ORM/Query/Part/Where/AndGroup.php+++ b/application/Espo/ORM/Query/Part/Where/AndGroup.php@@ -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 WhereItemnew WhereClause() :new self();+ /** @phpstan-ignore-next-line */$obj->rawValue = $whereClause;return $obj;diff --git a/application/Espo/ORM/Query/Part/Where/Comparison.php b/application/Espo/ORM/Query/Part/Where/Comparison.phpindex 77c045af8c..efa2f430ef 100644--- a/application/Espo/ORM/Query/Part/Where/Comparison.php+++ b/application/Espo/ORM/Query/Part/Where/Comparison.php@@ -37,8 +37,6 @@ use RuntimeException;/*** Compares an expression to a value or another expression. Immutable.- *- * @immutable*/class Comparison implements WhereItem{diff --git a/application/Espo/ORM/Query/Part/Where/Exists.php b/application/Espo/ORM/Query/Part/Where/Exists.phpindex 1560b0fdcb..68889ad310 100644--- a/application/Espo/ORM/Query/Part/Where/Exists.php+++ b/application/Espo/ORM/Query/Part/Where/Exists.php@@ -34,8 +34,6 @@ use Espo\ORM\Query\Select;/*** An EXISTS-operator. Immutable.- *- * @immutable*/class Exists implements WhereItem{diff --git a/application/Espo/ORM/Query/Part/Where/Not.php b/application/Espo/ORM/Query/Part/Where/Not.phpindex aae62835ef..1d32700fe0 100644--- a/application/Espo/ORM/Query/Part/Where/Not.php+++ b/application/Espo/ORM/Query/Part/Where/Not.php@@ -33,8 +33,6 @@ use Espo\ORM\Query\Part\WhereItem;/*** A NOT-operator. Immutable.- *- * @immutable*/class Not implements WhereItem{diff --git a/application/Espo/ORM/Query/Part/Where/OrGroup.php b/application/Espo/ORM/Query/Part/Where/OrGroup.phpindex 40a4096be7..b4b3cebfdc 100644--- a/application/Espo/ORM/Query/Part/Where/OrGroup.php+++ b/application/Espo/ORM/Query/Part/Where/OrGroup.php@@ -33,8 +33,6 @@ use Espo\ORM\Query\Part\WhereItem;/*** OR-group. Immutable.- *- * @immutable*/class OrGroup implements WhereItem{diff --git a/application/Espo/ORM/Query/Part/WhereClause.php b/application/Espo/ORM/Query/Part/WhereClause.phpindex db8236a2a7..d97195016c 100644--- a/application/Espo/ORM/Query/Part/WhereClause.php+++ b/application/Espo/ORM/Query/Part/WhereClause.php@@ -34,7 +34,7 @@ use Espo\ORM\Query\Part\Where\AndGroup;/*** A where-clause. Immutable.*- * @immutable+ * Immutable.*/class WhereClause extends AndGroup{diff --git a/application/Espo/ORM/Query/Select.php b/application/Espo/ORM/Query/Select.phpindex baf7a3a50e..f34203e40d 100644--- a/application/Espo/ORM/Query/Select.php+++ b/application/Espo/ORM/Query/Select.php@@ -39,7 +39,7 @@ use RuntimeException;/*** Select parameters.*- * @immutable+ * Immutable.** @todo Add validation and normalization.*/diff --git a/application/Espo/ORM/Query/Union.php b/application/Espo/ORM/Query/Union.phpindex b090ccd347..775f88f80a 100644--- a/application/Espo/ORM/Query/Union.php+++ b/application/Espo/ORM/Query/Union.php@@ -34,7 +34,7 @@ use RuntimeException;/*** Union parameters.*- * @immutable+ * Immutable.*/class Union implements SelectingQuery{diff --git a/application/Espo/ORM/Query/Update.php b/application/Espo/ORM/Query/Update.phpindex 4f17393b56..55e25e62e7 100644--- a/application/Espo/ORM/Query/Update.php+++ b/application/Espo/ORM/Query/Update.php@@ -35,7 +35,7 @@ use RuntimeException;/*** Update parameters.*- * @immutable+ * Immutable.*/class Update implements Query{diff --git a/application/Espo/ORM/QueryComposer/BaseQueryComposer.php b/application/Espo/ORM/QueryComposer/BaseQueryComposer.phpindex a60799ace4..5300531736 100644--- a/application/Espo/ORM/QueryComposer/BaseQueryComposer.php+++ b/application/Espo/ORM/QueryComposer/BaseQueryComposer.php@@ -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 = [];+ $argumentList = Util::parseArgumentListFromFunctionContent($attribute);- foreach ($argumentList as $argument) {- $argumentPartList[] = $this->getFunctionArgumentPart($entity, $argument, $distinct, $params);- }+ $argumentPartList = [];- $part = implode(', ', $argumentPartList);- } else {- $part = $this->getFunctionArgumentPart($entity, $attribute, $distinct, $params);+ foreach ($argumentList as $argument) {+ $argumentPartList[] = $this->getFunctionArgumentPart($entity, $argument, $distinct, $params);}- if ($function) {- /** @var string[] $argumentPartList */+ $part = implode(', ', $argumentPartList);- $part = $this->getFunctionPart(- $function,- $part,- $params,- $entityType,- $distinct,- $argumentPartList- );- }-- return $part;+ 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 QueryComposerEntity $entity,$orderBy = null,$order = null,- ?array &$params = null,+ array &$params = [],bool $noCustom = false): ?string {@@ -2234,7 +2224,7 @@ abstract class BaseQueryComposer implements QueryComposerreturn $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);}diff --git a/application/Espo/ORM/QueryComposer/Util.php b/application/Espo/ORM/QueryComposer/Util.phpindex 9a4f0cac17..604495d191 100644--- a/application/Espo/ORM/QueryComposer/Util.php+++ b/application/Espo/ORM/QueryComposer/Util.php@@ -122,7 +122,7 @@ class Utilself::getAllAttributesFromComplexExpressionImplementation($argument, $list);}- return $list;+ return $list ?? [];}/**diff --git a/application/Espo/ORM/Repository/Option/MassRelateOptions.php b/application/Espo/ORM/Repository/Option/MassRelateOptions.phpindex 28f4cbd41d..255f7d045e 100644--- a/application/Espo/ORM/Repository/Option/MassRelateOptions.php+++ b/application/Espo/ORM/Repository/Option/MassRelateOptions.php@@ -34,7 +34,7 @@ use Espo\ORM\Repository\Option\Traits\Options;/*** Mass-relate options.*- * @immutable+ * Immutable.*/class MassRelateOptions{diff --git a/application/Espo/ORM/Repository/Option/RelateOptions.php b/application/Espo/ORM/Repository/Option/RelateOptions.phpindex afb133a22b..8d0ab66955 100644--- a/application/Espo/ORM/Repository/Option/RelateOptions.php+++ b/application/Espo/ORM/Repository/Option/RelateOptions.php@@ -34,7 +34,7 @@ use Espo\ORM\Repository\Option\Traits\Options;/*** Relate options.*- * @immutable+ * Immutable.*/class RelateOptions{diff --git a/application/Espo/ORM/Repository/Option/RemoveOptions.php b/application/Espo/ORM/Repository/Option/RemoveOptions.phpindex 6c8920cb21..b0b101ad46 100644--- a/application/Espo/ORM/Repository/Option/RemoveOptions.php+++ b/application/Espo/ORM/Repository/Option/RemoveOptions.php@@ -34,7 +34,7 @@ use Espo\ORM\Repository\Option\Traits\Options;/*** Remove options.*- * @immutable+ * Immutable.*/class RemoveOptions{diff --git a/application/Espo/ORM/Repository/Option/SaveOptions.php b/application/Espo/ORM/Repository/Option/SaveOptions.phpindex ab208a3edb..a24ab157fd 100644--- a/application/Espo/ORM/Repository/Option/SaveOptions.php+++ b/application/Espo/ORM/Repository/Option/SaveOptions.php@@ -34,7 +34,7 @@ use Espo\ORM\Repository\Option\Traits\Options;/*** Save options.*- * @immutable+ * Immutable.*/class SaveOptions{diff --git a/application/Espo/ORM/Repository/Option/UnrelateOptions.php b/application/Espo/ORM/Repository/Option/UnrelateOptions.phpindex 1253d37a99..21895be635 100644--- a/application/Espo/ORM/Repository/Option/UnrelateOptions.php+++ b/application/Espo/ORM/Repository/Option/UnrelateOptions.php@@ -34,7 +34,7 @@ use Espo\ORM\Repository\Option\Traits\Options;/*** Unrelate options.*- * @immutable+ * Immutable.*/class UnrelateOptions{diff --git a/application/Espo/Services/ExternalAccount.php b/application/Espo/Services/ExternalAccount.phpindex d369c399ba..afa4646cd3 100644--- a/application/Espo/Services/ExternalAccount.php+++ b/application/Espo/Services/ExternalAccount.php@@ -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) {}diff --git a/application/Espo/Tools/Attachment/FieldData.php b/application/Espo/Tools/Attachment/FieldData.phpindex 06d38034ae..83ce00af8b 100644--- a/application/Espo/Tools/Attachment/FieldData.php+++ b/application/Espo/Tools/Attachment/FieldData.php@@ -32,7 +32,7 @@ namespace Espo\Tools\Attachment;use Espo\Core\Exceptions\Error;/**- * @immutable+ * Immutable.*/class FieldData{diff --git a/application/Espo/Tools/Attachment/FileData.php b/application/Espo/Tools/Attachment/FileData.phpindex 31981e2ccd..14aa38449c 100644--- a/application/Espo/Tools/Attachment/FileData.php+++ b/application/Espo/Tools/Attachment/FileData.php@@ -32,7 +32,7 @@ namespace Espo\Tools\Attachment;use Psr\Http\Message\StreamInterface;/**- * @immutable+ * Immutable.*/class FileData{diff --git a/application/Espo/Tools/EmailTemplate/Params.php b/application/Espo/Tools/EmailTemplate/Params.phpindex a56726fcf9..039552424a 100644--- a/application/Espo/Tools/EmailTemplate/Params.php+++ b/application/Espo/Tools/EmailTemplate/Params.php@@ -30,7 +30,7 @@namespace Espo\Tools\EmailTemplate;/**- * @immutable+ * Immutable.*/class Params{diff --git a/application/Espo/Tools/Export/Format/Xlsx/PhpSpreadsheetProcessor.php b/application/Espo/Tools/Export/Format/Xlsx/PhpSpreadsheetProcessor.phpindex f4bbbadfbb..16b508f326 100644--- a/application/Espo/Tools/Export/Format/Xlsx/PhpSpreadsheetProcessor.php+++ b/application/Espo/Tools/Export/Format/Xlsx/PhpSpreadsheetProcessor.php@@ -577,8 +577,6 @@ class PhpSpreadsheetProcessor implements ProcessorInterface$cell = $sheet->getCell($coordinate);- assert($cell !== null);-$hyperLink = $cell->getHyperlink();$hyperLink->setUrl($link);diff --git a/application/Espo/Tools/Export/Params.php b/application/Espo/Tools/Export/Params.phpindex 700d3e9646..f7df8ff44e 100644--- a/application/Espo/Tools/Export/Params.php+++ b/application/Espo/Tools/Export/Params.php@@ -35,7 +35,7 @@ use Espo\Core\Select\Where\Item as WhereItem;use RuntimeException;/**- * @immutable+ * Immutable.*/class Params{diff --git a/application/Espo/Tools/Export/Processor/Params.php b/application/Espo/Tools/Export/Processor/Params.phpindex d5c408b603..114627280e 100644--- a/application/Espo/Tools/Export/Processor/Params.php+++ b/application/Espo/Tools/Export/Processor/Params.php@@ -32,7 +32,7 @@ namespace Espo\Tools\Export\Processor;use RuntimeException;/**- * @immutable+ * Immutable.*/class Params{diff --git a/application/Espo/Tools/Export/Result.php b/application/Espo/Tools/Export/Result.phpindex 77106f332f..5eb5736ac0 100644--- a/application/Espo/Tools/Export/Result.php+++ b/application/Espo/Tools/Export/Result.php@@ -30,7 +30,7 @@namespace Espo\Tools\Export;/**- * @immutable+ * Immutable.*/class Result{diff --git a/application/Espo/Tools/Export/ServiceResult.php b/application/Espo/Tools/Export/ServiceResult.phpindex 1670e0b4c6..7de4780a0d 100644--- a/application/Espo/Tools/Export/ServiceResult.php+++ b/application/Espo/Tools/Export/ServiceResult.php@@ -30,7 +30,7 @@namespace Espo\Tools\Export;/**- * @immutable+ * Immutable.*/class ServiceResult{diff --git a/application/Espo/Tools/FieldManager/FieldManager.php b/application/Espo/Tools/FieldManager/FieldManager.phpindex 35d3e4cd58..527a619435 100644--- a/application/Espo/Tools/FieldManager/FieldManager.php+++ b/application/Espo/Tools/FieldManager/FieldManager.php@@ -607,7 +607,7 @@ class FieldManagerprivate 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 {diff --git a/application/Espo/Tools/Import/Import.php b/application/Espo/Tools/Import/Import.phpindex 4f4f9bb539..4e23faf8f2 100644--- a/application/Espo/Tools/Import/Import.php+++ b/application/Espo/Tools/Import/Import.php@@ -890,7 +890,7 @@ class Importreturn intval($value);case Entity::BOOL:- if ($value && strtolower($value) !== 'false' && $value !== '0') {+ if ($value !== '0' && $value && strtolower($value) !== 'false') {return true;}diff --git a/application/Espo/Tools/Import/Params.php b/application/Espo/Tools/Import/Params.phpindex 0dfd651f47..0de686ac1d 100644--- a/application/Espo/Tools/Import/Params.php+++ b/application/Espo/Tools/Import/Params.php@@ -34,7 +34,7 @@ use stdClass;use TypeError;/**- * @immutable+ * Immutable.*/class Params{diff --git a/application/Espo/Tools/Import/Result.php b/application/Espo/Tools/Import/Result.phpindex 86a7047af6..18c1067746 100644--- a/application/Espo/Tools/Import/Result.php+++ b/application/Espo/Tools/Import/Result.php@@ -32,7 +32,7 @@ namespace Espo\Tools\Import;use stdClass;/**- * @immutable+ * Immutable.*/class Result{diff --git a/application/Espo/Tools/LeadCapture/FormService.php b/application/Espo/Tools/LeadCapture/FormService.phpindex 739e2eb8ac..fba1b8a477 100644--- a/application/Espo/Tools/LeadCapture/FormService.php+++ b/application/Espo/Tools/LeadCapture/FormService.php@@ -282,9 +282,13 @@ class FormService];foreach ($subList as $sub) {- $fieldDefs[$sub] = $this->metadata->get("entityDefs.Lead.fields.$sub");+ /** @var array<string, mixed> $subItem */+ $subItem = $this->metadata->get("entityDefs.Lead.fields.$sub");++ $fieldDefs[$sub] = $subItem;}}+if ($type === FieldType::PERSON_NAME) {$subList = ['first' . ucfirst($field),@@ -294,7 +298,10 @@ class FormService];foreach ($subList as $sub) {- $fieldDefs[$sub] = $this->metadata->get("entityDefs.Lead.fields.$sub");+ /** @var array<string, mixed> $subItem */+ $subItem = $this->metadata->get("entityDefs.Lead.fields.$sub");++ $fieldDefs[$sub] = $subItem;}}diff --git a/application/Espo/Tools/LinkManager/Params.php b/application/Espo/Tools/LinkManager/Params.phpindex 33a3d61210..b14624c4ff 100644--- a/application/Espo/Tools/LinkManager/Params.php+++ b/application/Espo/Tools/LinkManager/Params.php@@ -32,7 +32,7 @@ namespace Espo\Tools\LinkManager;use Espo\Tools\LinkManager\ParamsBuilder;/**- * @immutable+ * Immutable.*/class Params{diff --git a/application/Espo/Tools/Notification/NoteMentionHookProcessor.php b/application/Espo/Tools/Notification/NoteMentionHookProcessor.phpindex ac8c94f4d2..8c38254018 100644--- a/application/Espo/Tools/Notification/NoteMentionHookProcessor.php+++ b/application/Espo/Tools/Notification/NoteMentionHookProcessor.php@@ -73,7 +73,7 @@ class NoteMentionHookProcessor$mentionCount = 0;- if (is_array($matches) && !empty($matches[0]) && is_array($matches[0])) {+ if (!empty($matches[0]) && is_array($matches[0])) {$mentionCount = $this->processMatches($matches[0], $note, $mentionData, $previousMentionList);}diff --git a/application/Espo/Tools/Notification/RecordService.php b/application/Espo/Tools/Notification/RecordService.phpindex ede7a04170..38565c9ca6 100644--- a/application/Espo/Tools/Notification/RecordService.php+++ b/application/Espo/Tools/Notification/RecordService.php@@ -157,7 +157,7 @@ class RecordServiceNotification $entity,int $index,EntityCollection $collection,- int &$count,+ ?int &$count,User $user): void {@@ -181,7 +181,10 @@ class RecordServiceif (!$note) {unset($collection[$index]);- $count--;++ if ($count !== null) {+ $count--;+ }$this->entityManager->removeEntity($entity);diff --git a/application/Espo/Tools/OAuth/Tokens.php b/application/Espo/Tools/OAuth/Tokens.phpindex 440ae88164..9d89af95b8 100644--- a/application/Espo/Tools/OAuth/Tokens.php+++ b/application/Espo/Tools/OAuth/Tokens.php@@ -33,7 +33,7 @@ use Espo\Core\Field\DateTime;use SensitiveParameter;/**- * @immutable+ * Immutable.*/class Tokens{diff --git a/application/Espo/Tools/Pdf/Params.php b/application/Espo/Tools/Pdf/Params.phpindex a53b703351..438660eab3 100644--- a/application/Espo/Tools/Pdf/Params.php+++ b/application/Espo/Tools/Pdf/Params.php@@ -30,7 +30,7 @@namespace Espo\Tools\Pdf;/**- * @immutable+ * Immutable.*/class Params{diff --git a/application/Espo/Tools/Stream/HookProcessor.php b/application/Espo/Tools/Stream/HookProcessor.phpindex b26d5ebdb1..0ad01bbb72 100644--- a/application/Espo/Tools/Stream/HookProcessor.php+++ b/application/Espo/Tools/Stream/HookProcessor.php@@ -236,7 +236,9 @@ class HookProcessor$link = $defs->getName();$foreign = $defs->getForeignRelationName();+ /** @var ?string $foreignEntityType */$foreignEntityType = $entity->get($link . 'Type');+$id = $entity->get($link . 'Id');if (!$foreignEntityType || !$id) {diff --git a/application/Espo/Tools/UserReaction/NotificationService.php b/application/Espo/Tools/UserReaction/NotificationService.phpindex a3ca3ad533..9bd7ab76a1 100644--- a/application/Espo/Tools/UserReaction/NotificationService.php+++ b/application/Espo/Tools/UserReaction/NotificationService.php@@ -97,7 +97,6 @@ class NotificationServicepublic function removeNoteUnread(Note $note, User $user, ?string $type = null): void{- /** @var Notification[] $notifications */$notifications = $this->entityManager->getRDBRepositoryByClass(Notification::class)->where([diff --git a/application/Espo/Tools/WorkingTime/SpecificCalendar.php b/application/Espo/Tools/WorkingTime/SpecificCalendar.phpindex f4d9445d14..bf0891b78f 100644--- a/application/Espo/Tools/WorkingTime/SpecificCalendar.php+++ b/application/Espo/Tools/WorkingTime/SpecificCalendar.php@@ -76,7 +76,7 @@ class SpecificCalendar implements Calendar/** @noinspection PhpUnused */public function isAvailable(): bool{- return $this->workingTimeCalendar !== null;+ return true;}public function getTimezone(): DateTimeZonediff --git a/composer.json b/composer.jsonindex d6d6987e58..fe4c379e1f 100644--- a/composer.json+++ b/composer.json@@ -56,7 +56,7 @@},"require-dev": {"phpunit/phpunit": "^9.5",- "phpstan/phpstan": "^1.12"+ "phpstan/phpstan": "^2.1"},"suggest": {"ext-pdo_mysql": "*",diff --git a/composer.lock b/composer.lockindex ea9b581848..4effbb15e3 100644--- a/composer.lock+++ b/composer.lock@@ -4,7 +4,7 @@"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies","This file is @generated automatically"],- "content-hash": "c9e886d22a6f5af3773701b37aa6cf97",+ "content-hash": "b96d1d5b9be20903a58eabebb584962e","packages": [{"name": "async-aws/core",@@ -7745,20 +7745,20 @@},{"name": "phpstan/phpstan",- "version": "1.12.12",+ "version": "2.1.11","source": {"type": "git","url": "https://github.com/phpstan/phpstan.git",- "reference": "b5ae1b88f471d3fd4ba1aa0046234b5ca3776dd0"+ "reference": "8ca5f79a8f63c49b2359065832a654e1ec70ac30"},"dist": {"type": "zip",- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/b5ae1b88f471d3fd4ba1aa0046234b5ca3776dd0",- "reference": "b5ae1b88f471d3fd4ba1aa0046234b5ca3776dd0",+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/8ca5f79a8f63c49b2359065832a654e1ec70ac30",+ "reference": "8ca5f79a8f63c49b2359065832a654e1ec70ac30","shasum": ""},"require": {- "php": "^7.2|^8.0"+ "php": "^7.4|^8.0"},"conflict": {"phpstan/phpstan-shim": "*"@@ -7799,7 +7799,7 @@"type": "github"}],- "time": "2024-11-28T22:13:23+00:00"+ "time": "2025-03-24T13:45:00+00:00"},{"name": "phpunit/php-code-coverage",