diff --git a/CHANGELOG.md b/CHANGELOG.md index e31e28c0..7c8ad878 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,10 @@ # bitrix24-php-sdk change log -## 2.0-beta.1 — 25.03.2023 +## 2.0-beta.1 — 18.02.2024 ### Added -* ❗️add php 8.3 support, drop 8.1 and 8.0 support +* ❗️add php 8.3, 8.2 support, drop 8.1 and 8.0 support * add `Symfony\Component\Uid\Uuid` requirements * add contracts for bitrix24 applications based on bitrix24-php-sdk - `Bitrix24\SDK\Application\Contracts`, now added `Bitrix24Account` diff --git a/Makefile b/Makefile index ee1097e7..6e31904d 100644 --- a/Makefile +++ b/Makefile @@ -3,4 +3,7 @@ default: @egrep -e '^\S+' ./Makefile | grep -v default | sed -r 's/://' | sed -r 's/^/ - /' phpstan: - vendor/bin/phpstan analyse \ No newline at end of file + vendor/bin/phpstan analyse + +test-unit: + vendor/bin/phpunit --testsuite unit_tests \ No newline at end of file diff --git a/src/Infrastructure/HttpClient/RequestId/DefaultRequestIdGenerator.php b/src/Infrastructure/HttpClient/RequestId/DefaultRequestIdGenerator.php index 9b49016d..84defcd0 100644 --- a/src/Infrastructure/HttpClient/RequestId/DefaultRequestIdGenerator.php +++ b/src/Infrastructure/HttpClient/RequestId/DefaultRequestIdGenerator.php @@ -8,9 +8,9 @@ class DefaultRequestIdGenerator implements RequestIdGeneratorInterface { - private const string DEFAULT_REQUEST_ID_HEADER_FIELD_NAME = 'X-Request-ID'; - private const string DEFAULT_QUERY_STRING_PARAMETER_NAME = 'bx24_request_id'; - private const array KEY_NAME_VARIANTS = [ + private const DEFAULT_REQUEST_ID_HEADER_FIELD_NAME = 'X-Request-ID'; + private const DEFAULT_QUERY_STRING_PARAMETER_NAME = 'bx24_request_id'; + private const KEY_NAME_VARIANTS = [ 'REQUEST_ID', 'HTTP_X_REQUEST_ID', 'UNIQUE_ID' diff --git a/src/Services/CRM/Common/Result/AbstractCrmItem.php b/src/Services/CRM/Common/Result/AbstractCrmItem.php index f7d9c321..84ffb151 100644 --- a/src/Services/CRM/Common/Result/AbstractCrmItem.php +++ b/src/Services/CRM/Common/Result/AbstractCrmItem.php @@ -17,7 +17,7 @@ class AbstractCrmItem extends AbstractItem { - private const string CRM_USERFIELD_PREFIX = 'UF_CRM_'; + private const CRM_USERFIELD_PREFIX = 'UF_CRM_'; /** * @var Currency diff --git a/src/Services/Catalog/Common/Result/AbstractCatalogItem.php b/src/Services/Catalog/Common/Result/AbstractCatalogItem.php index 435beeb4..b1d0138a 100644 --- a/src/Services/Catalog/Common/Result/AbstractCatalogItem.php +++ b/src/Services/Catalog/Common/Result/AbstractCatalogItem.php @@ -13,7 +13,7 @@ abstract class AbstractCatalogItem extends AbstractItem { - private const string CRM_USERFIELD_PREFIX = 'UF_CRM_'; + private const CRM_USERFIELD_PREFIX = 'UF_CRM_'; /** * @var Currency diff --git a/tests/Unit/Application/ApplicationStatusTest.php b/tests/Unit/Application/ApplicationStatusTest.php index d768b0e4..ba6214ce 100644 --- a/tests/Unit/Application/ApplicationStatusTest.php +++ b/tests/Unit/Application/ApplicationStatusTest.php @@ -49,7 +49,7 @@ public function testInitFromString(): void /** * @return \Generator */ - public function statusDataProvider(): Generator + public static function statusDataProvider(): Generator { yield 'free' => [ 'F', diff --git a/tests/Unit/Core/Credentials/ApplicationProfileTest.php b/tests/Unit/Core/Credentials/ApplicationProfileTest.php index 17956aac..27d415f7 100644 --- a/tests/Unit/Core/Credentials/ApplicationProfileTest.php +++ b/tests/Unit/Core/Credentials/ApplicationProfileTest.php @@ -31,7 +31,7 @@ public function testFromArray(array $arr, ?string $expectedException): void $this->assertEquals($prof->getClientSecret(), $arr['BITRIX24_PHP_SDK_APPLICATION_CLIENT_SECRET']); } - public function arrayDataProvider(): Generator + public static function arrayDataProvider(): Generator { yield 'valid' => [ [ diff --git a/tests/Unit/Core/Credentials/CredentialsTest.php b/tests/Unit/Core/Credentials/CredentialsTest.php index 5d3ccfdb..64438eef 100644 --- a/tests/Unit/Core/Credentials/CredentialsTest.php +++ b/tests/Unit/Core/Credentials/CredentialsTest.php @@ -70,7 +70,7 @@ public function testDomainUrlWithProtocol(): void * @throws \Bitrix24\SDK\Core\Exceptions\InvalidArgumentException * @throws \Bitrix24\SDK\Core\Exceptions\UnknownScopeCodeException */ - public function credentialsDataProviderWithDomainUrlVariants(): Generator + public static function credentialsDataProviderWithDomainUrlVariants(): Generator { yield 'with webhook walid domain url' => [ Credentials::createFromWebhook(new WebhookUrl('https://bitrix24-php-sdk-playground.bitrix24.ru/rest/1/valid-webhook/')), diff --git a/tests/Unit/Core/Response/DTO/TimeTest.php b/tests/Unit/Core/Response/DTO/TimeTest.php index 64f597b2..99a7db9d 100644 --- a/tests/Unit/Core/Response/DTO/TimeTest.php +++ b/tests/Unit/Core/Response/DTO/TimeTest.php @@ -36,7 +36,7 @@ public function testInitFromResponseData(array $result): void /** * @return \Generator */ - public function timingsDataProvider(): Generator + public static function timingsDataProvider(): Generator { yield 'without operating reset at' => [ [ diff --git a/tests/Unit/Infrastructure/HttpClient/RequestId/DefaultRequestIdGeneratorTest.php b/tests/Unit/Infrastructure/HttpClient/RequestId/DefaultRequestIdGeneratorTest.php index fab333b8..48b21e52 100644 --- a/tests/Unit/Infrastructure/HttpClient/RequestId/DefaultRequestIdGeneratorTest.php +++ b/tests/Unit/Infrastructure/HttpClient/RequestId/DefaultRequestIdGeneratorTest.php @@ -26,7 +26,7 @@ public function testExistsRequestId($requestIdKey, $requestId): void unset($_SERVER[$requestIdKey]); } - public function requestIdKeyDataProvider(): Generator + public static function requestIdKeyDataProvider(): Generator { yield 'REQUEST_ID' => [ 'REQUEST_ID',