File tree 9 files changed +45
-0
lines changed
9 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace Amp \Sql \Common ;
4
4
5
+ use Amp \ForbidCloning ;
6
+ use Amp \ForbidSerialization ;
5
7
use Amp \Future ;
6
8
use Amp \Sql \Result ;
7
9
13
15
*/
14
16
abstract class CommandResult implements Result, \IteratorAggregate
15
17
{
18
+ use ForbidCloning;
19
+ use ForbidSerialization;
20
+
16
21
/**
17
22
* @param Future<TResult|null> $nextResult
18
23
*/
Original file line number Diff line number Diff line change 3
3
namespace Amp \Sql \Common ;
4
4
5
5
use Amp \DeferredFuture ;
6
+ use Amp \ForbidCloning ;
7
+ use Amp \ForbidSerialization ;
6
8
use Amp \Future ;
7
9
use Amp \Sql \Connection ;
8
10
use Amp \Sql \Link ;
29
31
*/
30
32
abstract class ConnectionPool implements Pool
31
33
{
34
+ use ForbidCloning;
35
+ use ForbidSerialization;
36
+
32
37
public const DEFAULT_MAX_CONNECTIONS = 100 ;
33
38
public const DEFAULT_IDLE_TIMEOUT = 60 ;
34
39
Original file line number Diff line number Diff line change 3
3
namespace Amp \Sql \Common ;
4
4
5
5
use Amp \DeferredFuture ;
6
+ use Amp \ForbidCloning ;
7
+ use Amp \ForbidSerialization ;
6
8
use Amp \Sql \Result ;
7
9
use Amp \Sql \SqlException ;
8
10
use Amp \Sql \Statement ;
21
23
*/
22
24
abstract class ConnectionTransaction implements Transaction
23
25
{
26
+ use ForbidCloning;
27
+ use ForbidSerialization;
28
+
24
29
/** @var \Closure():void */
25
30
private readonly \Closure $ release ;
26
31
Original file line number Diff line number Diff line change 3
3
namespace Amp \Sql \Common ;
4
4
5
5
use Amp \DeferredFuture ;
6
+ use Amp \ForbidCloning ;
7
+ use Amp \ForbidSerialization ;
6
8
use Amp \Sql \Result ;
7
9
use Amp \Sql \SqlException ;
8
10
use Amp \Sql \Statement ;
21
23
*/
22
24
abstract class NestedTransaction implements Transaction
23
25
{
26
+ use ForbidCloning;
27
+ use ForbidSerialization;
28
+
24
29
/** @var \Closure():void */
25
30
private readonly \Closure $ release ;
26
31
Original file line number Diff line number Diff line change 2
2
3
3
namespace Amp \Sql \Common ;
4
4
5
+ use Amp \ForbidCloning ;
6
+ use Amp \ForbidSerialization ;
5
7
use Amp \Future ;
6
8
use Amp \Sql \Result ;
7
9
use Revolt \EventLoop ;
15
17
*/
16
18
abstract class PooledResult implements Result, \IteratorAggregate
17
19
{
20
+ use ForbidCloning;
21
+ use ForbidSerialization;
22
+
18
23
/** @var Future<TResult|null>|null */
19
24
private ?Future $ next = null ;
20
25
Original file line number Diff line number Diff line change 2
2
3
3
namespace Amp \Sql \Common ;
4
4
5
+ use Amp \ForbidCloning ;
6
+ use Amp \ForbidSerialization ;
5
7
use Amp \Sql \Result ;
6
8
use Amp \Sql \SqlException ;
7
9
use Amp \Sql \Statement ;
15
17
*/
16
18
abstract class PooledStatement implements Statement
17
19
{
20
+ use ForbidCloning;
21
+ use ForbidSerialization;
22
+
18
23
/** @var null|\Closure():void */
19
24
private ?\Closure $ release ;
20
25
Original file line number Diff line number Diff line change 2
2
3
3
namespace Amp \Sql \Common ;
4
4
5
+ use Amp \ForbidCloning ;
6
+ use Amp \ForbidSerialization ;
5
7
use Amp \Sql \Result ;
6
8
use Amp \Sql \Statement ;
7
9
use Amp \Sql \Transaction ;
17
19
*/
18
20
abstract class PooledTransaction implements Transaction
19
21
{
22
+ use ForbidCloning;
23
+ use ForbidSerialization;
24
+
20
25
/** @var \Closure():void */
21
26
private readonly \Closure $ release ;
22
27
Original file line number Diff line number Diff line change 4
4
5
5
use Amp \Cancellation ;
6
6
use Amp \CompositeException ;
7
+ use Amp \ForbidCloning ;
8
+ use Amp \ForbidSerialization ;
7
9
use Amp \Sql \Connection ;
8
10
use Amp \Sql \ConnectionException ;
9
11
use Amp \Sql \SqlConfig ;
16
18
*/
17
19
final class RetrySqlConnector implements SqlConnector
18
20
{
21
+ use ForbidCloning;
22
+ use ForbidSerialization;
23
+
19
24
/**
20
25
* @param SqlConnector<TConfig, TConnection> $connector
21
26
*/
Original file line number Diff line number Diff line change 3
3
namespace Amp \Sql \Common ;
4
4
5
5
use Amp \DeferredFuture ;
6
+ use Amp \ForbidCloning ;
7
+ use Amp \ForbidSerialization ;
6
8
use Amp \Sql \Pool ;
7
9
use Amp \Sql \Result ;
8
10
use Amp \Sql \SqlConfig ;
20
22
*/
21
23
abstract class StatementPool implements Statement
22
24
{
25
+ use ForbidCloning;
26
+ use ForbidSerialization;
27
+
23
28
private readonly Pool $ pool ;
24
29
25
30
/** @var \SplQueue<TStatement> */
You can’t perform that action at this time.
0 commit comments