hcelebi/gitlab-php-client

There is no license information available for the latest version (dev-master) of this package.

PHP Client For GitLab API

dev-master 2022-06-28 13:08 UTC

This package is not auto-updated.

Last update: 2024-05-29 21:11:11 UTC


README

Installation

The prefered way to install this client

php composer.phar require hcelebi/gitlab-php-client

or

composer require hcelebi/gitlab-php-client

Configuration

Dependency injection is exist in project, add these factories to configuration.

GitLabClientFactory.php
BranchServiceFactory.php

Dependency injection doesn't exist in project, add this code block to application entry point

$container = new Container();
GitLabClientFactory::createService($container);
BranchServiceFactory::createService($container);

Usage

Get master branch from specific gitlab project

/** @var BranchService $branchService */
$branchService = $container->get(BranchService::class);

$projectId = 37129493;
$branch = $branchService->getBranch(37129493, "master");