Page MenuHomePhabricator (Chris)

No OneTemporary

Authored By
Unknown
Size
6 KB
Referenced Files
None
Subscribers
None
diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
index 4d73c14..87764e1 100644
--- a/.github/workflows/tests.yaml
+++ b/.github/workflows/tests.yaml
@@ -1,80 +1,84 @@
name: Tests
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
permissions:
contents: read
jobs:
tests:
name: PHP ${{ matrix.php }} Test
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.1', '8.2', '8.3']
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
with:
php-version: ${{ matrix.php }}
extensions: pdo_mysql
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Check PHP code
run: composer check-code
- name: Run test suite
- if: ${{ matrix.php != '8.1'}}
- run: composer test-cov
+ run: composer test
- - name: Run test suite (with coverage)
- if: ${{ matrix.php == '8.1'}}
- run: |
- composer test-cov
- composer test-cov-upload
+# - name: Run test suite
+# if: ${{ matrix.php != '8.1'}}
+# run: composer test-cov
+
+# - name: Run test suite (with coverage)
+# if: ${{ matrix.php == '8.1'}}
+# run: |
+# wget https://scrutinizer-ci.com/ocular.phar
+# composer test-cov
+# composer test-cov-upload
diff --git a/composer.json b/composer.json
index da478ad..1c421ec 100644
--- a/composer.json
+++ b/composer.json
@@ -1,81 +1,81 @@
{
"name": "longman/telegram-bot",
"type": "library",
"description": "PHP Telegram bot",
"keywords": ["telegram", "bot", "api"],
"license": "MIT",
"homepage": "https://github.com/php-telegram-bot/core",
"support": {
"issues": "https://github.com/php-telegram-bot/core/issues",
"source": "https://github.com/php-telegram-bot/core"
},
"authors": [
{
"name": "Avtandil Kikabidze aka LONGMAN",
"email": "akalongman@gmail.com",
"homepage": "http://longman.me",
"role": "Developer"
},
{
"name": "Armando Lüscher",
"email": "armando@noplanman.ch",
"homepage": "https://noplanman.ch",
"role": "Developer"
},
{
"name": "PHP Telegram Bot Team",
"homepage": "https://github.com/php-telegram-bot/core/graphs/contributors",
"role": "Developer"
}
],
"require": {
"php": "^8.1",
"ext-pdo": "*",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"psr/log": "^1.1|^2.0|^3.0",
"guzzlehttp/guzzle": "^6.0|^7.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.6",
"dms/phpunit-arraysubset-asserts": "^0.2",
"monolog/monolog": "^2.1"
},
"autoload": {
"psr-4": {
"Longman\\TelegramBot\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Longman\\TelegramBot\\Tests\\Unit\\": "tests/Unit"
}
},
"scripts": {
"check-code": [
"\"vendor/bin/phpcs\""
],
"test": [
"\"vendor/bin/phpunit\""
],
"test-cov": [
"XDEBUG_MODE=coverage \"vendor/bin/phpunit\" --coverage-clover clover.xml"
],
"test-cov-upload": [
- "wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover clover.xml"
+ "@php ocular.phar code-coverage:upload --format=php-clover clover.xml"
]
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"process-timeout": 3600
},
"extra": {
"branch-alias": {
"dev-develop": "0.83.x-dev"
}
}
}
diff --git a/src/Entities/ReactionType/Factory.php b/src/Entities/ReactionType/Factory.php
index d7cb8ca..f61cf36 100644
--- a/src/Entities/ReactionType/Factory.php
+++ b/src/Entities/ReactionType/Factory.php
@@ -1,24 +1,23 @@
<?php
namespace Longman\TelegramBot\Entities\ReactionType;
-use Longman\TelegramBot\Entities\ChatMember\ReactionTypeNotImplemented;
use Longman\TelegramBot\Entities\Entity;
class Factory extends \Longman\TelegramBot\Entities\Factory
{
public static function make(array $data, string $bot_username): Entity
{
$type = [
'emoji' => ReactionTypeEmoji::class,
'custom_emoji' => ReactionTypeCustomEmoji::class,
];
if (!isset($type[$data['type'] ?? ''])) {
return new ReactionTypeNotImplemented($data, $bot_username);
}
$class = $type[$data['type']];
return new $class($data, $bot_username);
}
}
diff --git a/src/Entities/ReactionType/ReactionTypeNotImplemented.php b/src/Entities/ReactionType/ReactionTypeNotImplemented.php
index 8b5e4ab..26fab61 100644
--- a/src/Entities/ReactionType/ReactionTypeNotImplemented.php
+++ b/src/Entities/ReactionType/ReactionTypeNotImplemented.php
@@ -1,11 +1,10 @@
<?php
-namespace Longman\TelegramBot\Entities\ChatMember;
+namespace Longman\TelegramBot\Entities\ReactionType;
use Longman\TelegramBot\Entities\Entity;
-use Longman\TelegramBot\Entities\ReactionType\ReactionType;
class ReactionTypeNotImplemented extends Entity implements ReactionType
{
}

File Metadata

Mime Type
text/x-diff
Expires
Sun, Nov 15, 6:47 AM (20 m, 9 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
150581
Default Alt Text
(6 KB)

Event Timeline