From 718a1c0ce9186583403d1c6a3f08f4ed5413759c Mon Sep 17 00:00:00 2001 From: Vinoth Babu Date: Wed, 20 Apr 2016 15:07:59 +0530 Subject: [PATCH 1/3] error fix --- src/Request/Batch.php | 2 +- src/Response/Exception.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Request/Batch.php b/src/Request/Batch.php index 3a6d33d..c4eb652 100644 --- a/src/Request/Batch.php +++ b/src/Request/Batch.php @@ -94,7 +94,7 @@ public function appendQueryId($queryId, array $values = []) { * @param array $options * @return string */ - public static function queryParameters($consistency, array $options = []){ + public static function queryParameters($consistency, array $options = [], array $values = []){ $flags = 0; $optional = ''; diff --git a/src/Response/Exception.php b/src/Response/Exception.php index 0d44c81..b5c0b6a 100644 --- a/src/Response/Exception.php +++ b/src/Response/Exception.php @@ -1,4 +1,4 @@ Date: Thu, 21 Apr 2016 10:48:37 +0530 Subject: [PATCH 2/3] fix for the error - FatalErrorException in Exception.php line 4: Class Cassandra\Response\Exception cannot extend from interface Cassandra\Exception --- src/Response/Error.php | 2 +- src/Response/Exception.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Response/Error.php b/src/Response/Error.php index 175d661..1427fbb 100644 --- a/src/Response/Error.php +++ b/src/Response/Error.php @@ -123,6 +123,6 @@ public function getData() { */ public function getException(){ $data = $this->getData(); - return new Exception($data['message'], $data['code']); + return new \Exception($data['message'], $data['code']); } } diff --git a/src/Response/Exception.php b/src/Response/Exception.php index b5c0b6a..0d44c81 100644 --- a/src/Response/Exception.php +++ b/src/Response/Exception.php @@ -1,4 +1,4 @@ Date: Tue, 7 Jun 2016 16:56:01 +0530 Subject: [PATCH 3/3] fix for empty unpack --- src/Type/Uuid.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Type/Uuid.php b/src/Type/Uuid.php index d67b967..261988d 100644 --- a/src/Type/Uuid.php +++ b/src/Type/Uuid.php @@ -22,7 +22,10 @@ public static function binary($value){ } public static function parse($binary){ - $unpacked = unpack('n8', $binary); - return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', $unpacked[1], $unpacked[2], $unpacked[3], $unpacked[4], $unpacked[5], $unpacked[6], $unpacked[7], $unpacked[8]); + if($binary) { + $unpacked = unpack('n8', $binary); + return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', $unpacked[1], $unpacked[2], $unpacked[3], $unpacked[4], $unpacked[5], $unpacked[6], $unpacked[7], $unpacked[8]); + } + return ""; } }