slug = $slug; $this->resource = $resource; $this->options = $options; } /** * Prepares an associative array for JSON encoding. * * @return array The JSON-encoded array representing this installation step. */ public function prepare_json_array(): array { return array( 'step' => static::get_step_name(), 'themeData' => array( 'resource' => $this->resource, 'slug' => $this->slug, ), 'options' => $this->options, ); } /** * Returns the schema for the JSON representation of this step. * * @param int $version The version of the schema to return. * @return array The schema array. */ public static function get_schema( int $version = 1 ): array { return array( 'type' => 'object', 'properties' => array( 'step' => array( 'type' => 'string', 'enum' => array( static::get_step_name() ), ), 'themeData' => array( 'anyOf' => array( require __DIR__ . '/schemas/definitions/VFSReference.php', require __DIR__ . '/schemas/definitions/LiteralReference.php', require __DIR__ . '/schemas/definitions/CorePluginReference.php', require __DIR__ . '/schemas/definitions/CoreThemeReference.php', require __DIR__ . '/schemas/definitions/UrlReference.php', require __DIR__ . '/schemas/definitions/GitDirectoryReference.php', require __DIR__ . '/schemas/definitions/DirectoryLiteralReference.php', ), ), 'options' => array( 'type' => 'object', 'properties' => array( 'activate' => array( 'type' => 'boolean', ), ), ), ), 'required' => array( 'step', 'themeData' ), ); } /** * Returns the name of this step. * * @return string The step name. */ public static function get_step_name(): string { return 'installTheme'; } }