Skip to content

Commit b4485ae

Browse files
authored
Version 1.0.0
2 parents bd324c2 + a6b49d2 commit b4485ae

17 files changed

+99
-99
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
1111
### Fixed
1212
### Security
1313

14+
## [1.0.0] - 2017-05-08
15+
### Changed
16+
- [:exclamation:][1.0.0-bc-move] Move to `php-telegram-bot/telegram-bot-manager` on packagist.
17+
- [:exclamation:][1.0.0-bc-move] Move to `TelegramBot\TelegramBotManager` namespace.
18+
1419
## [0.44.0] - 2017-05-05
1520
### Added
1621
- Ability to define custom valid IPs to access webhook.
@@ -77,4 +82,5 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
7782
### Added
7883
- First minor version that contains the basic functionality.
7984

85+
[1.0.0-bc-move]: https://github.com/php-telegram-bot/telegram-bot-manager/wiki/Breaking-backwards-compatibility#namespace-and-package-name-changed "Namespace and package name changed"
8086
[0.44.0-bc-parameter-structure]: https://github.com/php-telegram-bot/telegram-bot-manager/wiki/Breaking-backwards-compatibility#parameter-structure-changed "Parameter structure changed"

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ Installation and usage is pretty straight forward:
2020
Either run this command in your command line:
2121

2222
```bash
23-
composer require noplanman/telegram-bot-manager:^0.44
23+
composer require php-telegram-bot/telegram-bot-manager:^1.0
2424
```
2525

2626
**or**
2727

28-
For existing Composer projects, edit your project's `composer.json` file to require `noplanman/telegram-bot-manager`:
28+
For existing Composer projects, edit your project's `composer.json` file to require `php-telegram-bot/telegram-bot-manager`:
2929

3030
```yaml
3131
"require": {
32-
"noplanman/telegram-bot-manager": "^0.44"
32+
"php-telegram-bot/telegram-bot-manager": "^1.0"
3333
}
3434
```
3535
and then run `composer update`
@@ -42,7 +42,7 @@ It is possible however, to override the core version that this library requires:
4242

4343
```yaml
4444
"require": {
45-
"noplanman/telegram-bot-manager": "^0.44",
45+
"php-telegram-bot/telegram-bot-manager": "^1.0",
4646
"longman/telegram-bot": "dev-develop as 0.44"
4747
}
4848
```
@@ -133,7 +133,7 @@ Let's start off with a simple example that uses the webhook method:
133133
```php
134134
<?php
135135

136-
use NPM\TelegramBotManager\BotManager;
136+
use TelegramBot\TelegramBotManager\BotManager;
137137

138138
// Load composer.
139139
require_once __DIR__ . '/vendor/autoload.php';
@@ -308,12 +308,12 @@ $bot = new BotManager([
308308

309309
### Using getUpdates method
310310

311-
Using the `getUpdates` method requires a MySQL database connection:
311+
Using the `getUpdates` method must not have a `webhook` parameter set and requires a MySQL database connection:
312312
```php
313313
$bot = new BotManager([
314314
...
315315
// Extras.
316-
'mysql' => [
316+
'mysql' => [
317317
'host' => '127.0.0.1',
318318
'user' => 'root',
319319
'password' => 'root',
@@ -337,7 +337,7 @@ It probably makes sense for you to create a new dummy bot for this.
337337
[github-tgbot-core]: https://github.com/php-telegram-bot/core "PHP Telegram Bot on GitHub"
338338
[github-tgbot-core-instructions]: https://github.com/php-telegram-bot/core#instructions "PHP Telegram Bot instructions on GitHub"
339339
[github-tgbot-manager]: https://github.com/php-telegram-bot/telegram-bot-manager "PHP Telegram Bot Manager on GitHub"
340-
[packagist-tgbot-manager]: https://packagist.org/packages/noplanman/telegram-bot-manager "PHP Telegram Bot Manager on Packagist"
340+
[packagist-tgbot-manager]: https://packagist.org/packages/php-telegram-bot/telegram-bot-manager "PHP Telegram Bot Manager on Packagist"
341341
[license]: https://github.com/php-telegram-bot/telegram-bot-manager/blob/master/LICENSE "PHP Telegram Bot Manager license"
342342

343343
[code-quality-badge]: https://img.shields.io/scrutinizer/g/php-telegram-bot/telegram-bot-manager.svg
@@ -347,9 +347,9 @@ It probably makes sense for you to create a new dummy bot for this.
347347
[build-status-badge]: https://img.shields.io/travis/php-telegram-bot/telegram-bot-manager.svg
348348
[build-status]: https://travis-ci.org/php-telegram-bot/telegram-bot-manager "Build status on Travis-CI"
349349

350-
[latest-version-badge]: https://img.shields.io/packagist/v/noplanman/telegram-bot-manager.svg
351-
[total-downloads-badge]: https://img.shields.io/packagist/dt/noplanman/telegram-bot-manager.svg
352-
[license-badge]: https://img.shields.io/packagist/l/noplanman/telegram-bot-manager.svg
350+
[latest-version-badge]: https://img.shields.io/packagist/v/php-telegram-bot/telegram-bot-manager.svg
351+
[total-downloads-badge]: https://img.shields.io/packagist/dt/php-telegram-bot/telegram-bot-manager.svg
352+
[license-badge]: https://img.shields.io/packagist/l/php-telegram-bot/telegram-bot-manager.svg
353353

354354
[random-characters]: https://www.random.org/strings/?num=7&len=12&digits=on&upperalpha=on&loweralpha=on&unique=on&format=plain&rnd=new "Generate random characters"
355355
[travis-repository-settings]: https://docs.travis-ci.com/user/environment-variables#Defining-Variables-in-Repository-Settings "Repository Settings on Travis-CI"

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"name": "noplanman/telegram-bot-manager",
2+
"name": "php-telegram-bot/telegram-bot-manager",
33
"type": "library",
44
"description": "PHP Telegram Bot Manager",
55
"keywords": ["telegram", "bot", "manager"],
66
"license": "MIT",
7-
"homepage": "https://github.com/noplanman/php-telegram-bot-manager",
7+
"homepage": "https://github.com/php-telegram-bot/telegram-bot-manager",
88
"support": {
9-
"issues": "https://github.com/noplanman/php-telegram-bot-manager/issues",
10-
"source": "https://github.com/noplanman/php-telegram-bot-manager"
9+
"issues": "https://github.com/php-telegram-bot/telegram-bot-manager/issues",
10+
"source": "https://github.com/php-telegram-bot/telegram-bot-manager"
1111
},
1212
"authors": [
1313
{
@@ -31,16 +31,16 @@
3131
"require-dev": {
3232
"jakub-onderka/php-parallel-lint": "^0.9.2",
3333
"phpunit/phpunit": "^6.1",
34-
"squizlabs/php_codesniffer": "^2.8"
34+
"squizlabs/php_codesniffer": "^2.9"
3535
},
3636
"autoload": {
3737
"psr-4": {
38-
"NPM\\TelegramBotManager\\": "src"
38+
"TelegramBot\\TelegramBotManager\\": "src"
3939
}
4040
},
4141
"autoload-dev": {
4242
"psr-4": {
43-
"NPM\\TelegramBotManager\\Tests\\": "tests/TelegramBotManager/Tests"
43+
"TelegramBot\\TelegramBotManager\\Tests\\": "tests"
4444
}
4545
},
4646
"scripts": {

phpunit.xml.dist

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit bootstrap="tests/bootstrap.php" colors="true">
2+
<phpunit bootstrap="vendor/autoload.php"
3+
backupGlobals="false"
4+
backupStaticAttributes="false"
5+
beStrictAboutOutputDuringTests="true"
6+
colors="true"
7+
convertErrorsToExceptions="true"
8+
convertNoticesToExceptions="true"
9+
convertWarningsToExceptions="true"
10+
processIsolation="false"
11+
stopOnError="false"
12+
stopOnFailure="false"
13+
verbose="true"
14+
>
315
<testsuites>
416
<testsuite name="TelegramBotManager Test Suite">
5-
<directory>tests/</directory>
17+
<directory suffix="Test.php">tests/</directory>
618
</testsuite>
719
</testsuites>
820

921
<filter>
10-
<whitelist>
22+
<whitelist processUncoveredFilesFromWhitelist="true">
1123
<directory suffix=".php">src/</directory>
1224
</whitelist>
1325
</filter>
1426

1527
<php>
1628
<ini name="date.timezone" value="UTC"/>
17-
<ini name="error_reporting" value="-1" />
18-
<const name="PHPUNIT_TEST" value="true" />
29+
<ini name="error_reporting" value="-1"/>
30+
<const name="PHPUNIT_TEST" value="true"/>
1931
<const name="PHPUNIT_DB_HOST" value="127.0.0.1"/>
2032
<const name="PHPUNIT_DB_USER" value="root"/>
2133
<const name="PHPUNIT_DB_PASSWORD" value=""/>

src/Action.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
* file that was distributed with this source code.
99
*/
1010

11-
namespace NPM\TelegramBotManager;
11+
namespace TelegramBot\TelegramBotManager;
1212

13-
use NPM\TelegramBotManager\Exception\InvalidActionException;
13+
use TelegramBot\TelegramBotManager\Exception\InvalidActionException;
1414

1515
class Action
1616
{
@@ -35,7 +35,7 @@ class Action
3535
*
3636
* @param string $action
3737
*
38-
* @throws \NPM\TelegramBotManager\Exception\InvalidActionException
38+
* @throws \TelegramBot\TelegramBotManager\Exception\InvalidActionException
3939
*/
4040
public function __construct($action = 'handle')
4141
{

src/BotManager.php

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
* file that was distributed with this source code.
99
*/
1010

11-
namespace NPM\TelegramBotManager;
11+
namespace TelegramBot\TelegramBotManager;
1212

1313
use Allty\Utils\IpTools;
1414
use Longman\TelegramBot\Entities;
1515
use Longman\TelegramBot\Request;
1616
use Longman\TelegramBot\Telegram;
1717
use Longman\TelegramBot\TelegramLog;
18-
use NPM\TelegramBotManager\Exception\InvalidAccessException;
19-
use NPM\TelegramBotManager\Exception\InvalidWebhookException;
18+
use TelegramBot\TelegramBotManager\Exception\InvalidAccessException;
19+
use TelegramBot\TelegramBotManager\Exception\InvalidWebhookException;
2020

2121
class BotManager
2222
{
@@ -36,12 +36,12 @@ class BotManager
3636
private $telegram;
3737

3838
/**
39-
* @var \NPM\TelegramBotManager\Params Object that manages the parameters.
39+
* @var \TelegramBot\TelegramBotManager\Params Object that manages the parameters.
4040
*/
4141
private $params;
4242

4343
/**
44-
* @var \NPM\TelegramBotManager\Action Object that contains the current action.
44+
* @var \TelegramBot\TelegramBotManager\Action Object that contains the current action.
4545
*/
4646
private $action;
4747

@@ -50,8 +50,8 @@ class BotManager
5050
*
5151
* @param array $params
5252
*
53-
* @throws \NPM\TelegramBotManager\Exception\InvalidParamsException
54-
* @throws \NPM\TelegramBotManager\Exception\InvalidActionException
53+
* @throws \TelegramBot\TelegramBotManager\Exception\InvalidParamsException
54+
* @throws \TelegramBot\TelegramBotManager\Exception\InvalidActionException
5555
* @throws \Longman\TelegramBot\Exception\TelegramException
5656
*/
5757
public function __construct(array $params)
@@ -92,7 +92,7 @@ public function getTelegram(): Telegram
9292
/**
9393
* Get the Params object.
9494
*
95-
* @return \NPM\TelegramBotManager\Params
95+
* @return \TelegramBot\TelegramBotManager\Params
9696
*/
9797
public function getParams(): Params
9898
{
@@ -102,7 +102,7 @@ public function getParams(): Params
102102
/**
103103
* Get the Action object.
104104
*
105-
* @return \NPM\TelegramBotManager\Action
105+
* @return \TelegramBot\TelegramBotManager\Action
106106
*/
107107
public function getAction(): Action
108108
{
@@ -112,10 +112,10 @@ public function getAction(): Action
112112
/**
113113
* Run this thing in all its glory!
114114
*
115-
* @return \NPM\TelegramBotManager\BotManager
115+
* @return \TelegramBot\TelegramBotManager\BotManager
116116
* @throws \Longman\TelegramBot\Exception\TelegramException
117-
* @throws \NPM\TelegramBotManager\Exception\InvalidAccessException
118-
* @throws \NPM\TelegramBotManager\Exception\InvalidWebhookException
117+
* @throws \TelegramBot\TelegramBotManager\Exception\InvalidAccessException
118+
* @throws \TelegramBot\TelegramBotManager\Exception\InvalidWebhookException
119119
* @throws \Exception
120120
*/
121121
public function run(): self
@@ -145,7 +145,7 @@ public function run(): self
145145
*
146146
* @param array $log_paths
147147
*
148-
* @return \NPM\TelegramBotManager\BotManager
148+
* @return \TelegramBot\TelegramBotManager\BotManager
149149
* @throws \Exception
150150
*/
151151
public function initLogging(array $log_paths): self
@@ -164,8 +164,8 @@ public function initLogging(array $log_paths): self
164164
*
165165
* @param bool $force Force validation, even on CLI.
166166
*
167-
* @return \NPM\TelegramBotManager\BotManager
168-
* @throws \NPM\TelegramBotManager\Exception\InvalidAccessException
167+
* @return \TelegramBot\TelegramBotManager\BotManager
168+
* @throws \TelegramBot\TelegramBotManager\Exception\InvalidAccessException
169169
*/
170170
public function validateSecret(bool $force = false): self
171171
{
@@ -184,9 +184,9 @@ public function validateSecret(bool $force = false): self
184184
/**
185185
* Make sure the webhook is valid and perform the requested webhook operation.
186186
*
187-
* @return \NPM\TelegramBotManager\BotManager
187+
* @return \TelegramBot\TelegramBotManager\BotManager
188188
* @throws \Longman\TelegramBot\Exception\TelegramException
189-
* @throws \NPM\TelegramBotManager\Exception\InvalidWebhookException
189+
* @throws \TelegramBot\TelegramBotManager\Exception\InvalidWebhookException
190190
*/
191191
public function validateAndSetWebhook(): self
192192
{
@@ -224,7 +224,7 @@ public function validateAndSetWebhook(): self
224224
*
225225
* @param string $output
226226
*
227-
* @return \NPM\TelegramBotManager\BotManager
227+
* @return \TelegramBot\TelegramBotManager\BotManager
228228
*/
229229
private function handleOutput(string $output): self
230230
{
@@ -240,7 +240,7 @@ private function handleOutput(string $output): self
240240
/**
241241
* Set any extra bot features that have been assigned on construction.
242242
*
243-
* @return \NPM\TelegramBotManager\BotManager
243+
* @return \TelegramBot\TelegramBotManager\BotManager
244244
* @throws \Longman\TelegramBot\Exception\TelegramException
245245
*/
246246
public function setBotExtras(): self
@@ -254,7 +254,7 @@ public function setBotExtras(): self
254254
/**
255255
* Set extra bot parameters for Telegram object.
256256
*
257-
* @return \NPM\TelegramBotManager\BotManager
257+
* @return \TelegramBot\TelegramBotManager\BotManager
258258
* @throws \Longman\TelegramBot\Exception\TelegramException
259259
*/
260260
protected function setBotExtrasTelegram(): self
@@ -293,7 +293,7 @@ protected function setBotExtrasTelegram(): self
293293
/**
294294
* Set extra bot parameters for Request class.
295295
*
296-
* @return \NPM\TelegramBotManager\BotManager
296+
* @return \TelegramBot\TelegramBotManager\BotManager
297297
* @throws \Longman\TelegramBot\Exception\TelegramException
298298
*/
299299
protected function setBotExtrasRequest(): self
@@ -322,8 +322,8 @@ protected function setBotExtrasRequest(): self
322322
/**
323323
* Handle the request, which calls either the Webhook or getUpdates method respectively.
324324
*
325-
* @return \NPM\TelegramBotManager\BotManager
326-
* @throws \NPM\TelegramBotManager\Exception\InvalidAccessException
325+
* @return \TelegramBot\TelegramBotManager\BotManager
326+
* @throws \TelegramBot\TelegramBotManager\Exception\InvalidAccessException
327327
* @throws \Longman\TelegramBot\Exception\TelegramException
328328
*/
329329
public function handleRequest(): self
@@ -344,7 +344,7 @@ public function handleRequest(): self
344344
/**
345345
* Handle cron.
346346
*
347-
* @return \NPM\TelegramBotManager\BotManager
347+
* @return \TelegramBot\TelegramBotManager\BotManager
348348
* @throws \Longman\TelegramBot\Exception\TelegramException
349349
*/
350350
public function handleCron(): self
@@ -403,7 +403,7 @@ public function getLoopInterval(): int
403403
* @param int $loop_time_in_seconds
404404
* @param int $loop_interval_in_seconds
405405
*
406-
* @return \NPM\TelegramBotManager\BotManager
406+
* @return \TelegramBot\TelegramBotManager\BotManager
407407
* @throws \Longman\TelegramBot\Exception\TelegramException
408408
*/
409409
public function handleGetUpdatesLoop(int $loop_time_in_seconds, int $loop_interval_in_seconds = 2): self
@@ -426,7 +426,7 @@ public function handleGetUpdatesLoop(int $loop_time_in_seconds, int $loop_interv
426426
/**
427427
* Handle the updates using the getUpdates method.
428428
*
429-
* @return \NPM\TelegramBotManager\BotManager
429+
* @return \TelegramBot\TelegramBotManager\BotManager
430430
* @throws \Longman\TelegramBot\Exception\TelegramException
431431
*/
432432
public function handleGetUpdates(): self
@@ -473,9 +473,9 @@ public function handleGetUpdates(): self
473473
/**
474474
* Handle the updates using the Webhook method.
475475
*
476-
* @return \NPM\TelegramBotManager\BotManager
476+
* @return \TelegramBot\TelegramBotManager\BotManager
477477
* @throws \Longman\TelegramBot\Exception\TelegramException
478-
* @throws \NPM\TelegramBotManager\Exception\InvalidAccessException
478+
* @throws \TelegramBot\TelegramBotManager\Exception\InvalidAccessException
479479
*/
480480
public function handleWebhook(): self
481481
{

src/Exception/BotManagerException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* file that was distributed with this source code.
99
*/
1010

11-
namespace NPM\TelegramBotManager\Exception;
11+
namespace TelegramBot\TelegramBotManager\Exception;
1212

1313
class BotManagerException extends \Exception
1414
{

0 commit comments

Comments
 (0)