فهرست منبع

Fix a bunch of Scrutinizer issues

Andreas Braun 10 سال پیش
والد
کامیت
f545ce19e9

+ 2 - 2
lib/Alcaeus/MongoDbAdapter/AbstractCursor.php

@@ -52,7 +52,7 @@ abstract class AbstractCursor
     protected $db;
 
     /**
-     * @var \IteratorIterator
+     * @var \Iterator
      */
     protected $iterator;
 
@@ -260,7 +260,7 @@ abstract class AbstractCursor
     }
 
     /**
-     * @return \Generator
+     * @return \Iterator
      */
     protected function ensureIterator()
     {

+ 2 - 3
lib/Alcaeus/MongoDbAdapter/Helper/WriteConcern.php

@@ -68,9 +68,8 @@ trait WriteConcern
      */
     protected function setWriteConcernFromArray($writeConcernArray)
     {
-        $wstring = $writeConcernArray['w'];
-        $wtimeout = isset($writeConcernArray['wtimeout']) ? $writeConcernArray['wtimeout'] : 0;
+        $this->writeConcern = $this->createWriteConcernFromArray($writeConcernArray);
 
-        return $this->setWriteConcernFromParameters($wstring, $wtimeout);
+        return true;
     }
 }

+ 1 - 1
lib/Alcaeus/MongoDbAdapter/TypeConverter.php

@@ -143,7 +143,7 @@ class TypeConverter
      * Converts all arrays with non-numeric keys to stdClass
      *
      * @param array $array
-     * @return Model\BSONArray|Model\BSONDocument
+     * @return array|Model\BSONArray|Model\BSONDocument
      */
     private static function ensureCorrectType(array $array)
     {

+ 0 - 1
lib/Mongo/MongoBinData.php

@@ -81,7 +81,6 @@ class MongoBinData implements TypeInterface
      * @link http://php.net/manual/en/mongobindata.construct.php
      * @param string $data Binary data
      * @param int $type Data type
-     * @return MongoBinData Returns a new binary data object
      */
     public function __construct($data, $type = 2)
     {

+ 1 - 1
lib/Mongo/MongoClient.php

@@ -165,7 +165,7 @@ class MongoClient
      *
      * @return array
      */
-    static public function getConnections()
+    public static function getConnections()
     {
         return [];
     }

+ 0 - 1
lib/Mongo/MongoCollection.php

@@ -52,7 +52,6 @@ class MongoCollection
      * @param MongoDB $db Parent database.
      * @param string $name Name for this collection.
      * @throws Exception
-     * @return MongoCollection
      */
     public function __construct(MongoDB $db, $name)
     {