PHPackages                             99designs/twirfony - 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. 99designs/twirfony

ActiveLibrary[API Development](/categories/api)

99designs/twirfony
==================

v2.0.0(2y ago)35.5k3[3 PRs](https://github.com/99designs/twirfony/pulls)MITPHPPHP &gt;=7

Since Feb 8Pushed 2y ago36 watchersCompare

[ Source](https://github.com/99designs/twirfony)[ Packagist](https://packagist.org/packages/99designs/twirfony)[ RSS](/packages/99designs-twirfony/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (6)Versions (14)Used By (0)

twirfony: twirp for Symfony
===========================

[](#twirfony-twirp-for-symfony)

Twirfony is made up of two parts, codegen and a runtime Symfony bundle.

Code generation
---------------

[](#code-generation)

Code generation is written as a protoc plugin in golang, because the go tooling for proto is fantastic.

To generate the twirp interfaces

```
go install ./protoc-gen-twirp_php
protoc --twirp_php_out src --php_out src haberdasher.proto
```

‼️ At 99designs you should use `99dev twirp generate {app}` instead, and read the docs over at

Runtime
-------

[](#runtime)

The runtime component is a Symfony bundle that allows you to mount classes implementing the generated twirp service interfaces directly into your router.

1. Add a twirfony dependency

```
composer require 99designs/twirfony
```

2. Register the bundle

```
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        return [
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            new AppBundle\AppBundle(),
            new Twirfony\TwirfonyBundle\TwirfonyBundle(), // add this line
        ];
    }
```

3. Register the router in routing.yml

```
twirp_api:
    resource: 'twirp.service_registry::loadRoutes'
    type: service
    prefix: /twirp
```

4. Create implement your twirp service

```
namespace AppBundle\Service;

use AppBundle\Twirp\HaberdasherInterface;
use AppBundle\Twirp\Hat;
use AppBundle\Twirp\Size;
use Twirfony\TwirpService;

class HaberdasherService implements TwirpService, HaberdasherInterface
{
    public function makeHat(Size $size): Hat
    {
        return (new Hat)
            ->setInches($size->getInches())
            ->setColor("blue")
            ->setName("Fedora");
    }
}
```

5. Register and tag your service

```
    haberdasher_service:
        class: AppBundle\Service\HaberdasherService
        tags: ['twirp.service']
```

###  Health Score

36

—

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~393 days

Total

8

Last Release

985d ago

Major Versions

0.1.4 → 1.0.02021-03-04

1.0.1 → v2.0.02023-08-27

PHP version history (3 changes)v0.1.0PHP &gt;=7.0.0

v0.1.1PHP ^7

v2.0.0PHP &gt;=7

### Community

Maintainers

![](https://www.gravatar.com/avatar/61d94165c13417941a32d14d4468f27868c7643e96495090cfd33009055ea48c?d=identicon)[mtibben](/maintainers/mtibben)

![](https://www.gravatar.com/avatar/6d43d23630fc281c26ff5872d03d054e1508b5676eeefee1424464ab5c0f00e4?d=identicon)[arthens](/maintainers/arthens)

![](https://www.gravatar.com/avatar/077206ec25224ef22d3151c8d6803444c5a0dfb5c9977d8e28d1da3c51ae0534?d=identicon)[sinamt](/maintainers/sinamt)

![](https://www.gravatar.com/avatar/05cbc29645134e6b4b1472e66a3966f5627d346ddbfacf6c873e48b2e15c64af?d=identicon)[Vektah](/maintainers/Vektah)

---

Top Contributors

[![lwc](https://avatars.githubusercontent.com/u/336402?v=4)](https://github.com/lwc "lwc (6 commits)")[![sinamt](https://avatars.githubusercontent.com/u/29794?v=4)](https://github.com/sinamt "sinamt (6 commits)")[![navitronic](https://avatars.githubusercontent.com/u/180519?v=4)](https://github.com/navitronic "navitronic (4 commits)")[![vektah](https://avatars.githubusercontent.com/u/2247982?v=4)](https://github.com/vektah "vektah (4 commits)")[![DanWilliamsAu](https://avatars.githubusercontent.com/u/5985804?v=4)](https://github.com/DanWilliamsAu "DanWilliamsAu (2 commits)")[![kerrison24](https://avatars.githubusercontent.com/u/6263647?v=4)](https://github.com/kerrison24 "kerrison24 (2 commits)")

---

Tags

phpsymfonytwirp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/99designs-twirfony/health.svg)

```
[![Health](https://phpackages.com/badges/99designs-twirfony/health.svg)](https://phpackages.com/packages/99designs-twirfony)
```

###  Alternatives

[sylius/sylius

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

8.4k5.6M647](/packages/sylius-sylius)[saloonphp/saloon

Build beautiful API integrations and SDKs with Saloon

2.4k9.6M467](/packages/saloonphp-saloon)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k20](/packages/neuron-core-neuron-ai)[yoti/yoti-php-sdk

Yoti SDK for quickly integrating your PHP backend with Yoti

27539.9k1](/packages/yoti-yoti-php-sdk)[agence104/livekit-server-sdk

Server-side SDK for LiveKit.

79189.9k1](/packages/agence104-livekit-server-sdk)

PHPackages © 2026

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