blackmine/blackmine

Redmine API Client with a lot of magic in its code

v1.0.2-beta 2021-11-22 13:13 UTC

This package is auto-updated.

Last update: 2024-04-26 17:24:17 UTC


README

Blackmine Logo

Latest Version on Packagist Total Downloads Packagist PHP Version Support Scrutinizer Code Quality Scrutinizer build (GitHub/Bitbucket) GitHub GitHub release (latest by date including pre-releases)

Blackmine

Blackmine is a full-featured Redmine API client written in PHP8. It implements a simple interface and converts responses into models and collections.

Installation

composer require blackmine/blackmine

Quick example

$options = new \Blackmine\Client\ClientOptions([
    ClientOptions::CLIENT_OPTION_BASE_URL => "https://your.redmine.url",
    ClientOptions::CLIENT_OPTION_API_KEY => "your.api.key"
]);

$client = new \Blackmine\Client\Client($options);
$issues = $client->getRepository("issues");

$data = $issues
    ->addFilter(Issues::ISSUE_FILTER_ISSUE_ID, [41432, 41436])
    ->with([Issues::ISSUE_RELATION_WATCHERS])
    ->search();

$issue = new \Blackmine\Model\Issue\Issue();
$issue->setSubject("Test Issue");
$issue->setDescription("An issue description, yeah, a real one...");
$issue->setStartDate(\Carbon\CarbonImmutable::create(2021, 10, 31));
$issue->setDueDate(\Carbon\CarbonImmutable::create(2022, 10, 31));
$issues->create($issue);

Status

Actually only JSON format is supported, yeah, JSON is cool and XML isn't. If you think XML is cool enough you can fork the project, start the feature/xml_is_cool branch and pull request your coolness.

Almost all exposed Redmine APIs are supported by Blackmine. There a few bugs that we are trying to fis as soon as possible.

Blackmine uses Requests as transport layer, in a near or not so near future, I will try to pivot to a PSR18 implementation. If you can't wait, you can fork the project, start the feature/psr18_or_death and pull request your hurry ups.

Blackmine uses Carbon to manage dates.

Things that are almost complete:

Things that are incomplete:

  • Documentation
  • Search fluent API (80%)
  • Error handling and exceptions (0%)
  • Model functionality (50%)
  • Unit tests (0%)
  • Magic methods signatures on models and repositories (50%)
  • Date conversion from and to CarbonImmutable objects