Documentator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 3
dl 0
loc 42
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A document() 0 5 1
1
<?php
2
namespace DicDoc;
3
4
/**
5
 * Class Documentator
6
 *
7
 * @package DicDoc
8
 */
9
class Documentator
10
{
11
12
    /**
13
     * @var Interfaces\ParameterDocumentator
14
     */
15
    private $parameterCommentGenerator;
16
17
    /**
18
     * @var Interfaces\TextFileManipulator
19
     */
20
    private $commentAppender;
21
22
23
    /**
24
     * Documentator constructor.
25
     *
26
     * @param Interfaces\TextFileManipulator   $commentAppender
27
     * @param Interfaces\ParameterDocumentator $parameterCommentGenerator
28
     */
29
    public function __construct(
30
        Interfaces\TextFileManipulator $commentAppender,
31
        Interfaces\ParameterDocumentator $parameterCommentGenerator
32
    ) {
33
34
35
        $this->commentAppender = $commentAppender;
36
        $this->parameterCommentGenerator = $parameterCommentGenerator;
37
    }
38
39
    /**
40
     * @param ParameterInformation $parameterInformation
41
     * @param CallerPosition       $callerData
42
     * @param                      $offset
43
     */
44
    public function document(ParameterInformation $parameterInformation, CallerPosition $callerData, $offset)
45
    {
46
        $docBlock = $this->parameterCommentGenerator->docBlock($parameterInformation);
47
        $this->commentAppender->insertComment($callerData->getFile(), $docBlock, $callerData->getLine() + $offset);
48
    }
49
50
}