16
16
use Webrtc \DataChannel \Enum \State ;
17
17
use Webrtc \Exception \InvalidArgumentException ;
18
18
use Webrtc \Exception \RuntimeException ;
19
- use Webrtc \SCTP \RTCSctpTransport ;
20
19
21
20
/**
22
21
* Represents a bidirectional peer-to-peer data channel for WebRTC communications.
@@ -42,7 +41,7 @@ class RTCDataChannel extends EventEmitter implements RTCDataChannelInterface
42
41
private ?int $ id ;
43
42
private RTCDataChannelParameters $ parameters ;
44
43
private State $ readyState = State::Connecting;
45
- private RTCSctpTransport $ transport ;
44
+ private RTCSctpTransportInterface $ transport ;
46
45
private bool $ sendOpen ;
47
46
private ?LoggerInterface $ logger = null ;
48
47
@@ -53,13 +52,13 @@ class RTCDataChannel extends EventEmitter implements RTCDataChannelInterface
53
52
* - For in-band: Automatically initiates the opening procedure
54
53
* - For out-of-band: Verifies ID validity and registers with transport
55
54
*
56
- * @param RTCSctpTransport $transport The SCTP transport layer for data transmission
55
+ * @param RTCSctpTransportInterface $transport The SCTP transport layer for data transmission
57
56
* @param RTCDataChannelParameters $parameters Configuration parameters for the channel
58
57
* @param bool $sendOpen Whether to immediately send open request (for in-band)
59
58
* @throws InvalidArgumentException If negotiated channel has invalid ID
60
59
*/
61
60
public function __construct (
62
- RTCSctpTransport $ transport ,
61
+ RTCSctpTransportInterface $ transport ,
63
62
RTCDataChannelParameters $ parameters ,
64
63
bool $ sendOpen = true
65
64
)
@@ -234,9 +233,9 @@ public function getReadyState(): State
234
233
/**
235
234
* Gets the underlying SCTP transport.
236
235
*
237
- * @return RTCSctpTransport The transport instance
236
+ * @return RTCSctpTransportInterface The transport instance
238
237
*/
239
- public function getTransport (): RTCSctpTransport
238
+ public function getTransport (): RTCSctpTransportInterface
240
239
{
241
240
return $ this ->transport ;
242
241
}
0 commit comments