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.4(2mo ago)013MITPHPPHP &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 today

READMEChangelogDependencies (20)Versions (12)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

42

—

FairBetter than 88% of packages

Maintenance88

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.8% 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 ~18 days

Total

5

Last Release

66d ago

### Community

Maintainers

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

---

Top Contributors

[![Piotr-AppPartner](https://avatars.githubusercontent.com/u/256586063?v=4)](https://github.com/Piotr-AppPartner "Piotr-AppPartner (40 commits)")[![pmaselkowski](https://avatars.githubusercontent.com/u/520283?v=4)](https://github.com/pmaselkowski "pmaselkowski (28 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

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M508](/packages/pimcore-pimcore)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)

PHPackages © 2026

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