Skip to content

Commit

Permalink
Version 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
noplanman authored May 8, 2017
2 parents bd324c2 + a6b49d2 commit b4485ae
Show file tree
Hide file tree
Showing 17 changed files with 99 additions and 99 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
### Fixed
### Security

## [1.0.0] - 2017-05-08
### 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.

## [0.44.0] - 2017-05-05
### Added
- Ability to define custom valid IPs to access webhook.
Expand Down Expand Up @@ -77,4 +82,5 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
### Added
- First minor version that contains the basic functionality.

[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"
[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"
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ Installation and usage is pretty straight forward:
Either run this command in your command line:

```bash
composer require noplanman/telegram-bot-manager:^0.44
composer require php-telegram-bot/telegram-bot-manager:^1.0
```

**or**

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

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

```yaml
"require": {
"noplanman/telegram-bot-manager": "^0.44",
"php-telegram-bot/telegram-bot-manager": "^1.0",
"longman/telegram-bot": "dev-develop as 0.44"
}
```
Expand Down Expand Up @@ -133,7 +133,7 @@ Let's start off with a simple example that uses the webhook method:
```php
<?php

use NPM\TelegramBotManager\BotManager;
use TelegramBot\TelegramBotManager\BotManager;

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

### Using getUpdates method

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

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

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

[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"
[travis-repository-settings]: https://docs.travis-ci.com/user/environment-variables#Defining-Variables-in-Repository-Settings "Repository Settings on Travis-CI"
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": "noplanman/telegram-bot-manager",
"name": "php-telegram-bot/telegram-bot-manager",
"type": "library",
"description": "PHP Telegram Bot Manager",
"keywords": ["telegram", "bot", "manager"],
"license": "MIT",
"homepage": "https://github.com/noplanman/php-telegram-bot-manager",
"homepage": "https://github.com/php-telegram-bot/telegram-bot-manager",
"support": {
"issues": "https://github.com/noplanman/php-telegram-bot-manager/issues",
"source": "https://github.com/noplanman/php-telegram-bot-manager"
"issues": "https://github.com/php-telegram-bot/telegram-bot-manager/issues",
"source": "https://github.com/php-telegram-bot/telegram-bot-manager"
},
"authors": [
{
Expand All @@ -31,16 +31,16 @@
"require-dev": {
"jakub-onderka/php-parallel-lint": "^0.9.2",
"phpunit/phpunit": "^6.1",
"squizlabs/php_codesniffer": "^2.8"
"squizlabs/php_codesniffer": "^2.9"
},
"autoload": {
"psr-4": {
"NPM\\TelegramBotManager\\": "src"
"TelegramBot\\TelegramBotManager\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"NPM\\TelegramBotManager\\Tests\\": "tests/TelegramBotManager/Tests"
"TelegramBot\\TelegramBotManager\\Tests\\": "tests"
}
},
"scripts": {
Expand Down
22 changes: 17 additions & 5 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="tests/bootstrap.php" colors="true">
<phpunit bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
beStrictAboutOutputDuringTests="true"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
verbose="true"
>
<testsuites>
<testsuite name="TelegramBotManager Test Suite">
<directory>tests/</directory>
<directory suffix="Test.php">tests/</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src/</directory>
</whitelist>
</filter>

<php>
<ini name="date.timezone" value="UTC"/>
<ini name="error_reporting" value="-1" />
<const name="PHPUNIT_TEST" value="true" />
<ini name="error_reporting" value="-1"/>
<const name="PHPUNIT_TEST" value="true"/>
<const name="PHPUNIT_DB_HOST" value="127.0.0.1"/>
<const name="PHPUNIT_DB_USER" value="root"/>
<const name="PHPUNIT_DB_PASSWORD" value=""/>
Expand Down
6 changes: 3 additions & 3 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 NPM\TelegramBotManager;
namespace TelegramBot\TelegramBotManager;

use NPM\TelegramBotManager\Exception\InvalidActionException;
use TelegramBot\TelegramBotManager\Exception\InvalidActionException;

class Action
{
Expand All @@ -35,7 +35,7 @@ class Action
*
* @param string $action
*
* @throws \NPM\TelegramBotManager\Exception\InvalidActionException
* @throws \TelegramBot\TelegramBotManager\Exception\InvalidActionException
*/
public function __construct($action = 'handle')
{
Expand Down
56 changes: 28 additions & 28 deletions src/BotManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
* file that was distributed with this source code.
*/

namespace NPM\TelegramBotManager;
namespace TelegramBot\TelegramBotManager;

use Allty\Utils\IpTools;
use Longman\TelegramBot\Entities;
use Longman\TelegramBot\Request;
use Longman\TelegramBot\Telegram;
use Longman\TelegramBot\TelegramLog;
use NPM\TelegramBotManager\Exception\InvalidAccessException;
use NPM\TelegramBotManager\Exception\InvalidWebhookException;
use TelegramBot\TelegramBotManager\Exception\InvalidAccessException;
use TelegramBot\TelegramBotManager\Exception\InvalidWebhookException;

class BotManager
{
Expand All @@ -36,12 +36,12 @@ class BotManager
private $telegram;

/**
* @var \NPM\TelegramBotManager\Params Object that manages the parameters.
* @var \TelegramBot\TelegramBotManager\Params Object that manages the parameters.
*/
private $params;

/**
* @var \NPM\TelegramBotManager\Action Object that contains the current action.
* @var \TelegramBot\TelegramBotManager\Action Object that contains the current action.
*/
private $action;

Expand All @@ -50,8 +50,8 @@ class BotManager
*
* @param array $params
*
* @throws \NPM\TelegramBotManager\Exception\InvalidParamsException
* @throws \NPM\TelegramBotManager\Exception\InvalidActionException
* @throws \TelegramBot\TelegramBotManager\Exception\InvalidParamsException
* @throws \TelegramBot\TelegramBotManager\Exception\InvalidActionException
* @throws \Longman\TelegramBot\Exception\TelegramException
*/
public function __construct(array $params)
Expand Down Expand Up @@ -92,7 +92,7 @@ public function getTelegram(): Telegram
/**
* Get the Params object.
*
* @return \NPM\TelegramBotManager\Params
* @return \TelegramBot\TelegramBotManager\Params
*/
public function getParams(): Params
{
Expand All @@ -102,7 +102,7 @@ public function getParams(): Params
/**
* Get the Action object.
*
* @return \NPM\TelegramBotManager\Action
* @return \TelegramBot\TelegramBotManager\Action
*/
public function getAction(): Action
{
Expand All @@ -112,10 +112,10 @@ public function getAction(): Action
/**
* Run this thing in all its glory!
*
* @return \NPM\TelegramBotManager\BotManager
* @return \TelegramBot\TelegramBotManager\BotManager
* @throws \Longman\TelegramBot\Exception\TelegramException
* @throws \NPM\TelegramBotManager\Exception\InvalidAccessException
* @throws \NPM\TelegramBotManager\Exception\InvalidWebhookException
* @throws \TelegramBot\TelegramBotManager\Exception\InvalidAccessException
* @throws \TelegramBot\TelegramBotManager\Exception\InvalidWebhookException
* @throws \Exception
*/
public function run(): self
Expand Down Expand Up @@ -145,7 +145,7 @@ public function run(): self
*
* @param array $log_paths
*
* @return \NPM\TelegramBotManager\BotManager
* @return \TelegramBot\TelegramBotManager\BotManager
* @throws \Exception
*/
public function initLogging(array $log_paths): self
Expand All @@ -164,8 +164,8 @@ public function initLogging(array $log_paths): self
*
* @param bool $force Force validation, even on CLI.
*
* @return \NPM\TelegramBotManager\BotManager
* @throws \NPM\TelegramBotManager\Exception\InvalidAccessException
* @return \TelegramBot\TelegramBotManager\BotManager
* @throws \TelegramBot\TelegramBotManager\Exception\InvalidAccessException
*/
public function validateSecret(bool $force = false): self
{
Expand All @@ -184,9 +184,9 @@ public function validateSecret(bool $force = false): self
/**
* Make sure the webhook is valid and perform the requested webhook operation.
*
* @return \NPM\TelegramBotManager\BotManager
* @return \TelegramBot\TelegramBotManager\BotManager
* @throws \Longman\TelegramBot\Exception\TelegramException
* @throws \NPM\TelegramBotManager\Exception\InvalidWebhookException
* @throws \TelegramBot\TelegramBotManager\Exception\InvalidWebhookException
*/
public function validateAndSetWebhook(): self
{
Expand Down Expand Up @@ -224,7 +224,7 @@ public function validateAndSetWebhook(): self
*
* @param string $output
*
* @return \NPM\TelegramBotManager\BotManager
* @return \TelegramBot\TelegramBotManager\BotManager
*/
private function handleOutput(string $output): self
{
Expand All @@ -240,7 +240,7 @@ private function handleOutput(string $output): self
/**
* Set any extra bot features that have been assigned on construction.
*
* @return \NPM\TelegramBotManager\BotManager
* @return \TelegramBot\TelegramBotManager\BotManager
* @throws \Longman\TelegramBot\Exception\TelegramException
*/
public function setBotExtras(): self
Expand All @@ -254,7 +254,7 @@ public function setBotExtras(): self
/**
* Set extra bot parameters for Telegram object.
*
* @return \NPM\TelegramBotManager\BotManager
* @return \TelegramBot\TelegramBotManager\BotManager
* @throws \Longman\TelegramBot\Exception\TelegramException
*/
protected function setBotExtrasTelegram(): self
Expand Down Expand Up @@ -293,7 +293,7 @@ protected function setBotExtrasTelegram(): self
/**
* Set extra bot parameters for Request class.
*
* @return \NPM\TelegramBotManager\BotManager
* @return \TelegramBot\TelegramBotManager\BotManager
* @throws \Longman\TelegramBot\Exception\TelegramException
*/
protected function setBotExtrasRequest(): self
Expand Down Expand Up @@ -322,8 +322,8 @@ protected function setBotExtrasRequest(): self
/**
* Handle the request, which calls either the Webhook or getUpdates method respectively.
*
* @return \NPM\TelegramBotManager\BotManager
* @throws \NPM\TelegramBotManager\Exception\InvalidAccessException
* @return \TelegramBot\TelegramBotManager\BotManager
* @throws \TelegramBot\TelegramBotManager\Exception\InvalidAccessException
* @throws \Longman\TelegramBot\Exception\TelegramException
*/
public function handleRequest(): self
Expand All @@ -344,7 +344,7 @@ public function handleRequest(): self
/**
* Handle cron.
*
* @return \NPM\TelegramBotManager\BotManager
* @return \TelegramBot\TelegramBotManager\BotManager
* @throws \Longman\TelegramBot\Exception\TelegramException
*/
public function handleCron(): self
Expand Down Expand Up @@ -403,7 +403,7 @@ public function getLoopInterval(): int
* @param int $loop_time_in_seconds
* @param int $loop_interval_in_seconds
*
* @return \NPM\TelegramBotManager\BotManager
* @return \TelegramBot\TelegramBotManager\BotManager
* @throws \Longman\TelegramBot\Exception\TelegramException
*/
public function handleGetUpdatesLoop(int $loop_time_in_seconds, int $loop_interval_in_seconds = 2): self
Expand All @@ -426,7 +426,7 @@ public function handleGetUpdatesLoop(int $loop_time_in_seconds, int $loop_interv
/**
* Handle the updates using the getUpdates method.
*
* @return \NPM\TelegramBotManager\BotManager
* @return \TelegramBot\TelegramBotManager\BotManager
* @throws \Longman\TelegramBot\Exception\TelegramException
*/
public function handleGetUpdates(): self
Expand Down Expand Up @@ -473,9 +473,9 @@ public function handleGetUpdates(): self
/**
* Handle the updates using the Webhook method.
*
* @return \NPM\TelegramBotManager\BotManager
* @return \TelegramBot\TelegramBotManager\BotManager
* @throws \Longman\TelegramBot\Exception\TelegramException
* @throws \NPM\TelegramBotManager\Exception\InvalidAccessException
* @throws \TelegramBot\TelegramBotManager\Exception\InvalidAccessException
*/
public function handleWebhook(): self
{
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 NPM\TelegramBotManager\Exception;
namespace TelegramBot\TelegramBotManager\Exception;

class BotManagerException extends \Exception
{
Expand Down
Loading

0 comments on commit b4485ae

Please sign in to comment.