Skip to content

Commit bb8439b

Browse files
committed
fixes in type casts
1 parent 211974c commit bb8439b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/PhpGenerator/ClassType.php

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

104104
public function __construct($name = NULL, PhpNamespace $namespace = NULL)
105105
{
106-
$this->name = $name;
106+
$this->setName($name);
107107
$this->namespace = $namespace;
108108
}
109109

src/PhpGenerator/Helpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public static function createObject($class, array $props)
215215
*/
216216
public static function extractNamespace($name)
217217
{
218-
return ($pos = strrpos($name, '\\')) ? substr($name, 0, $pos) : NULL;
218+
return ($pos = strrpos($name, '\\')) ? substr($name, 0, $pos) : '';
219219
}
220220

221221

src/PhpGenerator/PhpNamespace.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class PhpNamespace extends Object
3939

4040
public function __construct($name = NULL)
4141
{
42-
$this->name = $name;
42+
$this->setName($name);
4343
}
4444

4545

@@ -58,7 +58,7 @@ public function getName()
5858
*/
5959
public function setName($name)
6060
{
61-
$this->name = $name;
61+
$this->name = (string) $name;
6262
return $this;
6363
}
6464

0 commit comments

Comments
 (0)