Lines Matching defs:type

146      * @param string $type See {@see $default} for names
151 public function register($type, $class, $legacy = false)
153 if (array_key_exists($type, $this->legacyTypes)) {
154 // trigger_error(sprintf('"%s"(): Using argument #1 ($type) with value "%s" is deprecated since SimplePie 1.8.0, use class-string "%s" instead.', __METHOD__, $type, $this->legacyTypes[$type]), \E_USER_DEPRECATED);
156 $type = $this->legacyTypes[$type];
159 if (! array_key_exists($type, $this->default)) {
168 $base_class = $this->default[$type];
174 $this->classes[$type] = $class;
184 * Get the class registered for a type
189 * @param class-string<T> $type
192 public function get_class($type)
194 if (array_key_exists($type, $this->legacyTypes)) {
195 // trigger_error(sprintf('"%s"(): Using argument #1 ($type) with value "%s" is deprecated since SimplePie 1.8.0, use class-string "%s" instead.', __METHOD__, $type, $this->legacyTypes[$type]), \E_USER_DEPRECATED);
197 $type = $this->legacyTypes[$type];
200 if (! array_key_exists($type, $this->default)) {
204 $class = $this->default[$type];
206 if (array_key_exists($type, $this->classes)) {
207 $class = $this->classes[$type];
214 * Create a new instance of a given type
216 * @template T class-string $type
217 * @param class-string<T> $type
221 public function &create($type, $parameters = [])
223 $class = $this->get_class($type);
242 * Call a static method for a type
244 * @param class-string $type
249 public function &call($type, $method, $parameters = [])
251 $class = $this->get_class($type);
254 switch ($type) {