protected function parse_extra_headers( $header, $headers, $header_parts, $repo_parts ) {
		$hosted_domains = [ 'github.com', 'bitbucket.org', 'gitlab.com' ];
		$theme          = null;

		$header['enterprise_uri'] = null;
		$header['enterprise_api'] = null;
		$header['languages']      = null;
		$header['ci_job']         = false;
		$header['release_asset']  = false;

		if ( ! empty( $header['host'] ) && ! in_array( $header['host'], $hosted_domains, true ) ) {
			$header['enterprise_uri'] = $header['base_uri'];
			$header['enterprise_api'] = trim( $header['enterprise_uri'], '/' );
			switch ( $header_parts[0] ) {
				case 'GitHub':
					$header['enterprise_api'] .= '/api/v3';
					break;
				case 'GitLab':
					$header['enterprise_api'] .= '/api/v4';
					break;
				case 'Bitbucket':
					$header['enterprise_api'] .= '/rest/api';
					break;
			}
		}

		if ( $headers instanceof \WP_Theme ) {
			$theme                    = $headers;
			$headers                  = [];
			$headers['Release Asset'] = '';
			$header['release_asset']  = 'true' === $theme->get( 'Release Asset' );
		}

		$self_hosted_parts = array_keys( self::$extra_repo_headers );
		foreach ( $self_hosted_parts as $part ) {
			if ( $theme instanceof \WP_Theme ) {
				$headers[ $repo_parts[ $part ] ] = $theme->get( $repo_parts[ $part ] );
			}
			if ( array_key_exists( $repo_parts[ $part ], $headers ) &&
				! empty( $headers[ $repo_parts[ $part ] ] )
			) {
				switch ( $part ) {
					case 'Languages':
						$header['languages'] = $headers[ $repo_parts[ $part ] ];
						break;
					case 'CIJob':
						$header['ci_job'] = $headers[ $repo_parts[ $part ] ];
						break;
				}
			}
		}
		$header['release_asset'] = ! $header['release_asset'] && isset( $headers['Release Asset'] ) ? 'true' === $headers['Release Asset'] : $header['release_asset'];

		return $header;
	}
protected function parse_extra_headers( $header, $headers, $header_parts, $repo_parts ) {
		$hosted_domains = [ 'github.com', 'bitbucket.org', 'gitlab.com' ];
		$theme          = null;

		$header['enterprise_uri'] = null;
		$header['enterprise_api'] = null;
		$header['languages']      = null;
		$header['ci_job']         = false;
		$header['release_asset']  = false;

		if ( ! empty( $header['host'] ) && ! in_array( $header['host'], $hosted_domains, true ) ) {
			$header['enterprise_uri'] = $header['base_uri'];
			$header['enterprise_api'] = trim( $header['enterprise_uri'], '/' );
			switch ( $header_parts[0] ) {
				case 'GitHub':
					$header['enterprise_api'] .= '/api/v3';
					break;
				case 'GitLab':
					$header['enterprise_api'] .= '/api/v4';
					break;
				case 'Bitbucket':
					$header['enterprise_api'] .= '/rest/api';
					break;
			}
		}

		if ( $headers instanceof \WP_Theme ) {
			$theme                    = $headers;
			$headers                  = [];
			$headers['Release Asset'] = '';
			$header['release_asset']  = 'true' === $theme->get( 'Release Asset' );
		}

		$self_hosted_parts = array_keys( self::$extra_repo_headers );
		foreach ( $self_hosted_parts as $part ) {
			if ( $theme instanceof \WP_Theme ) {
				$headers[ $repo_parts[ $part ] ] = $theme->get( $repo_parts[ $part ] );
			}
			if ( array_key_exists( $repo_parts[ $part ], $headers ) &&
				! empty( $headers[ $repo_parts[ $part ] ] )
			) {
				switch ( $part ) {
					case 'Languages':
						$header['languages'] = $headers[ $repo_parts[ $part ] ];
						break;
					case 'CIJob':
						$header['ci_job'] = $headers[ $repo_parts[ $part ] ];
						break;
				}
			}
		}
		$header['release_asset'] = ! $header['release_asset'] && isset( $headers['Release Asset'] ) ? 'true' === $headers['Release Asset'] : $header['release_asset'];

		return $header;
	}
protected function parse_extra_headers ( $ header , $ headers , $ header_parts , $ repo_parts ) { $ hosted_domains = [ 'github.com' , 'bitbucket.org' , 'gitlab.com' ] ; $ theme = null ; $ header [ 'enterprise_uri' ] = null ; $ header [ 'enterprise_api' ] = null ; $ header [ 'languages' ] = null ; $ header [ 'ci_job' ] = false ; $ header [ 'release_asset' ] = false ; if ( ! empty ( $ header [ 'host' ] ) && ! in_array ( $ header [ 'host' ] , $ hosted_domains , true ) ) { $ header [ 'enterprise_uri' ] = $ header [ 'base_uri' ] ; $ header [ 'enterprise_api' ] = trim ( $ header [ 'enterprise_uri' ] , '/' ) ; switch ( $ header_parts [ 0 ] ) { case 'GitHub' : $ header [ 'enterprise_api' ] .= '/api/v3' ; break ; case 'GitLab' : $ header [ 'enterprise_api' ] .= '/api/v4' ; break ; case 'Bitbucket' : $ header [ 'enterprise_api' ] .= '/rest/api' ; break ; } } if ( $ headers instanceof \ WP_Theme ) { $ theme = $ headers ; $ headers = [ ] ; $ headers [ 'Release Asset' ] = '' ; $ header [ 'release_asset' ] = 'true' === $ theme -> get ( 'Release Asset' ) ; } $ self_hosted_parts = array_keys ( self :: $ extra_repo_headers ) ; foreach ( $ self_hosted_parts as $ part ) { if ( $ theme instanceof \ WP_Theme ) { $ headers [ $ repo_parts [ $ part ] ] = $ theme -> get ( $ repo_parts [ $ part ] ) ; } if ( array_key_exists ( $ repo_parts [ $ part ] , $ headers ) && ! empty ( $ headers [ $ repo_parts [ $ part ] ] ) ) { switch ( $ part ) { case 'Languages' : $ header [ 'languages' ] = $ headers [ $ repo_parts [ $ part ] ] ; break ; case 'CIJob' : $ header [ 'ci_job' ] = $ headers [ $ repo_parts [ $ part ] ] ; break ; } } } $ header [ 'release_asset' ] = ! $ header [ 'release_asset' ] && isset ( $ headers [ 'Release Asset' ] ) ? 'true' === $ headers [ 'Release Asset' ] : $ header [ 'release_asset' ] ; return $ header ; }
Parse Enterprise, Languages, Release Asset, and CI Job headers for plugins and themes.

@param array           $header
@param array|\WP_Theme $headers
@param array           $header_parts
@param array           $repo_parts

@return array $header
Parse Enterprise Languages Release Asset and CI Job headers for plugins and themes .