This repository was archived by the owner on Mar 6, 2022. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathMethod.php
More file actions
110 lines (91 loc) · 2.13 KB
/
Copy pathMethod.php
File metadata and controls
110 lines (91 loc) · 2.13 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
namespace Phpactor\CodeBuilder\Domain\Prototype;
final class Method extends Prototype
{
const IS_STATIC = 1;
const IS_ABSTRACT = 2;
/**
* @var string
*/
private $name;
/**
* @var Visibility
*/
private $visibility;
/**
* @var Parameters
*/
private $parameters;
/**
* @var ReturnType
*/
private $returnType;
/*
* @var Docblock
*/
private $docblock;
/**
* @var bool
*/
private $isStatic;
/**
* @var bool
*/
private $isAbstract;
/**
* @var MethodBody
*/
private $methodBody;
public function __construct(
string $name,
Visibility $visibility = null,
Parameters $parameters = null,
ReturnType $returnType = null,
Docblock $docblock = null,
int $modifierFlags = 0,
MethodBody $methodBody = null,
UpdatePolicy $updatePolicy = null
) {
parent::__construct($updatePolicy);
$this->name = $name;
$this->visibility = $visibility ?: Visibility::public();
$this->parameters = $parameters ?: Parameters::empty();
$this->returnType = $returnType ?: ReturnType::none();
$this->docblock = $docblock ?: Docblock::none();
$this->isStatic = $modifierFlags & self::IS_STATIC;
$this->isAbstract = $modifierFlags & self::IS_ABSTRACT;
$this->methodBody = $methodBody ?: MethodBody::empty();
}
public function name(): string
{
return $this->name;
}
public function visibility(): Visibility
{
return $this->visibility;
}
public function parameters(): Parameters
{
return $this->parameters;
}
public function returnType(): ReturnType
{
return $this->returnType;
}
public function docblock(): Docblock
{
return $this->docblock;
}
public function isStatic(): bool
{
return $this->isStatic;
}
public function isAbstract(): bool
{
return $this->isAbstract;
}
public function body(): MethodBody
{
return $this->methodBody;
}
}