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

PHPDoc::writeProperty()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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
}