PHPackages                             thesis/protobuf-known-types - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. thesis/protobuf-known-types

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

thesis/protobuf-known-types
===========================

Google protobuf known types collection.

0.1.3(2mo ago)031713MITPHPPHP ^8.4CI passing

Since Feb 8Pushed 1mo agoCompare

[ Source](https://github.com/thesis-php/protobuf-known-types)[ Packagist](https://packagist.org/packages/thesis/protobuf-known-types)[ Fund](https://www.tinkoff.ru/cf/5MqZQas2dk7)[ RSS](/packages/thesis-protobuf-known-types/feed)WikiDiscussions 0.1.x Synced 1mo ago

READMEChangelog (6)Dependencies (4)Versions (6)Used By (3)

Generated types for protocol buffers [known types](https://github.com/protocolbuffers/protobuf/tree/main/src/google/protobuf).
------------------------------------------------------------------------------------------------------------------------------

[](#generated-types-for-protocol-buffers-known-types)

### Installation

[](#installation)

```
composer require thesis/protobuf-known-types
```

### Usage

[](#usage)

To encode or decode `google.protobuf.Any` type use `encodeAny/decodeAny` respectively.

```
use Google\Protobuf;
use Thesis\Protobuf\Encoder;

$any = Protobuf\encodeAny(X::class, Encoder\Builder::buildDefault());
```

Note that in this case, `X` should be autoloaded to the descriptor pool (`Thesis\Protobuf\Pool\Registry`) using `autoload.metadata.php` in `composer.json` or any other custom mechanism. Otherwise, an `RuntimeException` will be thrown.

If you strongly understand what you are doing and your types are not registered in the `Pool\Registry`, pass your own object type name resolver:

```
use Google\Protobuf;
use Thesis\Protobuf\Encoder;

$any = Protobuf\encodeAny(
    X::class,
    Encoder\Builder::buildDefault(),
    static fn(X $x) => 'x',
);
```

To decode `google.protobuf.Any` do the opposite using `decodeAny`:

```
use Google\Protobuf;
use Thesis\Protobuf\Decoder;

$x = Protobuf\decodeAny(
    new Protobuf\Any('type.googleapis.com/x', '...'),
    Decoder\Builder::buildDefault(),
);
```

Again, if you understand what you are doing, you can use custom class resolver:

```
use Google\Protobuf;
use Thesis\Protobuf\Decoder;

$x = Protobuf\decodeAny(
    new Protobuf\Any('type.googleapis.com/x', '...'),
    Decoder\Builder::buildDefault(),
    static fn(string $type) => X::class,
);
```

In both cases, in `encodeAny` and `decodeAny`, your resolvers may return null to fall back to default type resolution using `Pool\Registry`.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance89

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.4% 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 ~11 days

Total

5

Last Release

53d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2552865?v=4)[Valentin Udaltsov](/maintainers/vudaltsov)[@vudaltsov](https://github.com/vudaltsov)

---

Top Contributors

[![kafkiansky](https://avatars.githubusercontent.com/u/37590388?v=4)](https://github.com/kafkiansky "kafkiansky (17 commits)")[![zlodes](https://avatars.githubusercontent.com/u/1114387?v=4)](https://github.com/zlodes "zlodes (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/thesis-protobuf-known-types/health.svg)

```
[![Health](https://phpackages.com/badges/thesis-protobuf-known-types/health.svg)](https://phpackages.com/packages/thesis-protobuf-known-types)
```

PHPackages © 2026

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