webberzone.dev Recent

GitHub class Pro only

GitHub

GitHub integration class.

Bootstraps all GitHub sub-components.

Namespace: WebberZone\Knowledge_Base\Pro\GitHub
Since: 3.1.0
Source: includes/github/class-github.php line 23

Methods

get_enabled_mappings() static

Return all non-disabled repository mappings with a valid owner and repo name.

Indices from the saved option are preserved so callers can round-trip a mapping back by index (used by the import/export wizard two-phase flows).

Since: 3.1.0
Line: 103

static public function get_enabled_mappings( bool $push_only = ..., bool $pat_required = ... ): array;
TypeNameDescription
bool$push_onlyWhen true, also requires enable_push to be set.
bool$pat_requiredWhen true, skips mappings with no effective PAT (neither per-mapping nor global).

Returns: array — Keyed by original settings index.

get_wizard_mappings() static

Return mappings eligible to appear in an admin wizard dropdown.

Always requires a usable PAT (per-mapping or global) and a non-disabled status. Pass true for $push_only on the export wizard.

Since: 3.1.0
Line: 152

static public function get_wizard_mappings( bool $push_only = ... ): array;
TypeNameDescription
bool$push_onlyWhen true, also requires enable_push to be set.

Returns: array — Keyed by original settings index.

render_mapping_select() static

Render the Repository Mapping .

Returns: void

select_mappings() static

Resolve a mapping selector to a subset of the provided mappings array.

Since: 3.1.0
Line: 190

static public function select_mappings( string $value, array $mappings ): array<int,array<string,mixed>>|\WP_Error;
TypeNameDescription
string$value’all’ or a numeric index string.
array<int,array<string,mixed>>$mappingsFull enabled-mappings array.

Returns: array<int,array<string,mixed>>|\WP_Error — Selected mappings, or WP_Error on bad input.

normalize_mapping() static

Normalize a repository mapping row to a flat array.

Settings-based rows are stored by the repeater sanitizer as: array( ‘row_id’ => ’…’, ‘fields’ => array( ‘repo_owner’ => ’…’, … ) )

This method ensures all downstream code can access fields directly (e.g. $mapping[‘repo_owner’]) regardless of how the row was stored.

Since: 3.1.0
Line: 218

static public function normalize_mapping( array $row ): array;
TypeNameDescription
array<string,mixed>$rowRaw mapping row.

Returns: array — Flat mapping array.

mapping_label() static

Get a human-readable label for a repository mapping.

Since: 3.1.0
Line: 246

static public function mapping_label( array $mapping ): string;
TypeNameDescription
array<string,mixed>$mappingRepository mapping.

Returns: string — Mapping label.

__construct()

Constructor.

Since: 3.1.0
Line: 264

public function __construct(  );