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(7mo ago)01.1k↓92.6%5MITPHPPHP &gt;=8.1CI passing

Since May 13Pushed 2w 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 today

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 88% of packages

Maintenance82

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity47

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

212d ago

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

1.1.0PHP &gt;=8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/45844370?v=4)[Siganushka](/maintainers/siganushka)[@siganushka](https://github.com/siganushka)

---

Top Contributors

[![siganushka](https://avatars.githubusercontent.com/u/45844370?v=4)](https://github.com/siganushka "siganushka (38 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.5k5.9M737](/packages/sylius-sylius)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M576](/packages/shopware-core)[chameleon-system/chameleon-base

The Chameleon System core.

1028.6k5](/packages/chameleon-system-chameleon-base)[storyblok/php-management-api-client

Storyblok PHP Client for Management API

1233.5k3](/packages/storyblok-php-management-api-client)

PHPackages © 2026

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