Skip to content

Commit cd49f30

Browse files
committed
Merge pull request #15 from kukulich/strict
Minor fixes because of PHP7 strict mode
2 parents 5f5524d + f759fba commit cd49f30

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/PhpGenerator/ClassType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public static function from($from)
101101

102102
public function __construct($name = NULL, PhpNamespace $namespace = NULL)
103103
{
104-
$this->setName($name);
104+
$this->setName((string) $name);
105105
$this->namespace = $namespace;
106106
}
107107

src/PhpGenerator/Method.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public function setVisibility($val)
285285

286286

287287
/**
288-
* @return string
288+
* @return string|NULL
289289
*/
290290
public function getVisibility()
291291
{

src/PhpGenerator/Parameter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public static function from(\ReflectionParameter $from)
6060

6161
$namespace = $from->getDeclaringClass() ? $from->getDeclaringClass()->getNamespaceName() : NULL;
6262
$namespace = $namespace ? "\\$namespace\\" : '\\';
63-
if (Nette\Utils\Strings::startsWith($param->typeHint, $namespace)) {
63+
if ($param->typeHint !== NULL && Nette\Utils\Strings::startsWith($param->typeHint, $namespace)) {
6464
$param->typeHint = substr($param->typeHint, strlen($namespace));
6565
}
6666
return $param;

src/PhpGenerator/PhpNamespace.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class PhpNamespace extends Object
3737

3838
public function __construct($name = NULL)
3939
{
40-
$this->setName($name);
40+
$this->setName((string) $name);
4141
}
4242

4343

0 commit comments

Comments
 (0)