1 | <?php |
||
18 | class MongoDB |
||
19 | { |
||
20 | |||
21 | const PROFILING_OFF = 0; |
||
22 | const PROFILING_SLOW = 1; |
||
23 | const PROFILING_ON = 2; |
||
24 | const NAMESPACES_COLLECTION = 'system.namespaces'; |
||
25 | const INDEX_COLLECTION = 'system.indexes'; |
||
26 | |||
27 | /** |
||
28 | * @var int |
||
29 | */ |
||
30 | public $w = 1; |
||
31 | |||
32 | /** |
||
33 | * @var int |
||
34 | */ |
||
35 | public $w_timeout = 10000; |
||
36 | |||
37 | /** |
||
38 | * @var string |
||
39 | */ |
||
40 | private $name; |
||
41 | |||
42 | /** |
||
43 | * @var MongoClient |
||
44 | */ |
||
45 | private $client; |
||
46 | |||
47 | /** |
||
48 | * |
||
49 | * @var Manager |
||
50 | */ |
||
51 | private $manager; |
||
52 | |||
53 | /** |
||
54 | * @var array |
||
55 | */ |
||
56 | private $collections = []; |
||
57 | |||
58 | /** |
||
59 | * @var array |
||
60 | */ |
||
61 | private $readPreference; |
||
62 | |||
63 | /** |
||
64 | * Creates a new database |
||
65 | * |
||
66 | * @param MongoClient $client - Database connection. |
||
67 | * @param string $name - Database name. |
||
68 | */ |
||
69 | public function __construct(MongoClient $client, $name) |
||
76 | |||
77 | /** |
||
78 | * Get the read preference for this database |
||
79 | * |
||
80 | * @return array |
||
81 | */ |
||
82 | public function getReadPreference() |
||
86 | |||
87 | /** |
||
88 | * @return MongoClient |
||
89 | */ |
||
90 | public function _getClient() |
||
94 | |||
95 | public function _getFullCollectionName($collectionName) |
||
99 | |||
100 | /** |
||
101 | * Gets a collection |
||
102 | * |
||
103 | * @param string $name - The collection name. |
||
104 | * |
||
105 | * @return MongoCollection - Returns a new collection object. |
||
106 | */ |
||
107 | public function selectCollection($name) |
||
116 | |||
117 | /** |
||
118 | * Execute a database command |
||
119 | * |
||
120 | * @param array $command - The query to send. |
||
|
|||
121 | * @param array $options - This parameter is an associative array of |
||
122 | * the form array("optionname" => boolean, ...). |
||
123 | * |
||
124 | * @return array - Returns database response. |
||
125 | */ |
||
126 | public function command(array $cmd, array $options = []) |
||
142 | |||
143 | /** |
||
144 | * Fetches toolkit for dealing with files stored in this database |
||
145 | * |
||
146 | * @param string $prefix - The prefix for the files and chunks |
||
147 | * collections. |
||
148 | * |
||
149 | * @return MongoGridFS - Returns a new gridfs object for this database. |
||
150 | */ |
||
151 | public function getGridFS($prefix = 'fs') |
||
155 | |||
156 | } |
||
157 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.