GravityKit\GravityMigrate\Platforms\PlatformRegistry
Finds the definition for a platform, by canonical id or by any slug it answers to.
Since: %ver%
Source: src/Platforms/PlatformRegistry.php:24
Details
- Kind:
class - Namespace:
GravityKit\GravityMigrate\Platforms
Methods
| Method | Description |
|---|---|
for_platform() | Returns the definition for a platform id or registry slug. |
absent_symbols() | Which of these symbols are not defined on this site. |
all() | Every definition, keyed by its canonical platform id. |
Method Reference
for_platform()
public static function for_platform( string $platform )
Returns the definition for a platform id or registry slug.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$platform | string | Canonical id or registry slug. |
Returns
string|null— The definition class name, or null when nothing answers to it.
Since: %ver%
Source: src/Platforms/PlatformRegistry.php:53
absent_symbols()
public static function absent_symbols( array $names ): array
Which of these symbols are not defined on this site.
A platform states its requirements as class, interface or function names, and the answer to "is this platform available" is whether this list comes back empty. Returned rather than reduced to a boolean because the names are the only thing that can tell an operator WHY a destination is unavailable, and a CLI has no screen to click through to.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$names | string[] | Class, interface or function names. |
Returns
string[]— The names that resolve to nothing, in the order they were given.
Since: %ver%
Source: src/Platforms/PlatformRegistry.php:77
all()
public static function all(): array
Every definition, keyed by its canonical platform id.
Returns
array<string,— string>
Since: %ver%
Source: src/Platforms/PlatformRegistry.php:95