@@ -81,65 +81,24 @@ public function __construct(?string $name = null, ?PhpNamespace $namespace = nul
81
81
}
82
82
83
83
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
-
93
84
public function isClass (): bool
94
85
{
95
86
return $ this ->type === self ::TYPE_CLASS ;
96
87
}
97
88
98
89
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
-
108
90
public function isInterface (): bool
109
91
{
110
92
return $ this ->type === self ::TYPE_INTERFACE ;
111
93
}
112
94
113
95
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
-
123
96
public function isTrait (): bool
124
97
{
125
98
return $ this ->type === self ::TYPE_TRAIT ;
126
99
}
127
100
128
101
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
-
143
102
/** @deprecated */
144
103
public function getType (): string
145
104
{
0 commit comments