public function receiveData(string $data): void
    {
        $chunkSize = null;

        while ($data) {
            $frame = $this->getReceivingFrame();

            $remaining = $frame->getRemainingData();

            if ($remaining === null) {
                $chunkSize = 2;
            } elseif ($remaining > 0) {
                $chunkSize = $remaining;
            }

            $chunkSize = min(strlen($data), $chunkSize);
            $chunk = substr($data, 0, $chunkSize);
            $data = substr($data, $chunkSize);

            $frame->receiveData($chunk);
        }
    }
public function receiveData(string $data): void
    {
        $chunkSize = null;

        while ($data) {
            $frame = $this->getReceivingFrame();

            $remaining = $frame->getRemainingData();

            if ($remaining === null) {
                $chunkSize = 2;
            } elseif ($remaining > 0) {
                $chunkSize = $remaining;
            }

            $chunkSize = min(strlen($data), $chunkSize);
            $chunk = substr($data, 0, $chunkSize);
            $data = substr($data, $chunkSize);

            $frame->receiveData($chunk);
        }
    }
public function receiveData ( string $ data ) : void { $ chunkSize = null ; while ( $ data ) { $ frame = $ this -> getReceivingFrame ( ) ; $ remaining = $ frame -> getRemainingData ( ) ; if ( $ remaining === null ) { $ chunkSize = 2 ; } elseif ( $ remaining > 0 ) { $ chunkSize = $ remaining ; } $ chunkSize = min ( strlen ( $ data ) , $ chunkSize ) ; $ chunk = substr ( $ data , 0 , $ chunkSize ) ; $ data = substr ( $ data , $ chunkSize ) ; $ frame -> receiveData ( $ chunk ) ; } }
Receive raw data into the payload

@param string $data
@return void
@throws PayloadException
Receive raw data into the payload