Skip to content

Registry

Handles creating objects and calling methods

Access this via {@see \SimplePie\SimplePie::get_registry()}

  • Full name: \SimplePie\Registry

Properties

default

Default class mapping

protected array<class-string,class-string> $default

Overriding classes must subclass these.


classes

Class mapping

protected array $classes

See Also:

  • \SimplePie\register() -

legacy

Legacy classes

protected class-string[] $legacy

See Also:

  • \SimplePie\register() -

legacyTypes

Legacy types

private array<string,class-string> $legacyTypes

See Also:

  • \SimplePie\register() -

Methods

__construct

Constructor

public __construct(): mixed

No-op


register

Register a class

public register(string $type, class-string $class, bool $legacy = false): bool

Parameters:

Parameter Type Description
$type string See {@see $default} for names
$class class-string Class name, must subclass the corresponding default
$legacy bool Whether to enable legacy support for this class

Return Value:

Successfulness


get_class

Get the class registered for a type

public get_class(class-string<\SimplePie\T> $type): class-string<\SimplePie\T>|null

Where possible, use {@see \SimplePie\create()} or {@see \SimplePie\call()} instead

Parameters:

Parameter Type Description
$type class-string<\SimplePie\T>

create

Create a new instance of a given type

public create(class-string&lt;\SimplePie\T&gt; $type, array $parameters = []): \SimplePie\T

Parameters:

Parameter Type Description
$type class-string<\SimplePie\T>
$parameters array Parameters to pass to the constructor

Return Value:

Instance of class


call

Call a static method for a type

public call(class-string $type, string $method, array $parameters = []): mixed

Parameters:

Parameter Type Description
$type class-string
$method string
$parameters array


Automatically generated on 2025-03-18