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.9k3[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 yesterday

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

37

—

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity68

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

1042d 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://avatars.githubusercontent.com/u/1178572?v=4)[Giacomo Gatelli](/maintainers/arthens)[@arthens](https://github.com/arthens)

![](https://avatars.githubusercontent.com/u/29794?v=4)[Paul Leitmanis](/maintainers/sinamt)[@sinamt](https://github.com/sinamt)

![](https://avatars.githubusercontent.com/u/2247982?v=4)[Adam Scarr](/maintainers/Vektah)[@vektah](https://github.com/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

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[sylius/sylius

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

8.5k5.9M738](/packages/sylius-sylius)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)

PHPackages © 2026

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