diff --git a/application/Espo/Core/Acl/DefaultAssignmentChecker.php b/application/Espo/Core/Acl/DefaultAssignmentChecker.php index 509e9423d6..280bcd668d 100644 --- a/application/Espo/Core/Acl/DefaultAssignmentChecker.php +++ b/application/Espo/Core/Acl/DefaultAssignmentChecker.php @@ -277,8 +277,7 @@ class DefaultAssignmentChecker implements AssignmentChecker if ($entity->isAttributeChanged(self::ATTR_ASSIGNED_USERS_IDS)) { $toProcess = true; } - } - else { + } else { $toProcess = true; } @@ -304,6 +303,7 @@ class DefaultAssignmentChecker implements AssignmentChecker return $this->isPermittedAssignedUsersLevelTeam($user, $entity); } + /** @phpstan-ignore-next-line */ return true; } diff --git a/application/Espo/Core/FileStorage/Manager.php b/application/Espo/Core/FileStorage/Manager.php index 1f1b45ad1b..27d9eecd43 100644 --- a/application/Espo/Core/FileStorage/Manager.php +++ b/application/Espo/Core/FileStorage/Manager.php @@ -160,7 +160,11 @@ class Manager fwrite($resource, $contents); - $path = stream_get_meta_data($resource)['uri']; + $path = stream_get_meta_data($resource)['uri'] ?? null; + + if (!$path) { + throw new RuntimeException("No uri."); + } // To prevent deleting. $this->resourceMap[$path] = $resource; diff --git a/application/Espo/Core/Utils/Metadata.php b/application/Espo/Core/Utils/Metadata.php index 03135d692f..af4b8703ed 100644 --- a/application/Espo/Core/Utils/Metadata.php +++ b/application/Espo/Core/Utils/Metadata.php @@ -294,7 +294,7 @@ class Metadata $unsetList = $unsets; foreach ($unsetList as $unsetItem) { - if (preg_match('/fields\.([^.]+)/', $unsetItem, $matches) && isset($matches[1])) { + if (preg_match('/fields\.([^.]+)/', $unsetItem, $matches)) { $fieldName = $matches[1]; $fieldPath = [$key1, $key2, 'fields', $fieldName]; diff --git a/application/Espo/Core/Utils/System.php b/application/Espo/Core/Utils/System.php index 85b929a585..7fc195c904 100644 --- a/application/Espo/Core/Utils/System.php +++ b/application/Espo/Core/Utils/System.php @@ -49,7 +49,7 @@ class System } return strtolower( - trim($match[1]) + trim($match[1]) /** @phpstan-ignore-line */ ); } diff --git a/composer.json b/composer.json index a1378bd66c..04ec8e193c 100644 --- a/composer.json +++ b/composer.json @@ -56,7 +56,7 @@ }, "require-dev": { "phpunit/phpunit": "^9.5", - "phpstan/phpstan": "^1.10" + "phpstan/phpstan": "^1.12" }, "suggest": { "ext-pdo_mysql": "*", diff --git a/composer.lock b/composer.lock index 5e5bac5688..167fb6294b 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": "ec45187cd1774562b435c8a589aeeee6", + "content-hash": "ca1dc00c70f187b1a40064861bd7a8e7", "packages": [ { "name": "async-aws/core", @@ -7404,16 +7404,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.57", + "version": "1.12.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "1627b1d03446904aaa77593f370c5201d2ecc34e" + "reference": "384af967d35b2162f69526c7276acadce534d0e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/1627b1d03446904aaa77593f370c5201d2ecc34e", - "reference": "1627b1d03446904aaa77593f370c5201d2ecc34e", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/384af967d35b2162f69526c7276acadce534d0e1", + "reference": "384af967d35b2162f69526c7276acadce534d0e1", "shasum": "" }, "require": { @@ -7456,13 +7456,9 @@ { "url": "https://github.com/phpstan", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", - "type": "tidelift" } ], - "time": "2024-01-24T11:51:34+00:00" + "time": "2024-08-27T09:18:05+00:00" }, { "name": "phpunit/php-code-coverage",