PHPackages                             beloys/stub-grpc - 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. beloys/stub-grpc

ActiveLibrary

beloys/stub-grpc
================

Mock for gRPC

0.0.1(6y ago)062.3k↓46.3%PHPPHP &gt;=7.1CI failing

Since Apr 3Pushed 6y ago1 watchersCompare

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

READMEChangelogDependencies (4)Versions (2)Used By (0)

Mock for gRPC requests
======================

[](#mock-for-grpc-requests)

Mocks for gRPC clients with PHPStorm meta

### Installation

[](#installation)

```
composer require beloys/stub-grpc --dev

```

### Examples

[](#examples)

```
use Beloys\StubGrpc\StubGrpc;
use Grpc\Health\V1\HealthCheckResponse;
use Grpc\Health\V1\HealthCheckRequest;
use Grpc\Health\V1\HealthClient;

$mock = StubGrpc::make(HealthClient::class, [
    '/grpc.health.v1.Health/Check' => new HealthCheckResponse(['status' => HealthCheckResponse\ServingStatus::SERVING]),
]);

$mock = StubGrpc::make(HealthClient::class, [
    '/grpc.health.v1.Health/Check' => function(HealthCheckRequest $in){
        return [new HealthCheckResponse(), null];
    },
]);

$mock = (new StubGrpc(HealthClient::class))
  ->methodWillReturn('/cyberxpert.grpc.user.User/ViewByUuid', new HealthCheckResponse(), (object)['status' => 1])
  ->build();
```

### Tests

[](#tests)

```
composer tests

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

2236d ago

### Community

Maintainers

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

---

Top Contributors

[![beloys](https://avatars.githubusercontent.com/u/13886338?v=4)](https://github.com/beloys "beloys (2 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/beloys-stub-grpc/health.svg)

```
[![Health](https://phpackages.com/badges/beloys-stub-grpc/health.svg)](https://phpackages.com/packages/beloys-stub-grpc)
```

###  Alternatives

[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/grpc-gcp

gRPC GCP library for channel management

18497.8M3](/packages/google-grpc-gcp)[googleads/google-ads-php

Google Ads API client for PHP

3497.6M9](/packages/googleads-google-ads-php)[temporal/sdk

Temporal SDK

4002.2M18](/packages/temporal-sdk)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

81733.7k](/packages/flow-php-flow)

PHPackages © 2026

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