@@ -81,65 +81,24 @@ public function __construct(?string $name = null, ?PhpNamespace $namespace = nul
8181 }
8282
8383
84- /** @deprecated */
85- public function setClass (): static
86- {
87- trigger_error (__METHOD__ . '() is deprecated. ' , E_USER_DEPRECATED );
88- $ this ->type = self ::TYPE_CLASS ;
89- return $ this ;
90- }
91-
92-
9384 public function isClass (): bool
9485 {
9586 return $ this ->type === self ::TYPE_CLASS ;
9687 }
9788
9889
99- /** @deprecated create object using 'new Nette\PhpGenerator\InterfaceType' */
100- public function setInterface (): static
101- {
102- trigger_error (__METHOD__ . "() is deprecated, create object using 'new Nette \\PhpGenerator \\InterfaceType' " , E_USER_DEPRECATED );
103- $ this ->type = self ::TYPE_INTERFACE ;
104- return $ this ;
105- }
106-
107-
10890 public function isInterface (): bool
10991 {
11092 return $ this ->type === self ::TYPE_INTERFACE ;
11193 }
11294
11395
114- /** @deprecated create object using 'new Nette\PhpGenerator\TraitType' */
115- public function setTrait (): static
116- {
117- trigger_error (__METHOD__ . "() is deprecated, create object using 'new Nette \\PhpGenerator \\TraitType' " , E_USER_DEPRECATED );
118- $ this ->type = self ::TYPE_TRAIT ;
119- return $ this ;
120- }
121-
122-
12396 public function isTrait (): bool
12497 {
12598 return $ this ->type === self ::TYPE_TRAIT ;
12699 }
127100
128101
129- /** @deprecated create object using 'new Nette\PhpGenerator\InterfaceType' or 'TraitType' */
130- public function setType (string $ type ): static
131- {
132- $ upper = ucfirst ($ type );
133- trigger_error (__METHOD__ . "() is deprecated, create object using 'new Nette \\PhpGenerator \\{$ upper }Type' " , E_USER_DEPRECATED );
134- if (!in_array ($ type , [self ::TYPE_CLASS , self ::TYPE_INTERFACE , self ::TYPE_TRAIT ], true )) {
135- throw new Nette \InvalidArgumentException ('Argument must be class|interface|trait. ' );
136- }
137-
138- $ this ->type = $ type ;
139- return $ this ;
140- }
141-
142-
143102 /** @deprecated */
144103 public function getType (): string
145104 {
0 commit comments