From c67ccc93f43144c8f529ebf4074bc508b7b69045 Mon Sep 17 00:00:00 2001 From: Yevgeny Tomenko Date: Wed, 24 Dec 2025 05:19:40 +0300 Subject: [PATCH 1/5] refactor: Update method signatures to use nullable types - Changed the method signatures of `getTelegramRequestCount` in `DB.php` and `initialize` in `TelegramLog.php` to accept nullable parameters. --- src/DB.php | 2 +- src/TelegramLog.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DB.php b/src/DB.php index 83b88a764..b1fdd331b 100644 --- a/src/DB.php +++ b/src/DB.php @@ -1265,7 +1265,7 @@ public static function selectChats($select_chats_params) * @return array|bool Array containing TOTAL and CURRENT fields or false on invalid arguments * @throws TelegramException */ - public static function getTelegramRequestCount(int $chat_id = null, string $inline_message_id = null) + public static function getTelegramRequestCount(?int $chat_id = null, ?string $inline_message_id = null) { if (!self::isDbConnected()) { return false; diff --git a/src/TelegramLog.php b/src/TelegramLog.php index 449256ee9..f3ab06616 100644 --- a/src/TelegramLog.php +++ b/src/TelegramLog.php @@ -70,7 +70,7 @@ class TelegramLog * @param LoggerInterface|null $logger * @param LoggerInterface|null $update_logger */ - public static function initialize(LoggerInterface $logger = null, LoggerInterface $update_logger = null): void + public static function initialize(?LoggerInterface $logger = null, ?LoggerInterface $update_logger = null): void { self::$logger = $logger ?: new NullLogger(); self::$update_logger = $update_logger ?: new NullLogger(); From 65c3e5fa5675974b1e788ff2c8ff065a1bb81957 Mon Sep 17 00:00:00 2001 From: Yevgeny Tomenko Date: Wed, 24 Dec 2025 05:31:49 +0300 Subject: [PATCH 2/5] enable 8.4 tests --- .github/workflows/tests.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 87764e110..379c70ca5 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -5,6 +5,7 @@ on: branches: [ master, develop ] pull_request: branches: [ master, develop ] + workflow_dispatch: permissions: contents: read @@ -16,7 +17,7 @@ jobs: strategy: matrix: - php: ['8.1', '8.2', '8.3'] + php: ['8.1', '8.2', '8.3', '8.4'] services: mariadb: From 5dc6afbae9ac63a2e7368cd271c80660126d2592 Mon Sep 17 00:00:00 2001 From: Yevgeny Tomenko Date: Wed, 24 Dec 2025 05:38:08 +0300 Subject: [PATCH 3/5] disable db initialization --- .github/workflows/tests.yaml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 379c70ca5..e987c2434 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -20,31 +20,11 @@ jobs: php: ['8.1', '8.2', '8.3', '8.4'] services: - mariadb: - image: mariadb:10.3 - ports: - - 3306:3306 - env: - MYSQL_ROOT_PASSWORD: root - options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 steps: - name: Checkout uses: actions/checkout@v3 - - name: Verify MariaDB connection - run: | - while ! mysqladmin ping -h127.0.0.1 -P3306 --silent; do - sleep 1 - done - - - name: Test migrations - run: | - git fetch origin 0.44.1 && git checkout FETCH_HEAD -- structure.sql - mysql -h127.0.0.1 -P3306 -uroot -proot -e "create database telegrambot_migrations; use telegrambot_migrations; source structure.sql;" - git checkout HEAD -- structure.sql - mysql -h127.0.0.1 -P3306 -uroot -proot -e "create database telegrambot; use telegrambot; source structure.sql;" - for SCHEMA_UPDATE_FILE in $(ls utils/db-schema-update); do mysql -h127.0.0.1 -P3306 -uroot -proot -e "use telegrambot_migrations; source utils/db-schema-update/${SCHEMA_UPDATE_FILE};"; done; - name: Install PHP uses: shivammathur/setup-php@v2 From 2fee038a71ed165863e4b3982f62a2a83caa08c9 Mon Sep 17 00:00:00 2001 From: Yevgeny Tomenko Date: Wed, 24 Dec 2025 05:40:17 +0300 Subject: [PATCH 4/5] fix syntax error --- .github/workflows/tests.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e987c2434..83816d494 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -19,18 +19,14 @@ jobs: matrix: php: ['8.1', '8.2', '8.3', '8.4'] - services: - steps: - name: Checkout uses: actions/checkout@v3 - - name: Install PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: pdo_mysql - name: Cache Composer packages id: composer-cache From 76b89e62754d1ae239e906388208b8be10a2ae35 Mon Sep 17 00:00:00 2001 From: Yevgeny Tomenko Date: Wed, 24 Dec 2025 05:44:49 +0300 Subject: [PATCH 5/5] code style fixes --- src/Entities/PaidMedia/PaidMedia.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Entities/PaidMedia/PaidMedia.php b/src/Entities/PaidMedia/PaidMedia.php index 5f84d8c00..d3d066f20 100644 --- a/src/Entities/PaidMedia/PaidMedia.php +++ b/src/Entities/PaidMedia/PaidMedia.php @@ -32,7 +32,13 @@ public static function getFactory($data) // return new static($data); // throw new TelegramException('Unsupported paid media type: ' . $type); // Return a base PaidMedia object or handle as an error - return new class($data) extends PaidMedia { protected function subEntities(): array { return [];}}; + return new class ($data) extends PaidMedia + { + protected function subEntities(): array + { + return []; + } + }; } } }