Skip to content

Commit 317fd67

Browse files
committed
docs: improve clarity and consistency in component documentation
1 parent e9f74ad commit 317fd67

11 files changed

Lines changed: 34 additions & 31 deletions

en/components/amqp-job.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Introduction
44

5-
`friendsofhyperf/amqp-job` is an asynchronous task component built on the `hyperf/amqp` package. It supports distributing tasks to the AMQP service and consuming these tasks through consumers. It encapsulates the `hyperf/amqp` package and provides a more convenient way to distribute and consume tasks.
5+
`friendsofhyperf/amqp-job` is an asynchronous task component based on the `hyperf/amqp` component. It supports dispatching tasks to an AMQP service, which are then consumed by consumers. By encapsulating the `hyperf/amqp` component, it provides a more convenient way to dispatch and consume tasks.
66

77
## Installation
88

@@ -35,9 +35,10 @@ class FooJob extends Job
3535
}
3636

3737
dispatch(new FooJob());
38+
3839
```
3940

40-
### Registering a Consumer [Optional]
41+
### Registering Consumers [Optional]
4142

4243
```php
4344

@@ -52,9 +53,11 @@ use Hyperf\Amqp\Annotation\Consumer;
5253
queue: 'hyperf.queue',
5354
name: 'MyConsumer',
5455
nums: 4
56+
5557
)]
5658
class MyConsumer extends JobConsumer
5759
{
5860
//
5961
}
62+
6063
```

en/components/cache.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Introduction
44

5-
`friendsofhyperf/cache` is a component based on `hyperf/cache`. It provides additional simplified extension methods.
5+
`friendsofhyperf/cache` is a component based on `hyperf/cache`. It provides more concise extension methods.
66

77
## Installation
88

@@ -62,4 +62,4 @@ di(CacheManager::class)->store('co')->remember($key, $ttl=60, function() {
6262

6363
## References
6464

65-
Similar to [Laravel-Cache](https://laravel.com/docs/8.x/cache)
65+
Like [Laravel-Cache](https://laravel.com/docs/8.x/cache)

en/components/command-signals.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Command Signals
22

3-
The signal handling component of Hyperf Command.
3+
Signal handling component for Hyperf Command.
44

55
## Installation
66

@@ -47,7 +47,7 @@ class FooCommand extends HyperfCommand
4747
}
4848
```
4949

50-
## Execution
50+
## Running
5151

5252
- `Ctrl + C`
5353

en/components/command-validation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Command Validation
22

3-
Validation component for Hyperf command-line usage.
3+
A validation component for Hyperf command line.
44

55
## Installation
66

en/components/compoships.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Compoships
22

3-
**Compoships** provides the ability to specify relationships in Hyperf's Model ORM based on two (or more) columns. This is commonly needed when working with third-party or pre-existing schemas/databases where relationships in Eloquent are defined by matching multiple columns.
3+
**Compoships** provides the ability to define relationships based on two (or more) columns in Hyperf's Model ORM. When dealing with third-party or pre-existing schemas/databases, there is often a need to match multiple columns in the definition of Eloquent relationships.
44

5-
## Issue
5+
## Problem
66

7-
Eloquent does not support composite keys. As a result, it is not possible to define relationships from one model to another by matching multiple columns. Attempting to use a `where` clause (as shown below) will not work when eager-loading the relationship, because **$this->team_id** is null during relationship processing.
7+
Eloquent does not support composite keys. Therefore, it is not possible to define relationships from one model to another by matching multiple columns. Attempting to use `where` clauses (as shown in the example below) does not work when eager loading relationships because **$this->team_id** is null when handling the relationship.
88

99
```php
1010
namespace App;
@@ -23,7 +23,7 @@ class User extends Model
2323

2424
## Installation
2525

26-
It is recommended to install the **Compoships** package via [Composer](http://getcomposer.org/).
26+
It is recommended to install the **Compoships** component using [Composer](http://getcomposer.org/).
2727

2828
```shell
2929
composer require friendsofhyperf/compoships
@@ -33,15 +33,15 @@ composer require friendsofhyperf/compoships
3333

3434
### Using the `FriendsOfHyperf\Compoships\Database\Eloquent\Model` Class
3535

36-
Simply extend your model class from the `FriendsOfHyperf\Compoships\Database\Eloquent\Model` base class. `FriendsOfHyperf\Compoships\Database\Eloquent\Model` extends the `Eloquent` base class without altering its core functionality.
36+
Simply have your model classes extend the `FriendsOfHyperf\Compoships\Database\Eloquent\Model` base class. `FriendsOfHyperf\Compoships\Database\Eloquent\Model` extends the `Eloquent` base class without altering its core functionality.
3737

3838
### Using the `FriendsOfHyperf\Compoships\Compoships` Trait
3939

40-
If, for some reason, you cannot extend your model from `FriendsOfHyperf\Compoships\Database\Eloquent\Model`, you can use the `FriendsOfHyperf\Compoships\Compoships` trait. Simply include the trait in your model.
40+
If for some reason you cannot extend `FriendsOfHyperf\Compoships\Database\Eloquent\Model` in your model, you can use the `FriendsOfHyperf\Compoships\Compoships` trait. Simply use this trait in your model.
4141

42-
**Note:** To define multi-column relationships from model *A* to another model *B*, **both models must either extend `FriendsOfHyperf\Compoships\Database\Eloquent\Model` or use the `FriendsOfHyperf\Compoships\Compoships` trait**.
42+
**Note:** To define a multi-column relationship from model *A* to another model *B*, **both models must extend `FriendsOfHyperf\Compoships\Database\Eloquent\Model` or use the `FriendsOfHyperf\Compoships\Compoships` trait**
4343

44-
### How It Works
44+
### Usage
4545

4646
... Now we can define relationships from model *A* to another model *B* by matching two or more columns (by passing an array of columns instead of a string).
4747

@@ -81,15 +81,15 @@ class B extends Model
8181

8282
### Example
8383

84-
For example, suppose we have a task list with categories that are managed by multiple user teams, where:
84+
As an example, suppose we have a task list with categories, managed by multiple user teams, where:
8585

8686
- A task belongs to a category
8787
- A task is assigned to a team
8888
- A team has many users
8989
- A user belongs to a team
90-
- A user is responsible for tasks in a category
90+
- A user is responsible for a category's tasks
9191

92-
The user responsible for a specific task is the current user in charge of that category within the team.
92+
The user responsible for a specific task is the currently responsible user for that category within the team.
9393

9494
```php
9595
namespace App;
@@ -107,7 +107,7 @@ class User extends Model
107107
}
108108
```
109109

110-
The same syntax applies to defining the inverse relationship:
110+
The same syntax can be used to define the inverse relationship:
111111

112112
```php
113113
namespace App;
@@ -123,4 +123,4 @@ class Task extends Model
123123
return $this->belongsTo(User::class, ['team_id', 'category_id'], ['team_id', 'category_id']);
124124
}
125125
}
126-
```
126+
```

en/components/confd.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Confd
22

3-
The configuration management component for Hyperf.
3+
Configuration management component for Hyperf.
44

55
## Installation
66

@@ -13,13 +13,13 @@ composer require friendsofhyperf/nacos
1313

1414
## Commands
1515

16-
Fetch configuration from `etcd/nacos` and update the `.env` file.
16+
Fetch configuration from `etcd/nacos` and update `.env`.
1717

1818
```shell
1919
php bin/hyperf.php confd:env
2020
```
2121

22-
## Define a Listener
22+
## Define Listener
2323

2424
```php
2525
<?php
@@ -48,7 +48,7 @@ class ConfigChangedListener implements ListenerInterface
4848
public function process(object $event): void
4949
{
5050
$this->logger->warning('[confd] ConfdChanged');
51-
// Handle changes
51+
// do something
5252
}
5353
}
5454
```

en/components/console-spinner.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Console Spinner
22

3-
A progress bar component for the Hyperf framework.
3+
A progress bar component provided for the Hyperf framework.
44

55
## Installation
66

@@ -37,7 +37,7 @@ class FooCommand extends Command
3737
}
3838
```
3939

40-
The `$spinner` is compatible with Symfony ProgressBar, so you can call any method of that class. Alternatively, you can use the `withSpinner` method by providing an iterable object.
40+
`$spinner` is compatible with Symfony ProgressBar, so you can run any methods from this class. Alternatively, you can use the `withSpinner` method by providing an iterable object.
4141

4242
```php
4343
$this->withSpinner(User::all(), function($user) {

en/components/di-plus.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# DI Plus
22

3-
The dependency injection enhancement component for Hyperf.
3+
A dependency injection enhancement component for Hyperf.
44

55
## Installation
66

@@ -38,7 +38,7 @@ class Foo2
3838
}
3939
```
4040

41-
Support for annotation-based configuration:
41+
Supports annotation-based configuration
4242

4343
```php
4444
<?php

en/components/elasticsearch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Elasticsearch
22

3-
A customized Elasticsearch client component for Hyperf.
3+
A client component for Elasticsearch customized for Hyperf.
44

55
## Installation
66

en/components/encryption.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ php bin/hyperf.php vendor:publish friendsofhyperf/encryption
1616

1717
## Usage
1818

19-
```shell
19+
```php
2020
$encryptString = encrypt($string);
2121
$decryptString = decrypt($encryptString);
2222
```

0 commit comments

Comments
 (0)