Skip to content

Commit 466cd0b

Browse files
committed
fixed phpDoc
1 parent 3f317dc commit 466cd0b

File tree

6 files changed

+36
-4
lines changed

6 files changed

+36
-4
lines changed

src/PhpGenerator/ClassType.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ public static function from($from)
7676
}
7777

7878

79+
/**
80+
* @param string|NULL
81+
*/
7982
public function __construct($name = NULL, PhpNamespace $namespace = NULL)
8083
{
8184
$this->setName($name);
@@ -403,6 +406,7 @@ public function addConst($name, $value)
403406

404407

405408
/**
409+
* @param Constant[]|mixed[]
406410
* @return static
407411
*/
408412
public function setConstants(array $consts)

src/PhpGenerator/Factory.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ class Factory
1717
{
1818
use Nette\SmartObject;
1919

20-
20+
/**
21+
* @return ClassType
22+
*/
2123
public function fromClassReflection(\ReflectionClass $from)
2224
{
2325
if (PHP_VERSION_ID >= 70000 && $from->isAnonymous()) {
@@ -51,6 +53,9 @@ public function fromClassReflection(\ReflectionClass $from)
5153
}
5254

5355

56+
/**
57+
* @return Method
58+
*/
5459
public function fromFunctionReflection(\ReflectionFunctionAbstract $from)
5560
{
5661
$method = new Method($from->isClosure() ? NULL : $from->getName());
@@ -78,6 +83,9 @@ public function fromFunctionReflection(\ReflectionFunctionAbstract $from)
7883
}
7984

8085

86+
/**
87+
* @return Parameter
88+
*/
8189
public function fromParameterReflection(\ReflectionParameter $from)
8290
{
8391
$param = new Parameter($from->getName());
@@ -109,6 +117,9 @@ public function fromParameterReflection(\ReflectionParameter $from)
109117
}
110118

111119

120+
/**
121+
* @return Property
122+
*/
112123
public function fromPropertyReflection(\ReflectionProperty $from)
113124
{
114125
$prop = new Property($from->getName());

src/PhpGenerator/Helpers.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ private static function _dump(&$var, $level = 0)
149149

150150
/**
151151
* Generates PHP statement.
152+
* @param string
152153
* @return string
153154
*/
154155
public static function format($statement, ...$args)
@@ -159,6 +160,7 @@ public static function format($statement, ...$args)
159160

160161
/**
161162
* Generates PHP statement.
163+
* @param string
162164
* @return string
163165
*/
164166
public static function formatArgs($statement, array $args)
@@ -207,6 +209,7 @@ public static function formatMember($name)
207209

208210

209211
/**
212+
* @param string
210213
* @return string
211214
*/
212215
public static function formatDocComment($content)
@@ -222,6 +225,7 @@ public static function formatDocComment($content)
222225

223226

224227
/**
228+
* @param string
225229
* @return string
226230
*/
227231
public static function unformatDocComment($comment)
@@ -239,7 +243,11 @@ public static function isIdentifier($value)
239243
}
240244

241245

242-
/** @internal */
246+
/**
247+
* @param string
248+
* @return object
249+
* @internal
250+
*/
243251
public static function createObject($class, array $props)
244252
{
245253
return unserialize('O' . substr(serialize((string) $class), 1, -1) . substr(serialize($props), 1));

src/PhpGenerator/Method.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/**
1414
* Method or function description.
1515
*
16-
* @property string $body
16+
* @property string|FALSE $body
1717
*/
1818
class Method extends Member
1919
{
@@ -52,6 +52,7 @@ class Method extends Member
5252

5353

5454
/**
55+
* @param \ReflectionFunctionAbstract|callable
5556
* @return static
5657
*/
5758
public static function from($from)
@@ -177,6 +178,7 @@ public function addUse($name)
177178

178179

179180
/**
181+
* @param string|FALSE
180182
* @return static
181183
*/
182184
public function setBody($code, array $args = NULL)
@@ -187,7 +189,7 @@ public function setBody($code, array $args = NULL)
187189

188190

189191
/**
190-
* @return string
192+
* @return string|FALSE
191193
*/
192194
public function getBody()
193195
{
@@ -196,6 +198,7 @@ public function getBody()
196198

197199

198200
/**
201+
* @param string
199202
* @return static
200203
*/
201204
public function addBody($code, array $args = NULL)

src/PhpGenerator/PhpLiteral.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ class PhpLiteral
1717
private $value;
1818

1919

20+
/**
21+
* @param string
22+
*/
2023
public function __construct($value)
2124
{
2225
$this->value = (string) $value;

src/PhpGenerator/PhpNamespace.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ class PhpNamespace
3737
private $classes = [];
3838

3939

40+
/**
41+
* @param string|NULL
42+
*/
4043
public function __construct($name = NULL)
4144
{
4245
$this->setName($name);

0 commit comments

Comments
 (0)