1
|
|
|
<?php |
2
|
|
|
declare(strict_types=1); |
3
|
|
|
|
4
|
|
|
/** |
5
|
|
|
* This file is part of phpDocumentor. |
6
|
|
|
* |
7
|
|
|
* For the full copyright and license information, please view the LICENSE |
8
|
|
|
* file that was distributed with this source code. |
9
|
|
|
* |
10
|
|
|
* @author Mike van Riel <[email protected]> |
11
|
|
|
* @copyright 2010-2018 Mike van Riel / Naenius (http://www.naenius.com) |
12
|
|
|
* @license http://www.opensource.org/licenses/mit-license.php MIT |
13
|
|
|
* @link http://phpdoc.org |
14
|
|
|
*/ |
15
|
|
|
|
16
|
|
|
namespace phpDocumentor\Descriptor\Interfaces; |
17
|
|
|
|
18
|
|
|
use phpDocumentor\Reflection\Type; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* Describes the public interface for a descriptor of an Argument. |
22
|
|
|
*/ |
23
|
|
|
interface ArgumentInterface extends ElementInterface |
24
|
|
|
{ |
25
|
|
|
/** |
26
|
|
|
* Sets a normalized list of types that the argument represents. |
27
|
|
|
* |
28
|
|
|
* Arguments should have one of the types mentioned in this array. If this array is empty than that is considered |
29
|
|
|
* to be the type `mixed` (meaning: can be anything). |
30
|
|
|
* |
31
|
|
|
* Any Type representing a class/interface/trait should be normalized to its complete FQCN, including preceding |
32
|
|
|
* backslash. Types that do not represent a class/interface/trait should be written in lowercaps and should not be |
33
|
|
|
* preceded by a backslash. |
34
|
|
|
* |
35
|
|
|
* @param ?Type $type Type of this agument represented as a reflection type. |
|
|
|
|
36
|
|
|
* |
37
|
|
|
* @link https://github.com/phpDocumentor/phpDocumentor2/blob/develop/docs/PSR.md#appendix-a-types Definition of a |
38
|
|
|
* type. |
39
|
|
|
* |
40
|
|
|
* @todo update link to point to the final destination for the PHPDoc Standard. |
41
|
|
|
*/ |
42
|
|
|
public function setType(?Type $type); |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* Returns a normalized Types. |
46
|
|
|
* |
47
|
|
|
* @see self::setTypes() for details on what types represent. |
48
|
|
|
* |
49
|
|
|
* @return Type|null |
50
|
|
|
*/ |
51
|
|
|
public function getType(): ?Type; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* Sets the default value for an argument expressed as a string. |
55
|
|
|
* |
56
|
|
|
* @param string $value A textual representation of the default value. |
57
|
|
|
*/ |
58
|
|
|
public function setDefault($value); |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* Returns the default value for an argument as string or null if no default is set. |
62
|
|
|
* |
63
|
|
|
* @return string|null A textual representation of the default value, or null if no default value is present. |
64
|
|
|
*/ |
65
|
|
|
public function getDefault(); |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* Sets whether this argument passes its parameter by reference or by value. |
69
|
|
|
* |
70
|
|
|
* @param boolean $byReference True if the parameter is passed by reference, otherwise it is by value. |
71
|
|
|
*/ |
72
|
|
|
public function setByReference($byReference); |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* Returns whether the parameter is passed by reference or by value. |
76
|
|
|
* |
77
|
|
|
* @return boolean True if the parameter is passed by reference, otherwise it is by value. |
78
|
|
|
*/ |
79
|
|
|
public function isByReference(); |
80
|
|
|
} |
81
|
|
|
|
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.