Spiking SPL interfaces
This commit is contained in:
parent
5e79598448
commit
c1027be9a6
@ -1,11 +1,11 @@
|
||||
<?php
|
||||
namespace Ratchet\RFC6455\Messaging\Protocol;
|
||||
|
||||
class Message implements MessageInterface, \Countable {
|
||||
class Message implements MessageInterface {
|
||||
/**
|
||||
* @var \SplDoublyLinkedList
|
||||
*/
|
||||
protected $_frames;
|
||||
private $_frames;
|
||||
|
||||
public function __construct() {
|
||||
$this->_frames = new \SplDoublyLinkedList;
|
||||
@ -18,6 +18,22 @@ class Message implements MessageInterface, \Countable {
|
||||
return count($this->_frames);
|
||||
}
|
||||
|
||||
public function offsetExists($index) {
|
||||
return $this->_frames->offsetExists($index);
|
||||
}
|
||||
|
||||
public function offsetGet($index) {
|
||||
return $this->_frames->offsetGet($index);
|
||||
}
|
||||
|
||||
public function offsetSet($index, $newval) {
|
||||
throw new \DomainException('Frame access in messages is read-only');
|
||||
}
|
||||
|
||||
public function offsetUnset($index) {
|
||||
throw new \DomainException('Frame access in messages is read-only');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Ratchet\RFC6455\Messaging\Protocol;
|
||||
|
||||
interface MessageInterface extends DataInterface {
|
||||
interface MessageInterface extends DataInterface, \ArrayAccess, \Countable {
|
||||
/**
|
||||
* @param FrameInterface $fragment
|
||||
* @return MessageInterface
|
||||
|
Loading…
Reference in New Issue
Block a user