Passed
Push — master ( d3a94c...76e109 )
by Valentin
05:50
created

PHPDoc   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A writeInheritdoc() 0 10 1
A writeProperty() 0 4 1
A makeComment() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Cycle\ORM\Promise;
5
6
use PhpParser\Comment\Doc;
7
8
class PHPDoc
9
{
10
    public static function writeInheritdoc(): Doc
11
    {
12
        $lines = [
13
            "/**",
14
            " * {@inheritdoc}",
15
            " */"
16
        ];
17
18
        return self::makeComment(join("\n", $lines));
19
    }
20
21
    public static function writeProperty(string $type): Doc
22
    {
23
        return self::makeComment("/** @var $type */");
24
    }
25
26
    private static function makeComment(string $comment): Doc
27
    {
28
        return new Doc($comment);
29
    }
30
}