Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
1 | <?php |
||
48 | class ZendclouddocumentserviceDatabase extends Database |
||
49 | { |
||
50 | /** |
||
51 | * Initialize this Database. |
||
52 | * |
||
53 | * @param DatabaseManager $databaseManager The database manager of this instance. |
||
54 | * @param array $parameters An assoc array of initialization params. |
||
55 | * |
||
56 | * @throws InitializationException If an error occurs while |
||
57 | * initializing this Database. |
||
58 | * |
||
59 | * @author David Zülke <[email protected]> |
||
60 | * @since 1.0.5 |
||
61 | */ |
||
62 | public function initialize(DatabaseManager $databaseManager, array $parameters = array()) |
||
89 | |||
90 | /** |
||
91 | * Connect to the database. |
||
92 | * If a default "collection" is configured, this collection will be created. |
||
93 | * |
||
94 | * @throws <b>AgaviDatabaseException</b> If a connection could not be |
||
95 | * created. |
||
96 | * |
||
97 | * @author David Zülke <[email protected]> |
||
98 | * @since 1.0.5 |
||
99 | */ |
||
100 | public function connect() |
||
108 | |||
109 | /** |
||
110 | * Retrieve the underlying implementation used by the adapter. |
||
111 | * |
||
112 | * @return mixed The service implementation. |
||
113 | * |
||
114 | * @author David Zülke <[email protected]> |
||
115 | * @since 1.0.5 |
||
116 | */ |
||
117 | public function getResource() |
||
121 | |||
122 | /** |
||
123 | * Shut down this database connection. |
||
124 | * |
||
125 | * @author David Zülke <[email protected]> |
||
126 | * @since 1.0.5 |
||
127 | */ |
||
128 | public function shutdown() |
||
132 | |||
133 | /** |
||
134 | * List all documents in a collection. |
||
135 | * This is a convenience function using the configured "collection" parameter. |
||
136 | * |
||
137 | * @see Zend_Cloud_DocumentService_Adapter::listDocuments() |
||
138 | * |
||
139 | * @param array $options An array of options. |
||
140 | * |
||
141 | * @return Zend_Cloud_DocumentService_DocumentSet A list of documents. |
||
142 | * |
||
143 | * @author David Zülke <[email protected]> |
||
144 | * @since 1.0.5 |
||
145 | */ |
||
146 | View Code Duplication | public function listDocuments(array $options = null) |
|
154 | |||
155 | /** |
||
156 | * Insert document. |
||
157 | * This is a convenience function using the configured "collection" parameter. |
||
158 | * |
||
159 | * @see Zend_Cloud_DocumentService_Adapter::insertDocument() |
||
160 | * |
||
161 | * @param array|Zend_Cloud_DocumentService_Document $document Document to insert. |
||
162 | * @param array $options An array of options. |
||
163 | * |
||
164 | * @author David Zülke <[email protected]> |
||
165 | * @since 1.0.5 |
||
166 | */ |
||
167 | View Code Duplication | public function insertDocument($document, $options = null) |
|
175 | |||
176 | /** |
||
177 | * Replace document. |
||
178 | * The new document replaces the existing document with the same ID. |
||
179 | * This is a convenience function using the configured "collection" parameter. |
||
180 | * |
||
181 | * @see Zend_Cloud_DocumentService_Adapter::replaceDocument() |
||
182 | * |
||
183 | * @param array|Zend_Cloud_DocumentService_Document $document The document. |
||
184 | * @param array $options An array of options. |
||
185 | * |
||
186 | * @author David Zülke <[email protected]> |
||
187 | * @since 1.0.5 |
||
188 | */ |
||
189 | View Code Duplication | public function replaceDocument($document, $options = null) |
|
197 | |||
198 | /** |
||
199 | * Update document. |
||
200 | * The fields of the existing documents will be updated. |
||
201 | * Fields not specified in the set will be left as-is. |
||
202 | * This is a convenience function using the configured "collection" parameter. |
||
203 | * |
||
204 | * @see Zend_Cloud_DocumentService_Adapter::updateDocument() |
||
205 | * |
||
206 | * @param mixed|Zend_Cloud_DocumentService_Document $documentID The Document ID or an |
||
207 | * instance with updates |
||
208 | * @param array|Zend_Cloud_DocumentService_Document $fieldset The fields to update. |
||
209 | * @param array $options An array of options. |
||
210 | * |
||
211 | * @author David Zülke <[email protected]> |
||
212 | * @since 1.0.5 |
||
213 | */ |
||
214 | public function updateDocument($documentID, $fieldset = null, $options = null) |
||
222 | |||
223 | /** |
||
224 | * Delete document. |
||
225 | * This is a convenience function using the configured "collection" parameter. |
||
226 | * |
||
227 | * @see Zend_Cloud_DocumentService_Adapter::deleteDocument() |
||
228 | * |
||
229 | * @param mixed $documentID ID of the document to delete. |
||
230 | * @param array $options An array of options. |
||
231 | * |
||
232 | * @author David Zülke <[email protected]> |
||
233 | * @since 1.0.5 |
||
234 | */ |
||
235 | View Code Duplication | public function deleteDocument($documentID, $options = null) |
|
243 | |||
244 | /** |
||
245 | * Fetch single document by ID. |
||
246 | * This is a convenience function using the configured "collection" parameter. |
||
247 | * |
||
248 | * @see Zend_Cloud_DocumentService_Adapter::fetchDocument() |
||
249 | * |
||
250 | * @param mixed $documentID ID of the document to fetch. |
||
251 | * @param array $options An array of options. |
||
252 | * |
||
253 | * @return Zend_Cloud_DocumentService_Document The document or bool false. |
||
254 | * |
||
255 | * @author David Zülke <[email protected]> |
||
256 | * @since 1.0.5 |
||
257 | */ |
||
258 | View Code Duplication | public function fetchDocument($documentID, $options = null) |
|
266 | |||
267 | /** |
||
268 | * Query for documents stored in the document service. If a string is given |
||
269 | * as the query, the query string will be passed directly to the service. |
||
270 | * This is a convenience function using the configured "collection" parameter. |
||
271 | * |
||
272 | * @see Zend_Cloud_DocumentService_Adapter::query() |
||
273 | * |
||
274 | * @param Zend_Cloud_DocumentService_Query $query The query to perform. |
||
275 | * @param array $options An array of options. |
||
276 | * |
||
277 | * @return Zend_Cloud_DocumentService_DocumentSet The query result. |
||
278 | * |
||
279 | * @author David Zülke <[email protected]> |
||
280 | * @since 1.0.5 |
||
281 | */ |
||
282 | View Code Duplication | public function query($query, $options = null) |
|
290 | |||
291 | /** |
||
292 | * Create query statement. |
||
293 | * This is a convenience function; unlike the other convenience functions, it |
||
294 | * does not use the configured "collection" parameter, but it included here to |
||
295 | * make the service interface complete. |
||
296 | * |
||
297 | * @see Zend_Cloud_DocumentService_Adapter::select() |
||
298 | * |
||
299 | * @param string $fields The fields to select. |
||
300 | * |
||
301 | * @return Zend_Cloud_DocumentService_Query An initialized query instance. |
||
302 | * |
||
303 | * @author David Zülke <[email protected]> |
||
304 | * @since 1.0.5 |
||
305 | */ |
||
306 | public function select($fields = null) |
||
310 | } |
||
311 |
Scrutinizer analyzes your
composer.json
/composer.lock
file if available to determine the classes, and functions that are defined by your dependencies.It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.