PHPackages                             wjy/rpc-helper - 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. wjy/rpc-helper

ActiveLibrary

wjy/rpc-helper
==============

v0.1.2(1y ago)135MITPHPPHP &gt;=8.1

Since Aug 29Pushed 1y ago1 watchersCompare

[ Source](https://github.com/wjycoder/rpc-helper)[ Packagist](https://packagist.org/packages/wjy/rpc-helper)[ RSS](/packages/wjy-rpc-helper/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (3)Used By (0)

component-creator
=================

[](#component-creator)

安装
--

[](#安装)

```
composer require wjy/rpc-helper

```

使用
--

[](#使用)

### \#\[RpcClient\]

[](#rpcclient)

自动配置服务消费者，省去配置`services.consumers`步骤

```
#[RpcClient(registerCenter: 'nacos')]
class CalculatorServiceClient extends AbstractServiceClient implements CalculatorServiceInterface
{
    protected string $serviceName = 'CalculatorService';
    // ...
}
```

指定nacos地址, 默认使用`services.php`配置的nacos

```
#[RpcClient(registerCenter: 'nacos', address: 'http://localhost:8848')]
```

如果不使用配置中心

```
#[RpcClient(nodes: ['localhost:9502'])]
```

### 微服务代理接口

[](#微服务代理接口)

```
#[RpcController(prefix: '/calculator')]  // prefix默认为类名首字母小写
class GoodsService implements GoodsServiceInterface
{
    #[RpcMapping(method: 'get')]  // path默认是方法名 接口: /calculator/add
    public function add($a, $b)
    {
        return $a + $b;
    }

    #[RpcMapping(path: 'minus', method: 'get')]  // 指定path地址 接口: /calculator/add
    public function minus($a, $b)
    {
        return $a + $b;
    }
}
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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

Every ~0 days

Total

2

Last Release

626d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/537d969cdf752a3a3de3d263e53ce61193d983dc978b23e67f53a28f347924da?d=identicon)[wangjingyan](/maintainers/wangjingyan)

---

Top Contributors

[![wjycoder](https://avatars.githubusercontent.com/u/65389964?v=4)](https://github.com/wjycoder "wjycoder (7 commits)")

---

Tags

phpjsonrpchyperf

### Embed Badge

![Health badge](/badges/wjy-rpc-helper/health.svg)

```
[![Health](https://phpackages.com/badges/wjy-rpc-helper/health.svg)](https://phpackages.com/packages/wjy-rpc-helper)
```

###  Alternatives

[friendsofhyperf/sentry

The sentry component for Hyperf.

1864.6k](/packages/friendsofhyperf-sentry)[hyperf/swow-skeleton

A coroutine framework that focuses on hyperspeed and flexible, specifically use for build microservices and middlewares.

514.5k](/packages/hyperf-swow-skeleton)[hyperf/odin

425.9k](/packages/hyperf-odin)

PHPackages © 2026

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