Skip to content

Commit 6a3d9cf

Browse files
committed
added type hints
1 parent 5fd39fb commit 6a3d9cf

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
@@ -357,7 +357,7 @@ public function getProperties(): array
357357
}
358358

359359

360-
public function getProperty($name): Property
360+
public function getProperty(string $name): Property
361361
{
362362
if (!isset($this->properties[$name])) {
363363
throw new Nette\InvalidArgumentException("Property '$name' not found.");
@@ -401,7 +401,7 @@ public function getMethods(): array
401401
}
402402

403403

404-
public function getMethod($name): Method
404+
public function getMethod(string $name): Method
405405
{
406406
if (!isset($this->methods[$name])) {
407407
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)