Prepare::getBody()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 1
Metric Value
c 2
b 1
f 1
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace Cassandra\Request;
3
use Cassandra\Protocol\Frame;
4
5
class Prepare extends Request{
6
7
	protected $opcode = Frame::OPCODE_PREPARE;
8
	
9
	/**
10
	 * 
11
	 * @var string
12
	 */
13
	protected $_cql;
14
	
15
	/**
16
	 * 
17
	 * @param string $cql
18
	 */
19
	public function __construct($cql) {
20
		$this->_cql = $cql;
21
	}
22
	
23
	public function getBody(){
24
		return pack('N', strlen($this->_cql)) . $this->_cql;
25
	}
26
}