Skip to content

Commit b0aef50

Browse files
authored
Merge pull request #13 from iboldurev/0.3.0
0.3.0
2 parents d0cbdf1 + cafca7b commit b0aef50

25 files changed

+92
-94
lines changed

README.md

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
Dialogflow PHP sdk
1+
DialogFlow PHP sdk
22
==============
33

44
[![version][packagist-version]][packagist-url]
55
[![Downloads][packagist-downloads]][packagist-url]
66

7-
[packagist-url]: https://packagist.org/packages/iboldurev/api-ai-php
8-
[packagist-version]: https://img.shields.io/packagist/v/iboldurev/api-ai-php.svg?style=flat
9-
[packagist-downloads]: https://img.shields.io/packagist/dm/iboldurev/api-ai-php.svg?style=flat
7+
[packagist-url]: https://packagist.org/packages/iboldurev/dialogflow
8+
[packagist-version]: https://img.shields.io/packagist/v/iboldurev/dialogflow.svg?style=flat
9+
[packagist-downloads]: https://img.shields.io/packagist/dm/iboldurev/dialogflow.svg?style=flat
1010

1111
This is an unofficial php sdk for [Dialogflow][1] and it's still in progress...
1212

@@ -29,7 +29,7 @@ Using the low level `Client`:
2929
```php
3030
require_once __DIR__.'/vendor/autoload.php';
3131

32-
use ApiAi\Client;
32+
use DialogFlow\Client;
3333

3434
try {
3535
$client = new Client('access_token');
@@ -51,9 +51,9 @@ Using the low level `Query`:
5151
```php
5252
require_once __DIR__.'/vendor/autoload.php';
5353

54-
use ApiAi\Client;
55-
use ApiAi\Model\Query;
56-
use ApiAi\Method\QueryApi;
54+
use DialogFlow\Client;
55+
use DialogFlow\Model\Query;
56+
use DialogFlow\Method\QueryApi;
5757

5858
try {
5959
$client = new Client('access_token');
@@ -76,9 +76,9 @@ Using the low level asynchronous api:
7676
```php
7777
require_once __DIR__.'/vendor/autoload.php';
7878

79-
use ApiAi\Client;
80-
use ApiAi\Model\Query;
81-
use ApiAi\Method\QueryApi;
79+
use DialogFlow\Client;
80+
use DialogFlow\Model\Query;
81+
use DialogFlow\Method\QueryApi;
8282
use GuzzleHttp\HandlerStack;
8383
use React\EventLoop\Factory;
8484
use WyriHaximus\React\GuzzlePsr7\HttpClientAdapter;
@@ -152,9 +152,9 @@ And using it in the `Dialog` class.
152152
```php
153153
require_once __DIR__.'/vendor/autoload.php';
154154

155-
use ApiAi\Client;
156-
use ApiAi\Method\QueryApi;
157-
use ApiAi\Dialog;
155+
use DialogFlow\Client;
156+
use DialogFlow\Method\QueryApi;
157+
use DialogFlow\Dialog;
158158
use Custom\MyActionMapping;
159159

160160
try {
@@ -172,7 +172,4 @@ try {
172172

173173
```
174174

175-
Some examples are describe in the [iboldurev/api-ai-php-example][2] repository.
176-
177175
[1]: https://dialogflow.com
178-
[2]: https://github.com/iboldurev/api-ai-php-example

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
2-
"name": "iboldurev/api-ai-php",
2+
"name": "iboldurev/dialogflow",
33
"description": "Dialogflow php sdk",
44
"minimum-stability": "stable",
5+
"version": "0.3.0",
56
"license": "MIT",
67
"authors": [
78
{
@@ -18,7 +19,7 @@
1819
],
1920
"autoload": {
2021
"psr-4": {
21-
"ApiAi\\": "src/"
22+
"DialogFlow\\": "src/"
2223
}
2324
},
2425
"require": {

src/ActionMapping.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

3-
namespace ApiAi;
3+
namespace DialogFlow;
44

5-
use ApiAi\Model\Context;
5+
use DialogFlow\Model\Context;
66

77
/**
88
* Class ActionMapping
99
*
10-
* @package ApiAi
10+
* @package DialogFlow
1111
*/
1212
abstract class ActionMapping
1313
{

src/Client.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?php
22

3-
namespace ApiAi;
3+
namespace DialogFlow;
44

5-
use ApiAi\HttpClient\HttpClient;
6-
use ApiAi\HttpClient\GuzzleHttpClient;
7-
use ApiAi\Exception\BadResponseException;
5+
use DialogFlow\HttpClient\HttpClient;
6+
use DialogFlow\HttpClient\GuzzleHttpClient;
7+
use DialogFlow\Exception\BadResponseException;
88
use GuzzleHttp\Promise\PromiseInterface;
99
use function GuzzleHttp\Promise\rejection_for;
1010
use Psr\Http\Message\ResponseInterface;
1111

1212
/**
1313
* Class Client
1414
*
15-
* @package ApiAi
15+
* @package DialogFlow
1616
*/
1717
class Client
1818
{

src/Dialog.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<?php
22

3-
namespace ApiAi;
3+
namespace DialogFlow;
44

5-
use ApiAi\Method\QueryApi;
6-
use ApiAi\Model\Query;
7-
use ApiAi\Model\Step;
8-
use ApiAi\Model\Step\Action;
9-
use ApiAi\Model\Step\Speech;
10-
use ApiAi\Exception\DialogException;
11-
use ApiAi\Exception\InvalidStepException;
5+
use DialogFlow\Method\QueryApi;
6+
use DialogFlow\Model\Query;
7+
use DialogFlow\Model\Step;
8+
use DialogFlow\Model\Step\Action;
9+
use DialogFlow\Model\Step\Speech;
10+
use DialogFlow\Exception\DialogException;
11+
use DialogFlow\Exception\InvalidStepException;
1212

1313
/**
1414
* Class Dialog
1515
*
16-
* @package ApiAi
16+
* @package DialogFlow
1717
*/
1818
class Dialog
1919
{

src/Exception/BadResponseException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

3-
namespace ApiAi\Exception;
3+
namespace DialogFlow\Exception;
44

55
use Psr\Http\Message\ResponseInterface;
66

77
/**
88
* Class BadResponseException
99
*
10-
* @package ApiAi\Exception
10+
* @package DialogFlow\Exception
1111
*/
1212
class BadResponseException extends \RuntimeException
1313
{

src/Exception/DialogException.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

3-
namespace ApiAi\Exception;
3+
namespace DialogFlow\Exception;
44

5-
use ApiAi\Model\Query;
5+
use DialogFlow\Model\Query;
66

77
/**
88
* Class DialogException
99
*
10-
* @package ApiAi\Exception
10+
* @package DialogFlow\Exception
1111
*/
1212
class DialogException extends \RuntimeException
1313
{

src/Exception/InvalidStepException.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

3-
namespace ApiAi\Exception;
3+
namespace DialogFlow\Exception;
44

5-
use ApiAi\Model\Query;
5+
use DialogFlow\Model\Query;
66

77
/**
88
* Class InvalidStepException
99
*
10-
* @package ApiAi\Exception
10+
* @package DialogFlow\Exception
1111
*/
1212
class InvalidStepException extends \RuntimeException
1313
{

src/HttpClient/GuzzleHttpClient.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<?php
22

3-
namespace ApiAi\HttpClient;
3+
namespace DialogFlow\HttpClient;
44

55
use GuzzleHttp\Client as GuzzleClient;
66
use GuzzleHttp\ClientInterface;
77
use GuzzleHttp\RequestOptions;
8-
use ApiAi\Client;
8+
use DialogFlow\Client;
99

1010
/**
1111
* Class GuzzleHttpClient
1212
*
13-
* @package ApiAi\HttpClient
13+
* @package DialogFlow\HttpClient
1414
*/
1515
class GuzzleHttpClient implements HttpClient
1616
{

src/HttpClient/HttpClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?php
22

3-
namespace ApiAi\HttpClient;
3+
namespace DialogFlow\HttpClient;
44

55
use GuzzleHttp\Promise\PromiseInterface;
66
use Psr\Http\Message\ResponseInterface;
77

88
/**
99
* Interface HttpClient
1010
*
11-
* @package ApiAi\HttpClient
11+
* @package DialogFlow\HttpClient
1212
*/
1313
interface HttpClient
1414
{

0 commit comments

Comments
 (0)