Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1048: Update code to reflect namespace changes #56

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
### Notes
- [:ledger: View file changes][1.2.2]
### Added
- Linked version numbers in changelog for easy verification of code changes.
- Linked version numbers in changelog for easy verification of code changes.
### Changed
- Upgraded dependencies and bumped core to version 0.48.0.

Expand Down Expand Up @@ -94,7 +94,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
- [:ledger: View file changes][1.0.0]
### Changed
- [:exclamation:][1.0.0-bc-move] Move to `php-telegram-bot/telegram-bot-manager` on packagist.
- [:exclamation:][1.0.0-bc-move] Move to `TelegramBot\TelegramBotManager` namespace.
- [:exclamation:][1.0.0-bc-move] Move to `PhpTelegramBot\PhpTelegramBotManager` namespace.

## [0.44.0] - 2017-05-05
### Notes
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ It is possible however, to override the core version that this library requires:
```yaml
"require": {
"php-telegram-bot/telegram-bot-manager": "^1.4",
"longman/telegram-bot": "dev-develop as 0.59"
"php-telegram-bot/core": "dev-develop as 0.59"
}
```

Expand Down Expand Up @@ -137,7 +137,7 @@ Let's start off with a simple example that uses the webhook method:
```php
<?php

use TelegramBot\TelegramBotManager\BotManager;
use PhpTelegramBot\PhpTelegramBotManager\BotManager;

// Load composer.
require_once __DIR__ . '/vendor/autoload.php';
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "php-telegram-bot/telegram-bot-manager",
"name": "php-telegram-bot/php-telegram-bot-manager",
"type": "library",
"description": "PHP Telegram Bot Manager",
"keywords": ["telegram", "bot", "manager"],
"license": "MIT",
"homepage": "https://github.com/php-telegram-bot/telegram-bot-manager",
"homepage": "https://github.com/php-telegram-bot/php-telegram-bot-manager",
"support": {
"issues": "https://github.com/php-telegram-bot/telegram-bot-manager/issues",
"source": "https://github.com/php-telegram-bot/telegram-bot-manager"
"issues": "https://github.com/php-telegram-bot/php-telegram-bot-manager/issues",
"source": "https://github.com/php-telegram-bot/php-telegram-bot-manager"
},
"authors": [
{
Expand All @@ -19,7 +19,7 @@
],
"require": {
"php": "^7.1",
"longman/telegram-bot": "^0.59",
"php-telegram-bot/core": "^0.59",
"longman/ip-tools": "^1.2",
"psr/log": "^1.1"
},
Expand All @@ -30,12 +30,12 @@
},
"autoload": {
"psr-4": {
"TelegramBot\\TelegramBotManager\\": "src"
"PhpTelegramBot\\PhpTelegramBotManager\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"TelegramBot\\TelegramBotManager\\Tests\\": "tests"
"PhpTelegramBot\\PhpTelegramBotManager\\Tests\\": "tests"
}
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* file that was distributed with this source code.
*/

namespace TelegramBot\TelegramBotManager;
namespace PhpTelegramBot\PhpTelegramBotManager;

use TelegramBot\TelegramBotManager\Exception\InvalidActionException;
use PhpTelegramBot\PhpTelegramBotManager\Exception\InvalidActionException;

class Action
{
Expand Down
30 changes: 15 additions & 15 deletions src/BotManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@
* file that was distributed with this source code.
*/

namespace TelegramBot\TelegramBotManager;
namespace PhpTelegramBot\PhpTelegramBotManager;

use Exception;
use Longman\IPTools\Ip;
use Longman\TelegramBot\Entities\CallbackQuery;
use Longman\TelegramBot\Entities\ChosenInlineResult;
use Longman\TelegramBot\Entities\InlineQuery;
use Longman\TelegramBot\Entities\Message;
use Longman\TelegramBot\Entities\ServerResponse;
use Longman\TelegramBot\Entities\Update;
use Longman\TelegramBot\Exception\TelegramException;
use Longman\TelegramBot\Request;
use Longman\TelegramBot\Telegram;
use Longman\TelegramBot\TelegramLog;
use TelegramBot\TelegramBotManager\Exception\InvalidAccessException;
use TelegramBot\TelegramBotManager\Exception\InvalidActionException;
use TelegramBot\TelegramBotManager\Exception\InvalidParamsException;
use TelegramBot\TelegramBotManager\Exception\InvalidWebhookException;
use PhpTelegramBot\Core\Entities\CallbackQuery;
use PhpTelegramBot\Core\Entities\ChosenInlineResult;
use PhpTelegramBot\Core\Entities\InlineQuery;
use PhpTelegramBot\Core\Entities\Message;
use PhpTelegramBot\Core\Entities\ServerResponse;
use PhpTelegramBot\Core\Entities\Update;
use PhpTelegramBot\Core\Exception\TelegramException;
use PhpTelegramBot\Core\Request;
use PhpTelegramBot\Core\Telegram;
use PhpTelegramBot\Core\TelegramLog;
use PhpTelegramBot\PhpTelegramBotManager\Exception\InvalidAccessException;
use PhpTelegramBot\PhpTelegramBotManager\Exception\InvalidActionException;
use PhpTelegramBot\PhpTelegramBotManager\Exception\InvalidParamsException;
use PhpTelegramBot\PhpTelegramBotManager\Exception\InvalidWebhookException;

class BotManager
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/BotManagerException.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* file that was distributed with this source code.
*/

namespace TelegramBot\TelegramBotManager\Exception;
namespace PhpTelegramBot\PhpTelegramBotManager\Exception;

class BotManagerException extends \Exception
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/InvalidAccessException.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* file that was distributed with this source code.
*/

namespace TelegramBot\TelegramBotManager\Exception;
namespace PhpTelegramBot\PhpTelegramBotManager\Exception;

class InvalidAccessException extends BotManagerException
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/InvalidActionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* file that was distributed with this source code.
*/

namespace TelegramBot\TelegramBotManager\Exception;
namespace PhpTelegramBot\PhpTelegramBotManager\Exception;

class InvalidActionException extends BotManagerException
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/InvalidParamsException.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* file that was distributed with this source code.
*/

namespace TelegramBot\TelegramBotManager\Exception;
namespace PhpTelegramBot\PhpTelegramBotManager\Exception;

class InvalidParamsException extends BotManagerException
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/InvalidWebhookException.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* file that was distributed with this source code.
*/

namespace TelegramBot\TelegramBotManager\Exception;
namespace PhpTelegramBot\PhpTelegramBotManager\Exception;

class InvalidWebhookException extends BotManagerException
{
Expand Down
4 changes: 2 additions & 2 deletions src/Params.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* file that was distributed with this source code.
*/

namespace TelegramBot\TelegramBotManager;
namespace PhpTelegramBot\PhpTelegramBotManager;

use TelegramBot\TelegramBotManager\Exception\InvalidParamsException;
use PhpTelegramBot\PhpTelegramBotManager\Exception\InvalidParamsException;

class Params
{
Expand Down
6 changes: 3 additions & 3 deletions tests/ActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
* file that was distributed with this source code.
*/

namespace TelegramBot\TelegramBotManager\Tests;
namespace PhpTelegramBot\PhpTelegramBotManager\Tests;

use TelegramBot\TelegramBotManager\Action;
use TelegramBot\TelegramBotManager\Exception\InvalidActionException;
use PhpTelegramBot\PhpTelegramBotManager\Action;
use PhpTelegramBot\PhpTelegramBotManager\Exception\InvalidActionException;

class ActionTest extends \PHPUnit\Framework\TestCase
{
Expand Down
20 changes: 10 additions & 10 deletions tests/BotManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@
* file that was distributed with this source code.
*/

namespace TelegramBot\TelegramBotManager\Tests;
namespace PhpTelegramBot\PhpTelegramBotManager\Tests;

use Longman\TelegramBot\Request;
use Longman\TelegramBot\Telegram;
use Longman\TelegramBot\TelegramLog;
use TelegramBot\TelegramBotManager\BotManager;
use TelegramBot\TelegramBotManager\Exception\InvalidAccessException;
use TelegramBot\TelegramBotManager\Exception\InvalidParamsException;
use PhpTelegramBot\Core\Request;
use PhpTelegramBot\Core\Telegram;
use PhpTelegramBot\Core\TelegramLog;
use PhpTelegramBot\PhpTelegramBotManager\BotManager;
use PhpTelegramBot\PhpTelegramBotManager\Exception\InvalidAccessException;
use PhpTelegramBot\PhpTelegramBotManager\Exception\InvalidParamsException;

/**
* Class BotManagerTest.php
*
* Leave all member variables public to allow easy modification.
*
* @package TelegramBot\TelegramBotManager
* @package PhpTelegramBot\PhpTelegramBotManager
*/
class BotManagerTest extends \PHPUnit\Framework\TestCase
{
Expand Down Expand Up @@ -259,7 +259,7 @@ public function testDeleteWebhookViaRunLiveBot(): void
}

/**
* @expectedException \TelegramBot\TelegramBotManager\Exception\InvalidWebhookException
* @expectedException \PhpTelegramBot\PhpTelegramBotManager\Exception\InvalidWebhookException
* @expectedExceptionMessage Invalid webhook
*/
public function testValidateAndSetWebhookFailSetWithoutWebhook(): void
Expand All @@ -271,7 +271,7 @@ public function testValidateAndSetWebhookFailSetWithoutWebhook(): void
}

/**
* @expectedException \TelegramBot\TelegramBotManager\Exception\InvalidWebhookException
* @expectedException \PhpTelegramBot\PhpTelegramBotManager\Exception\InvalidWebhookException
* @expectedExceptionMessage Invalid webhook
*/
public function testValidateAndSetWebhookFailResetWithoutWebhook(): void
Expand Down
8 changes: 4 additions & 4 deletions tests/ParamsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* file that was distributed with this source code.
*/

namespace TelegramBot\TelegramBotManager\Tests;
namespace PhpTelegramBot\PhpTelegramBotManager\Tests;

use TelegramBot\TelegramBotManager\Params;
use PhpTelegramBot\PhpTelegramBotManager\Params;

class ParamsTest extends \PHPUnit\Framework\TestCase
{
Expand Down Expand Up @@ -88,7 +88,7 @@ public function testConstruct(): void
}

/**
* @expectedException \TelegramBot\TelegramBotManager\Exception\InvalidParamsException
* @expectedException \PhpTelegramBot\PhpTelegramBotManager\Exception\InvalidParamsException
* @expectedExceptionMessage Some vital info is missing: api_key
*/
public function testConstructWithoutApiKey(): void
Expand All @@ -97,7 +97,7 @@ public function testConstructWithoutApiKey(): void
}

/**
* @expectedException \TelegramBot\TelegramBotManager\Exception\InvalidParamsException
* @expectedException \PhpTelegramBot\PhpTelegramBotManager\Exception\InvalidParamsException
* @expectedExceptionMessage Some vital info is missing: secret
*/
public function testConstructWithWebhookWithoutSecret(): void
Expand Down
2 changes: 1 addition & 1 deletion tests/TestHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* file that was distributed with this source code.
*/

namespace TelegramBot\TelegramBotManager\Tests;
namespace PhpTelegramBot\PhpTelegramBotManager\Tests;

class TestHelpers
{
Expand Down