File: CustomParam.php

package info (click to toggle)
php-phpdocumentor-reflection-docblock 6.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 1,400 kB
  • sloc: php: 7,960; xml: 113; makefile: 57
file content (42 lines) | stat: -rw-r--r-- 900 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php

declare(strict_types=1);

namespace phpDocumentor\Reflection\Assets;

use phpDocumentor\Reflection\DocBlock\Tag;
use phpDocumentor\Reflection\DocBlock\Tags\Formatter;
use phpDocumentor\Reflection\FqsenResolver;

final class CustomParam implements Tag
{
    /** @var string|null */
    public $myParam;

    /** @var FqsenResolver|null */
    public $fqsenResolver;

    public function getName() : string
    {
        return 'spy';
    }

    public static function create(string $body, FqsenResolver $fqsenResolver = null, ?string $myParam = null)
    {
        $tag = new self();
        $tag->fqsenResolver = $fqsenResolver;
        $tag->myParam = $myParam;

        return $tag;
    }

    public function render(?Formatter $formatter = null) : string
    {
        return $this->getName();
    }

    public function __toString() : string
    {
        return $this->getName();
    }
}