public function add_endpoints( $git, $endpoint ) {
		switch ( self::$method ) {
			case 'meta':
			case 'translation':
			case 'branches':
				break;
			case 'file':
			case 'readme':
				$endpoint = add_query_arg( 'at', $git->type->branch, $endpoint );
				break;
			case 'changes':
				$endpoint = add_query_arg(
					[
						'at'  => $git->type->branch,
						'raw' => '',
					],
					$endpoint
				);
				break;
			case 'tags':
			case 'download_link':
				/*
				 * Add a prefix query argument to create a subdirectory with the same name
				 * as the repo, e.g. 'my-repo' becomes 'my-repo/'
				 * Required for using stash-archive.
				 */
				$defaults = [
					'prefix' => $git->type->slug . '/',
					'at'     => $git->type->branch,
					'format' => 'zip',
				];
				$endpoint = add_query_arg( $defaults, $endpoint );
				if ( ! empty( $git->type->tags ) ) {
					$endpoint = urldecode( add_query_arg( 'at', $git->type->newest_tag, $endpoint ) );
				}
				break;
			default:
				break;
		}

		return $endpoint;
	}
public function add_endpoints( $git, $endpoint ) {
		switch ( self::$method ) {
			case 'meta':
			case 'translation':
			case 'branches':
				break;
			case 'file':
			case 'readme':
				$endpoint = add_query_arg( 'at', $git->type->branch, $endpoint );
				break;
			case 'changes':
				$endpoint = add_query_arg(
					[
						'at'  => $git->type->branch,
						'raw' => '',
					],
					$endpoint
				);
				break;
			case 'tags':
			case 'download_link':
				/*
				 * Add a prefix query argument to create a subdirectory with the same name
				 * as the repo, e.g. 'my-repo' becomes 'my-repo/'
				 * Required for using stash-archive.
				 */
				$defaults = [
					'prefix' => $git->type->slug . '/',
					'at'     => $git->type->branch,
					'format' => 'zip',
				];
				$endpoint = add_query_arg( $defaults, $endpoint );
				if ( ! empty( $git->type->tags ) ) {
					$endpoint = urldecode( add_query_arg( 'at', $git->type->newest_tag, $endpoint ) );
				}
				break;
			default:
				break;
		}

		return $endpoint;
	}
public function add_endpoints ( $ git , $ endpoint ) { switch ( self :: $ method ) { case 'meta' : case 'translation' : case 'branches' : break ; case 'file' : case 'readme' : $ endpoint = add_query_arg ( 'at' , $ git -> type -> branch , $ endpoint ) ; break ; case 'changes' : $ endpoint = add_query_arg ( [ 'at' => $ git -> type -> branch , 'raw' => '' , ] , $ endpoint ) ; break ; case 'tags' : case 'download_link' : /*
				 * Add a prefix query argument to create a subdirectory with the same name
				 * as the repo, e.g. 'my-repo' becomes 'my-repo/'
				 * Required for using stash-archive.
				 */ $ defaults = [ 'prefix' => $ git -> type -> slug . '/' , 'at' => $ git -> type -> branch , 'format' => 'zip' , ] ; $ endpoint = add_query_arg ( $ defaults , $ endpoint ) ; if ( ! empty ( $ git -> type -> tags ) ) { $ endpoint = urldecode ( add_query_arg ( 'at' , $ git -> type -> newest_tag , $ endpoint ) ) ; } break ; default : break ; } return $ endpoint ; }
Create Bitbucket Server API endpoints.

@param Bitbucket_Server_API|API $git
@param string                   $endpoint

@return string $endpoint
Create Bitbucket Server API endpoints .