PHPackages                             garethmidwood/codebasehq-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. garethmidwood/codebasehq-php

ActiveLibrary[API Development](/categories/api)

garethmidwood/codebasehq-php
============================

A PHP library for the CodebaseHQ API

1.1.2(7y ago)013[1 issues](https://github.com/garethmidwood/codebasehq-php/issues)PHP

Since Feb 26Pushed 7y ago1 watchersCompare

[ Source](https://github.com/garethmidwood/codebasehq-php)[ Packagist](https://packagist.org/packages/garethmidwood/codebasehq-php)[ RSS](/packages/garethmidwood-codebasehq-php/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (4)Used By (0)

codebasehq-php
==============

[](#codebasehq-php)

A PHP library for the CodebaseHQ API

Note
====

[](#note)

This library creates objects for users, projects, tickets etc. When you make a query to retrieve tickets (this is just an example, it can apply to other classes too) it will attempt to look up the users and link the ticket assignee/reporter with the user. If you haven't already retrieved users then your ticket will have no assignee or reporter assigned to it. Because of this, the best steps to take are:

- retrieve users
- retrieve projects
- retrieve tickets for the project
- retrieve time sessions for the project

Instructions for each of these steps can be found below.

Usage
=====

[](#usage)

Connecting to the API
---------------------

[](#connecting-to-the-api)

In order to connect to and query the codebase API you need to create a CodebaseHQAccount object

```
$codebaseHQ = new GarethMidwood\CodebaseHQ\CodebaseHQAccount(
    $apiUser,
    $apiKey,
    $apiHost
);
```

Retrieving All Users
--------------------

[](#retrieving-all-users)

Users are pulled at the account level

```
$users = $codebaseHQ->users();
```

This returns a `User\Collection` - searching should be done on the collection, the class has a few helper methods for this

Retrieving Projects
-------------------

[](#retrieving-projects)

Projects can be pulled as a whole for the account, or individually by permalink.

### Retrieving All Projects

[](#retrieving-all-projects)

Projects are also pulled at the account level

```
$projects = $codebaseHQ->projects();
```

This returns a `Project\Collection` - searching should be done on the collection, the class has a few helper methods for this

### Retrieving Individual Projects

[](#retrieving-individual-projects)

You can pull an individual project by the permalink (note the method name is singular)

```
$project = $codebaseHQ->project('project-permalink');
```

This returns a `Project\Project` - not a collection

Populating Project Details
--------------------------

[](#populating-project-details)

Projects can be populated with all of their categories, priorities, statuses and types.

```
$codebaseHQ->categories($project);
$codebaseHQ->priorities($project);
$codebaseHQ->statuses($project);
$codebaseHQ->types($project);
```

Retrieving Tickets for a Project
--------------------------------

[](#retrieving-tickets-for-a-project)

Tickets can only be retrieved if you have a `Project\Project` object.

```
$codebaseHQ->tickets($project, $pageNo);

$project->getTickets();
```

The tickets method returns a boolean indicating whether there are further results (as the results are paginated). The tickets themselves are added to a `Ticket\Collection` in the project. As always, searching should be done on the collection, the class has a few helper methods for this

### Pagination

[](#pagination)

Tickets are paginated, with 20 per page. You can write a simple loop to pull all tickets for the project

```
$pageNo = 1;
$moreResultsToRetrieve = true;

while ($moreResultsToRetrieve) {
    $moreResultsToRetrieve = $codebaseHQ->tickets($project, $pageNo);
    $pageNo++;
}
```

Retrieving Time Sessions for a Project
--------------------------------------

[](#retrieving-time-sessions-for-a-project)

Time Sessions can only be retrieved if you have a `Project\Project` object. You must also pass through a period to retrieve the times for, this can be a day/week/month or all - classes exist for each one.

```
// can be All|Day|Week|Month
$period = new GarethMidwood\CodebaseHQ\TimeSession\Period\Week;

$codebaseHQ->times($project, $period);
```

Time sessions will be associated with the project, the ticket and the user if you have populated those collections.

```
// times for the project
$project->getTimeSessions();

// times associated to a user
$user->getTimeSessions();

// times associated to a ticket
$ticket->getTimeSessions();
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Total

3

Last Release

2668d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b6b41ce3e69067999d1379085fb6390cf35e5d61929aa49d72363d79e4890bb1?d=identicon)[gmidwood](/maintainers/gmidwood)

---

Top Contributors

[![garethmidwood](https://avatars.githubusercontent.com/u/4386083?v=4)](https://github.com/garethmidwood "garethmidwood (1 commits)")

### Embed Badge

![Health badge](/badges/garethmidwood-codebasehq-php/health.svg)

```
[![Health](https://phpackages.com/badges/garethmidwood-codebasehq-php/health.svg)](https://phpackages.com/packages/garethmidwood-codebasehq-php)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M19](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
