Skip to content

Commit dc38bb3

Browse files
committed
Bump dependencies and core version, simplify composer scripts.
1 parent 6afdb0b commit dc38bb3

File tree

7 files changed

+79
-58
lines changed

7 files changed

+79
-58
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
66
## [Unreleased]
77
### Added
88
### Changed
9+
- Upgraded dependencies and bumped core to version 0.59.0.
10+
- Code style is now PSR12.
911
### Deprecated
1012
### Removed
1113
### Fixed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ It is possible however, to override the core version that this library requires:
4343
```yaml
4444
"require": {
4545
"php-telegram-bot/telegram-bot-manager": "^1.4",
46-
"longman/telegram-bot": "dev-develop as 0.57"
46+
"longman/telegram-bot": "dev-develop as 0.59"
4747
}
4848
```
4949

composer.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@
1919
],
2020
"require": {
2121
"php": "^7.1",
22-
"longman/telegram-bot": "^0.57",
23-
"longman/ip-tools": "^1.2"
22+
"longman/telegram-bot": "^0.59",
23+
"longman/ip-tools": "^1.2",
24+
"psr/log": "^1.1"
2425
},
2526
"require-dev": {
2627
"jakub-onderka/php-parallel-lint": "^1.0",
27-
"phpunit/phpunit": "^7.5|^8.1",
28+
"phpunit/phpunit": "^7.5|^8.2",
2829
"squizlabs/php_codesniffer": "^3.4"
2930
},
3031
"autoload": {
@@ -40,7 +41,7 @@
4041
"scripts": {
4142
"check-code": [
4243
"vendor/bin/parallel-lint . --exclude vendor",
43-
"vendor/bin/phpcs --standard=psr2 src/ tests/ -snp --encoding=utf-8 --report-width=150"
44+
"vendor/bin/phpcs -snp src/ tests/"
4445
],
4546
"test": [
4647
"vendor/bin/phpunit --exclude-group live"
@@ -49,10 +50,10 @@
4950
"vendor/bin/phpunit"
5051
],
5152
"test-cov": [
52-
"vendor/bin/phpunit --coverage-clover=coverage.xml --exclude-group live"
53+
"vendor/bin/phpunit --coverage-clover coverage.xml --exclude-group live"
5354
],
5455
"test-cov-live": [
55-
"vendor/bin/phpunit --coverage-clover=coverage.xml"
56+
"vendor/bin/phpunit --coverage-clover coverage.xml"
5657
],
5758
"test-cov-upload": [
5859
"curl -s https://codecov.io/bash | bash"

composer.lock

Lines changed: 54 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpcs.xml.dist

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ruleset name="PHP Telegram Bot Manager">
3+
<description>PHP Code Sniffer</description>
4+
5+
<arg name="colors"/>
6+
<arg name="parallel" value="8"/>
7+
<arg name="encoding" value="utf-8"/>
8+
<arg name="report-width" value="150"/>
9+
10+
<rule ref="PSR12"/>
11+
</ruleset>

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<php>
2828
<ini name="date.timezone" value="UTC"/>
2929
<ini name="error_reporting" value="-1"/>
30-
<const name="PHPUNIT_TEST" value="true"/>
30+
<const name="PHPUNIT_TESTSUITE" value="true"/>
3131
<const name="PHPUNIT_DB_HOST" value="127.0.0.1"/>
3232
<const name="PHPUNIT_DB_USER" value="root"/>
3333
<const name="PHPUNIT_DB_PASSWORD" value=""/>

src/BotManager.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function __construct(array $params)
8383
*/
8484
public static function inTest(): bool
8585
{
86-
return \defined('PHPUNIT_TEST') && PHPUNIT_TEST === true;
86+
return \defined('PHPUNIT_TESTSUITE') && PHPUNIT_TESTSUITE === true;
8787
}
8888

8989
/**
@@ -162,6 +162,8 @@ public function run(): self
162162
*/
163163
public function initLogging(array $log_paths): self
164164
{
165+
(defined('PHPUNIT_TESTSUITE') && PHPUNIT_TESTSUITE) || trigger_error(__METHOD__ . ' is deprecated and will be removed soon. Initialise with a preconfigured logger instance instead using "TelegramLog::initialize($logger)".', E_USER_DEPRECATED);
166+
165167
foreach ($log_paths as $logger => $logfile) {
166168
('debug' === $logger) && TelegramLog::initDebugLog($logfile);
167169
('error' === $logger) && TelegramLog::initErrorLog($logfile);

0 commit comments

Comments
 (0)