Skip to content

Commit 18a26e9

Browse files
committed
added type hints
1 parent c246f19 commit 18a26e9

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/PhpGenerator/ClassType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ public function getProperties(): array
403403
}
404404

405405

406-
public function getProperty($name): Property
406+
public function getProperty(string $name): Property
407407
{
408408
if (!isset($this->properties[$name])) {
409409
throw new Nette\InvalidArgumentException("Property '$name' not found.");
@@ -447,7 +447,7 @@ public function getMethods(): array
447447
}
448448

449449

450-
public function getMethod($name): Method
450+
public function getMethod(string $name): Method
451451
{
452452
if (!isset($this->methods[$name])) {
453453
throw new Nette\InvalidArgumentException("Method '$name' not found.");

src/PhpGenerator/Closure.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function getUses(): array
6868
}
6969

7070

71-
public function addUse($name): Parameter
71+
public function addUse(string $name): Parameter
7272
{
7373
return $this->uses[] = new Parameter($name);
7474
}

src/PhpGenerator/Method.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ final class Method
3939

4040

4141
/**
42+
* @param string|array $method
4243
* @return static
4344
*/
4445
public static function from($method): self

0 commit comments

Comments
 (0)