PHPackages                             siganushka/api-factory - 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. siganushka/api-factory

ActiveLibrary[API Development](/categories/api)

siganushka/api-factory
======================

API Factory.

1.1.0(5mo ago)01.1k↓50%5MITPHPPHP &gt;=8.1CI passing

Since May 13Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/siganushka/api-factory)[ Packagist](https://packagist.org/packages/siganushka/api-factory)[ Docs](https://github.com/siganushka/api-factory)[ RSS](/packages/siganushka-api-factory/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (5)

API Factory
===========

[](#api-factory)

An API Factory Abstraction Layer.

### Installation

[](#installation)

```
$ composer require siganushka/api-factory
```

### Usage

[](#usage)

An API class needs to implement 3 methods:

```
// Configure the options required for the request
AbstractRequest::configureOptions(OptionsResolver $resolver): void;

// Configure the request with resolved options
AbstractRequest::configureRequest(RequestOptions $request, array $options): void;

// Parse the response data (ParseResponseException when there is an error)
AbstractRequest::parseResponse(ResponseInterface $response): mixed;
```

### Example:

[](#example)

Github get a user:

```
namespace App\Request;

use Siganushka\ApiFactory\AbstractRequest;
use Siganushka\ApiFactory\RequestOptions;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
 * @extends AbstractRequest
 */
class GithubUsers extends AbstractRequest
{
    protected function configureOptions(OptionsResolver $resolver): void
    {
        $resolve
            ->define('username')
            ->required()
            ->allowedTypes('string')
        ;
    }

    protected function configureRequest(RequestOptions $request, array $options): void
    {
        $request
            ->setMethod('GET')
            ->setUrl(sprintf('https://api.github.com/users/%s', $options['username']))
        ;
    }

    protected function parseResponse(ResponseInterface $response): array
    {
        return $response->toArray();
    }
}

$request = new GithubUsers();

$result = $request->send();
// throws MissingOptionsException: The required options "username" are missing.

$result = $request->send(['username' => 'siganushka']);
// {
//  "login": "siganushka",
//  "id": 45844370,
//  "node_id": "MDQ6VXNlcjQ1ODQ0Mzcw",
//  "avatar_url": "https://avatars.githubusercontent.com/u/45844370?v=4",
//  "gravatar_id": "",
//  "url": "https://api.github.com/users/siganushka",
//  "html_url": "https://github.com/siganushka",
//  "followers_url": "https://api.github.com/users/siganushka/followers",
//  "following_url": "https://api.github.com/users/siganushka/following{/other_user}",
//  "gists_url": "https://api.github.com/users/siganushka/gists{/gist_id}",
//  ...
// }
```

### Implementation

[](#implementation)

- [Github API](https://github.com/siganushka/github-api)
- [Wechat API](https://github.com/siganushka/wechat-api)
- [Wxpay API](https://github.com/siganushka/wxpay-api)
- [Alipay API](https://github.com/siganushka/alipay-api)

###  Health Score

42

—

FairBetter than 89% of packages

Maintenance85

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 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 ~206 days

Total

2

Last Release

155d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.4

1.1.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/0fd8a914f7aa732b7bf15b7b4aacfed35e24dbdc5e278a5f4f047c6f85e383ec?d=identicon)[siganushka](/maintainers/siganushka)

---

Top Contributors

[![siganushka](https://avatars.githubusercontent.com/u/45844370?v=4)](https://github.com/siganushka "siganushka (37 commits)")

---

Tags

api-factory

### Embed Badge

![Health badge](/badges/siganushka-api-factory/health.svg)

```
[![Health](https://phpackages.com/badges/siganushka-api-factory/health.svg)](https://phpackages.com/packages/siganushka-api-factory)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M647](/packages/sylius-sylius)[team-reflex/discord-php

An unofficial API to interact with the voice and text service Discord.

1.1k379.4k24](/packages/team-reflex-discord-php)[temporal/sdk

Temporal SDK

4002.2M18](/packages/temporal-sdk)[darthsoup/php-whmcs-api

WHMCS API client for PHP

2317.3k4](/packages/darthsoup-php-whmcs-api)[storyblok/php-management-api-client

Storyblok PHP Client for Management API

1224.4k1](/packages/storyblok-php-management-api-client)[smnandre/pagespeed-api

PageSpeed Insight PHP Api Client 🚀 Analyse web pages for performances metrics, core web vitals...

1511.5k](/packages/smnandre-pagespeed-api)

PHPackages © 2026

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