Skip to content

Commit e220a09

Browse files
committed
Rename package to react/datagram and update to use React namespace
1 parent 704a7d9 commit e220a09

11 files changed

Lines changed: 28 additions & 26 deletions

File tree

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# clue/datagram [![Build Status](https://travis-ci.org/clue/php-datagram.svg?branch=master)](https://travis-ci.org/clue/php-datagram)
1+
# Datagram component
2+
3+
[![Build Status](https://travis-ci.org/reactphp/datagram.svg?branch=master)](https://travis-ci.org/reactphp/datagram)
24

35
UDP datagram socket client and server for reactphp
46

@@ -10,9 +12,9 @@ Once [installed](#install), you can use the following code to connect to an UDP
1012
```php
1113
$loop = React\EventLoop\Factory::create();
1214

13-
$factory = new Datagram\Factory($loop);
15+
$factory = new React\Datagram\Factory($loop);
1416

15-
$factory->createClient('localhost:1234')->then(function (Datagram\Socket $client) {
17+
$factory->createClient('localhost:1234')->then(function (React\Datagram\Socket $client) {
1618
$client->send('first');
1719

1820
$client->on('message', function($message, $serverAddress, $client) {
@@ -37,7 +39,7 @@ The recommended way to install this library is [through composer](http://getcomp
3739
```JSON
3840
{
3941
"require": {
40-
"clue/datagram": "0.5.*"
42+
"react/datagram": "0.5.*"
4143
}
4244
}
4345
```

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "clue/datagram",
2+
"name": "react/datagram",
33
"description": "UDP datagram socket client and server for reactphp",
44
"keywords": ["udp", "datagram", "dgram", "socket", "client", "server", "react", "async"],
5-
"homepage": "https://github.com/clue/php-datagram",
5+
"homepage": "https://github.com/reactphp/datagram",
66
"license": "MIT",
77
"authors": [
88
{
@@ -11,7 +11,7 @@
1111
}
1212
],
1313
"autoload": {
14-
"psr-4": {"Datagram\\": "src"}
14+
"psr-4": {"React\\Datagram\\": "src"}
1515
},
1616
"require": {
1717
"php": ">=5.3",

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
$factory = new React\Dns\Resolver\Factory();
88
$resolver = $factory->createCached('8.8.8.8', $loop);
99

10-
$factory = new Datagram\Factory($loop, $resolver);
10+
$factory = new React\Datagram\Factory($loop, $resolver);
1111

12-
$factory->createClient('localhost:1234')->then(function (Datagram\Socket $client) use ($loop) {
12+
$factory->createClient('localhost:1234')->then(function (React\Datagram\Socket $client) use ($loop) {
1313
$client->send('first');
1414

1515
$client->on('message', function($message, $serverAddress, $client) {

examples/server.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
$loop = React\EventLoop\Factory::create();
66

7-
$factory = new Datagram\Factory($loop);
7+
$factory = new React\Datagram\Factory($loop);
88

9-
$factory->createServer('localhost:1234')->then(function (Datagram\Socket $server) {
9+
$factory->createServer('localhost:1234')->then(function (React\Datagram\Socket $server) {
1010
$server->on('message', function($message, $address, $server) {
1111
$server->send('hello ' . $address . '! echo: ' . $message, $address);
1212

src/Buffer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Datagram;
3+
namespace React\Datagram;
44

55
use Evenement\EventEmitter;
66
use React\EventLoop\LoopInterface;

src/Factory.php

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

3-
namespace Datagram;
3+
namespace React\Datagram;
44

55
use React\EventLoop\LoopInterface;
66
use React\Dns\Resolver\Resolver;
77
use React\Promise\Deferred;
8-
use Datagram\Socket;
8+
use React\Datagram\Socket;
99
use \Exception;
1010

1111
class Factory

src/Socket.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Datagram;
3+
namespace React\Datagram;
44

55
use React\EventLoop\LoopInterface;
66
use Evenement\EventEmitter;

src/SocketInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Datagram;
3+
namespace React\Datagram;
44

55
use Evenement\EventEmitterInterface;
66

tests/FactoryTest.php

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

3-
use Datagram\Socket;
3+
use React\Datagram\Socket;
44
use React\Promise\When;
55
use React\Promise\PromiseInterface;
66

@@ -11,15 +11,15 @@ class FactoryTest extends TestCase
1111
public function setUp()
1212
{
1313
$this->loop = React\EventLoop\Factory::create();
14-
$this->factory = new Datagram\Factory($this->loop, $this->createResolverMock());
14+
$this->factory = new React\Datagram\Factory($this->loop, $this->createResolverMock());
1515
}
1616

1717
public function testCreateClient()
1818
{
1919
$promise = $this->factory->createClient('127.0.0.1:12345');
2020

2121
$capturedClient = $this->getValueFromResolvedPromise($promise);
22-
$this->assertInstanceOf('Datagram\Socket', $capturedClient);
22+
$this->assertInstanceOf('React\Datagram\Socket', $capturedClient);
2323

2424
$capturedClient->close();
2525
}
@@ -29,7 +29,7 @@ public function testCreateClientLocalhost()
2929
$promise = $this->factory->createClient('localhost:12345');
3030

3131
$capturedClient = $this->getValueFromResolvedPromise($promise);
32-
$this->assertInstanceOf('Datagram\Socket', $capturedClient);
32+
$this->assertInstanceOf('React\Datagram\Socket', $capturedClient);
3333

3434
$capturedClient->close();
3535
}
@@ -39,7 +39,7 @@ public function testCreateClientIpv6()
3939
$promise = $this->factory->createClient('[::1]:12345');
4040

4141
$capturedClient = $this->getValueFromResolvedPromise($promise);
42-
$this->assertInstanceOf('Datagram\Socket', $capturedClient);
42+
$this->assertInstanceOf('React\Datagram\Socket', $capturedClient);
4343

4444
$capturedClient->close();
4545
}
@@ -49,7 +49,7 @@ public function testCreateServer()
4949
$promise = $this->factory->createServer('127.0.0.1:12345');
5050

5151
$capturedServer = $this->getValueFromResolvedPromise($promise);
52-
$this->assertInstanceOf('Datagram\Socket', $capturedServer);
52+
$this->assertInstanceOf('React\Datagram\Socket', $capturedServer);
5353

5454
$capturedServer->close();
5555
}
@@ -59,7 +59,7 @@ public function testCreateServerRandomPort()
5959
$promise = $this->factory->createServer('127.0.0.1:0');
6060

6161
$capturedServer = $this->getValueFromResolvedPromise($promise);
62-
$this->assertInstanceOf('Datagram\Socket', $capturedServer);
62+
$this->assertInstanceOf('React\Datagram\Socket', $capturedServer);
6363

6464
$this->assertNotEquals('127.0.0.1:0', $capturedServer->getLocalAddress());
6565

0 commit comments

Comments
 (0)