1<?php
2
3declare(strict_types=1);
4
5/**
6 * This file is part of phpDocumentor.
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 *
11 * @link      http://phpdoc.org
12 */
13
14namespace phpDocumentor\Reflection\Types;
15
16use phpDocumentor\Reflection\Type;
17
18/**
19 * Value Object representing the '$this' pseudo-type.
20 *
21 * $this, as a Type, represents the instance of the class associated with the element as it was called. $this is
22 * commonly used when documenting fluent interfaces since it represents that the same object is returned.
23 *
24 * @psalm-immutable
25 */
26final class This implements Type
27{
28    /**
29     * Returns a rendered output of the Type as it would be used in a DocBlock.
30     */
31    public function __toString() : string
32    {
33        return '$this';
34    }
35}
36