Skip to content

Commit 5b3835a

Browse files
committed
add tests, remove functions.
1 parent a1207d7 commit 5b3835a

27 files changed

Lines changed: 370 additions & 338 deletions

‎composer.json‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@
7878
},
7979
"exclude-from-classmap": [
8080
"/Tests/"
81-
],
82-
"files": [
83-
"pkg/enqueue/functions_include.php"
8481
]
8582
},
8683
"autoload-dev": {

‎docs/transport/amqp.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ $factory = new AmqpConnectionFactory([
6363

6464
$psrContext = $factory->createContext();
6565

66-
// if you have enqueue/enqueue library installed you can use a function from there to create the context
67-
$psrContext = \Enqueue\dsn_to_context('amqp:');
68-
$psrContext = \Enqueue\dsn_to_context('amqp+ext:');
66+
// if you have enqueue/enqueue library installed you can use a factory to build context from DSN
67+
$psrContext = (new \Enqueue\ConnectionFactoryFactory())->create('amqp:')->createContext();
68+
$psrContext = (new \Enqueue\ConnectionFactoryFactory())->create('amqp+ext:')->createContext();
6969
```
7070

7171
## Declare topic.

‎docs/transport/amqp_bunny.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ $factory = new AmqpConnectionFactory('amqp://user:pass@example.com:10000/%2f');
5353

5454
$psrContext = $factory->createContext();
5555

56-
// if you have enqueue/enqueue library installed you can use a function from there to create the context
57-
$psrContext = \Enqueue\dsn_to_context('amqp:');
58-
$psrContext = \Enqueue\dsn_to_context('amqp+bunny:');
56+
// if you have enqueue/enqueue library installed you can use a factory to build context from DSN
57+
$psrContext = (new \Enqueue\ConnectionFactoryFactory())->create('amqp:')->createContext();
58+
$psrContext = (new \Enqueue\ConnectionFactoryFactory())->create('amqp+bunny:')->createContext();
5959
```
6060

6161
## Declare topic.

‎docs/transport/amqp_lib.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ $factory = new AmqpConnectionFactory([
6161

6262
$psrContext = $factory->createContext();
6363

64-
// if you have enqueue/enqueue library installed you can use a function from there to create the context
65-
$psrContext = \Enqueue\dsn_to_context('amqp:');
66-
$psrContext = \Enqueue\dsn_to_context('amqp+lib:');
64+
// if you have enqueue/enqueue library installed you can use a factory to build context from DSN
65+
$psrContext = (new \Enqueue\ConnectionFactoryFactory())->create('amqp:')->createContext();
66+
$psrContext = (new \Enqueue\ConnectionFactoryFactory())->create('amqp+lib:')->createContext();
6767
```
6868

6969
## Declare topic.

‎docs/transport/dbal.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ $factory = new ManagerRegistryConnectionFactory($registry, [
4949

5050
$psrContext = $factory->createContext();
5151

52-
// if you have enqueue/enqueue library installed you can use a function from there to create the context
53-
$psrContext = \Enqueue\dsn_to_context('mysql:');
52+
// if you have enqueue/enqueue library installed you can use a factory to build context from DSN
53+
$psrContext = (new \Enqueue\ConnectionFactoryFactory())->create('mysql:')->createContext();
5454
```
5555

5656
## Init database

‎docs/transport/filesystem.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ $connectionFactory = new FsConnectionFactory([
4848

4949
$psrContext = $connectionFactory->createContext();
5050

51-
// if you have enqueue/enqueue library installed you can use a function from there to create the context
52-
$psrContext = \Enqueue\dsn_to_context('file:');
51+
// if you have enqueue/enqueue library installed you can use a factory to build context from DSN
52+
$psrContext = (new \Enqueue\ConnectionFactoryFactory())->create('file:')->createContext();
5353
```
5454

5555
## Send message to topic

‎docs/transport/gearman.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ $factory = new GearmanConnectionFactory([
3939

4040
$psrContext = $factory->createContext();
4141

42-
// if you have enqueue/enqueue library installed you can use a function from there to create the context
43-
$psrContext = \Enqueue\dsn_to_context('gearman:');
42+
// if you have enqueue/enqueue library installed you can use a factory to build context from DSN
43+
$psrContext = (new \Enqueue\ConnectionFactoryFactory())->create('gearman:')->createContext();
4444
```
4545

4646
## Send message to topic

‎docs/transport/gps.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ $connectionFactory = new GpsConnectionFactory('gps:');
3232

3333
$psrContext = $connectionFactory->createContext();
3434

35-
// if you have enqueue/enqueue library installed you can use a function from there to create the context
36-
$psrContext = \Enqueue\dsn_to_context('gps:');
35+
// if you have enqueue/enqueue library installed you can use a factory to build context from DSN
36+
$psrContext = (new \Enqueue\ConnectionFactoryFactory())->create('gps:')->createContext();
3737
```
3838

3939
## Send message to topic

‎docs/transport/kafka.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ $connectionFactory = new RdKafkaConnectionFactory([
4545

4646
$psrContext = $connectionFactory->createContext();
4747

48-
// if you have enqueue/enqueue library installed you can use a function from there to create the context
49-
$psrContext = \Enqueue\dsn_to_context('kafka:');
48+
// if you have enqueue/enqueue library installed you can use a factory to build context from DSN
49+
$psrContext = (new \Enqueue\ConnectionFactoryFactory())->create('kafka:')->createContext();
5050
```
5151

5252
## Send message to topic

‎docs/transport/mongodb.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ $factory = new MongodbConnectionFactory([
4141

4242
$psrContext = $factory->createContext();
4343

44-
// if you have enqueue/enqueue library installed you can use a function from there to create the context
45-
$psrContext = \Enqueue\dsn_to_context('mongodb:');
44+
// if you have enqueue/enqueue library installed you can use a factory to build context from DSN
45+
$psrContext = (new \Enqueue\ConnectionFactoryFactory())->create('mongodb:')->createContext();
4646
```
4747

4848
## Send message to topic

0 commit comments

Comments
 (0)