StubRelatedDocumentExtension   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 38
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A updateRelatedDocuments() 0 5 1
A updateDocuments() 0 5 1
A getFakeDocument() 0 6 1
1
<?php
2
3
/**
4
 * Class StubRelatedDocumentExtension
5
 *
6
 * @package dms
7
 */
8
class StubRelatedDocumentExtension extends DataExtension implements TestOnly
9
{
10
    /**
11
     * For method {@link DMSDocument::getRelatedDocuments}
12
     *
13
     * @param  ArrayList $relatedDocuments
14
     * @return ArrayList
15
     */
16
    public function updateRelatedDocuments($relatedDocuments)
17
    {
18
        $relatedDocuments->push($this->getFakeDocument());
19
        return $relatedDocuments;
20
    }
21
22
    /**
23
     * For method {@link DMSDocumentSet::getDocuments}
24
     *
25
     * @param  ArrayList $relatedDocuments
0 ignored issues
show
Documentation introduced by
There is no parameter named $relatedDocuments. Did you maybe mean $documents?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
26
     * @return ArrayList
27
     */
28
    public function updateDocuments($documents)
29
    {
30
        $documents->push($this->getFakeDocument());
31
        return $documents;
32
    }
33
34
    /**
35
     * Return a dummy document for testing purposes
36
     *
37
     * @return DMSDocument
38
     */
39
    protected function getFakeDocument()
40
    {
41
        $fakeDocument = new DMSDocument;
42
        $fakeDocument->Filename = 'Extended';
43
        return $fakeDocument;
44
    }
45
}
46