PHPackages                             maslosoft/api-facades - 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. maslosoft/api-facades

ActiveLibrary[API Development](/categories/api)

maslosoft/api-facades
=====================

OpenAPI chainable facades generator

1.0.2(3mo ago)09MITPHPPHP &gt;=8.3

Since Jan 23Pushed 1mo agoCompare

[ Source](https://github.com/Maslosoft/api-facades)[ Packagist](https://packagist.org/packages/maslosoft/api-facades)[ RSS](/packages/maslosoft-api-facades/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (9)Versions (10)Used By (0)

API Facades
===========

[](#api-facades)

API Facades generator, allowing to call OpenAPI compatible API's with fluid interfaces.

### 🤖✨👱🏻 Made by human an Ai

[](#-made-by-human-an-ai)

Project developed with help of an Ai. This project is **still in development**, and only features currently required are being implemented and tested.

Description
-----------

[](#description)

The idea is to use natural path-like syntax, instead of method names clumps. The API call is basically last method which is the verb of request.

For example, `POST` to user account module API:

```
$api->ua->user->login->post($request);
```

Which sends post to: htttps://example.com/api/v1/ua/user/login

Example with `GET`:

```
$api->settlements->balance->show->get($request);
```

Or even shorter syntax:

```
$api->settlements->balance->show($request);
```

Which gets response from: htttps://example.com/api/v1/settlements/balance/show

### Install

[](#install)

```
composer require maslosoft/api-facades --dev
```

Hydration
---------

[](#hydration)

The `ObjectProperties` hydrator populates public properties using reflection. It supports `#[Cast]`, `#[CastArray]`, `#[Scalar]`, and `#[ScalarArray]` attributes.

### Input field mapping and camelization

[](#input-field-mapping-and-camelization)

Use `#[InputField('field_name')]` to map an input field to a property. When an input field is explicitly defined, camelization is ignored for that property.

Camelizing input keys (for example, `user_name` -&gt; `userName`) can be configured through `HydrationConfig`:

- `HydrationConfig::CamelizeAuto` (default) - camelize when snake\_case keys are present.
- `HydrationConfig::CamelizeEnabled` - always allow snake\_case mapping.
- `HydrationConfig::CamelizeDisabled` - disable snake\_case mapping.

```
use Maslosoft\ApiFacades\Hydrators\Attributes\InputField;
use Maslosoft\ApiFacades\Hydrators\HydrationConfig;
use Maslosoft\ApiFacades\Hydrators\ObjectProperties;

class User
{
	#[InputField('user_name')]
	public string $userName = '';

	public string $emailAddress = '';
}

$hydrator = new ObjectProperties(new HydrationConfig(HydrationConfig::CamelizeAuto));
$user = $hydrator->hydrate(new User(), [
	'user_name' => 'Jane',
	'email_address' => 'jane@example.com',
]);
```

Unit tests
----------

[](#unit-tests)

To create unit test, `make` may be used with self-explanatory command, for example:

```
make unit Generate/Trim
```

Will generate new unit test class in:

```
tests/Unit/GenerateTrimTest.php

```

Keep in mind to use forward slash for namespace of tests, as `\` may be interpreted as escape character and generated class namespece will be wrong.

Templates
---------

[](#templates)

Templates are stored as md files. This allows syntax highlighting while not showing errors when using placeholders.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance87

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 51.9% 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 ~2 days

Total

3

Last Release

91d ago

### Community

Maintainers

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

---

Top Contributors

[![pmaselkowski](https://avatars.githubusercontent.com/u/520283?v=4)](https://github.com/pmaselkowski "pmaselkowski (27 commits)")[![Piotr-AppPartner](https://avatars.githubusercontent.com/u/256586063?v=4)](https://github.com/Piotr-AppPartner "Piotr-AppPartner (25 commits)")

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/maslosoft-api-facades/health.svg)

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

###  Alternatives

[sylius/sylius

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

8.4k5.6M651](/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)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)

PHPackages © 2026

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