File tree Expand file tree Collapse file tree 5 files changed +8
-12
lines changed Expand file tree Collapse file tree 5 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -289,7 +289,7 @@ public function addMember($member): self
289
289
if ($ this ->type === self ::TYPE_INTERFACE ) {
290
290
$ member ->setBody (null );
291
291
}
292
- $ this ->methods [$ member ->getName ()] = $ member-> setNamespace ( $ this -> namespace ) ;
292
+ $ this ->methods [$ member ->getName ()] = $ member ;
293
293
294
294
} elseif ($ member instanceof Property) {
295
295
$ this ->properties [$ member ->getName ()] = $ member ;
@@ -411,7 +411,7 @@ public function setMethods(array $methods): self
411
411
if (!$ v instanceof Method) {
412
412
throw new Nette \InvalidArgumentException ('Argument must be Nette\PhpGenerator\Method[]. ' );
413
413
}
414
- $ this ->methods [$ v ->getName ()] = $ v-> setNamespace ( $ this -> namespace ) ;
414
+ $ this ->methods [$ v ->getName ()] = $ v ;
415
415
}
416
416
return $ this ;
417
417
}
@@ -437,7 +437,7 @@ public function getMethod(string $name): Method
437
437
438
438
public function addMethod (string $ name ): Method
439
439
{
440
- $ method = ( new Method ($ name))-> setNamespace ( $ this -> namespace );
440
+ $ method = new Method ($ name );
441
441
if ($ this ->type === self ::TYPE_INTERFACE ) {
442
442
$ method ->setBody (null );
443
443
} else {
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ public function fromClassReflection(\ReflectionClass $from): ClassType
50
50
$ class ->setProperties ($ props );
51
51
foreach ($ from ->getMethods () as $ method ) {
52
52
if ($ method ->getDeclaringClass ()->getName () === $ from ->getName ()) {
53
- $ methods [] = $ this ->fromMethodReflection ($ method )-> setNamespace ( $ class -> getNamespace ()) ;
53
+ $ methods [] = $ this ->fromMethodReflection ($ method );
54
54
}
55
55
}
56
56
$ class ->setMethods ($ methods );
Original file line number Diff line number Diff line change @@ -35,6 +35,6 @@ public static function from(string $function): self
35
35
36
36
public function __toString (): string
37
37
{
38
- return (new Printer )->printFunction ($ this , $ this -> namespace );
38
+ return (new Printer )->printFunction ($ this );
39
39
}
40
40
}
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ public static function from($method): self
50
50
51
51
public function __toString (): string
52
52
{
53
- return (new Printer )->printMethod ($ this , $ this -> namespace );
53
+ return (new Printer )->printMethod ($ this );
54
54
}
55
55
56
56
Original file line number Diff line number Diff line change 12
12
use Nette ;
13
13
use Nette \PhpGenerator \Helpers ;
14
14
use Nette \PhpGenerator \Parameter ;
15
- use Nette \PhpGenerator \PhpNamespace ;
16
15
17
16
18
17
/**
@@ -38,9 +37,6 @@ trait FunctionLike
38
37
/** @var bool */
39
38
private $ returnNullable = false ;
40
39
41
- /** @var PhpNamespace|null */
42
- private $ namespace ;
43
-
44
40
45
41
/**
46
42
* @return static
@@ -183,11 +179,11 @@ public function getReturnNullable(): bool
183
179
184
180
185
181
/**
186
- * @return static
182
+ * @deprecated
187
183
*/
188
184
public function setNamespace (PhpNamespace $ val = null ): self
189
185
{
190
- $ this -> namespace = $ val ;
186
+ trigger_error ( __METHOD__ . ' () is deprecated ' , E_USER_DEPRECATED ) ;
191
187
return $ this ;
192
188
}
193
189
}
You can’t perform that action at this time.
0 commit comments