From 88e3b14f8bde37969adf077eea82668a2b799f67 Mon Sep 17 00:00:00 2001 From: ZhiFeng Hu Date: Fri, 24 Jul 2015 09:17:39 +0800 Subject: [PATCH] Strict check BucketManager, typo fixes --- src/Qiniu/Storage/BucketManager.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Qiniu/Storage/BucketManager.php b/src/Qiniu/Storage/BucketManager.php index c8e91df4..dcf0930b 100644 --- a/src/Qiniu/Storage/BucketManager.php +++ b/src/Qiniu/Storage/BucketManager.php @@ -27,7 +27,7 @@ public function __construct(Auth $auth) */ public function buckets() { - return $this->rsget('/buckets'); + return $this->rsGet('/buckets'); } /** @@ -67,10 +67,10 @@ public function listFiles($bucket, $prefix = null, $marker = null, $limit = 1000 } $url = Config::RSF_HOST . '/list?' . http_build_query($query); list($ret, $error) = $this->get($url); - if ($ret == null) { + if ($ret === null) { return array(null, null, $error); } - $marker = isset($ret['marker']) ? $ret['marker'] : null; + $marker = array_key_exists('marker', $ret) ? $ret['marker'] : null; return array($ret['items'], $marker, null); } @@ -291,7 +291,7 @@ private function post($url, $body) if (!$ret->ok()) { return array(null, new Error($url, $ret)); } - $r = $ret->body == null ? array() : $ret->json(); + $r = ($ret->body === null) ? array() : $ret->json(); return array($r, null); } @@ -335,7 +335,7 @@ private static function oneKeyBatch($operation, $bucket, $keys) private static function twoKeyBatch($operation, $source_bucket, $key_pairs, $target_bucket) { - if ($target_bucket == null) { + if ($target_bucket === null) { $target_bucket = $source_bucket; } $data = array();