Skip to content

Commit b6ff374

Browse files
authored
Release v3.2.3 (#7789)
1 parent 95f4254 commit b6ff374

9 files changed

Lines changed: 100 additions & 33 deletions

File tree

‎CHANGELOG-3.2.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# v3.2.3 - TBD
1+
# v3.2.4 - TBD
2+
3+
# v3.2.3 - 2026-07-29
24

35
## Added
46

‎docs/en/changelog/3.2.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# v3.2.3 - 2026-07-29
2+
3+
## Added
4+
5+
- [#7783](https://github.com/hyperf/hyperf/pull/7783) Added function `Hyperf\Support\existent`.
6+
7+
## Fixed
8+
9+
- [#7782](https://github.com/hyperf/hyperf/pull/7782) Fixed incorrect @property type in generated models, such as `@property int $id` -> `@property ?int $id`.
10+
- [#7784](https://github.com/hyperf/hyperf/pull/7784) [#7785](https://github.com/hyperf/hyperf/pull/7785) Fixed phpdoc for `Hyperf\ModelCache\Cacheable`.
11+
- [#7786](https://github.com/hyperf/hyperf/pull/7786) Fixed phpdocs for `Hyperf\Database\Model\Builder`.
12+
113
# v3.2.2 - 2026-07-26
214

315
## Removed
@@ -9,6 +21,7 @@
921
- [#7768](https://github.com/hyperf/hyperf/pull/7768) Fixed bug that `Hyperf\Validation\Concerns\ValidatesAttributes::validateMultipleOf` cannot support `float`.
1022
- [#7771](https://github.com/hyperf/hyperf/pull/7771) Fixed bug that `gen:migration-from-database` cannot work.
1123
- [#7774](https://github.com/hyperf/hyperf/pull/7774) Fixed bug that `Hyperf\Di\ScanHandler\ProcScanHandler` cannot work.
24+
- [#7788](https://github.com/hyperf/hyperf/pull/7788) Fixed bug that `MorphTo` relationships eager loading specific columns.
1225

1326
# v3.2.1 - 2026-06-15
1427

‎docs/id/changelog/3.2.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# v3.2.3 - 2026-07-29
2+
3+
## Ditambahkan
4+
5+
- [#7783](https://github.com/hyperf/hyperf/pull/7783) Menambahkan fungsi `Hyperf\Support\existent`.
6+
7+
## Diperbaiki
8+
9+
- [#7782](https://github.com/hyperf/hyperf/pull/7782) Memperbaiki tipe `@property` yang salah pada model yang dihasilkan, seperti `@property int $id` -> `@property ?int $id`.
10+
- [#7784](https://github.com/hyperf/hyperf/pull/7784) [#7785](https://github.com/hyperf/hyperf/pull/7785) Memperbaiki phpdoc untuk `Hyperf\ModelCache\Cacheable`.
11+
- [#7786](https://github.com/hyperf/hyperf/pull/7786) Memperbaiki phpdoc untuk `Hyperf\Database\Model\Builder`.
12+
113
# v3.2.2 - 2026-07-26
214

315
## Dihapus (Removed)
@@ -9,6 +21,7 @@
921
- [#7768](https://github.com/hyperf/hyperf/pull/7768) Memperbaiki *bug* pada `Hyperf\Validation\Concerns\ValidatesAttributes::validateMultipleOf` yang tidak mendukung tipe data `float`.
1022
- [#7771](https://github.com/hyperf/hyperf/pull/7771) Memperbaiki *bug* pada perintah `gen:migration-from-database` yang tidak berfungsi.
1123
- [#7774](https://github.com/hyperf/hyperf/pull/7774) Memperbaiki *bug* pada `Hyperf\Di\ScanHandler\ProcScanHandler` yang tidak berfungsi.
24+
- [#7788](https://github.com/hyperf/hyperf/pull/7788) Memperbaiki bug pada *eager loading* kolom tertentu untuk relasi `MorphTo`.
1225

1326
# v3.2.1 - 2026-06-15
1427

‎docs/zh-cn/changelog/3.2.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# v3.2.3 - 2026-07-29
2+
3+
## 新增
4+
5+
- [#7783](https://github.com/hyperf/hyperf/pull/7783) 新增 `Hyperf\Support\existent` 函数。
6+
7+
## 修复
8+
9+
- [#7782](https://github.com/hyperf/hyperf/pull/7782) 修复模型生成时 `@property` 类型错误的问题,例如将 `@property int $id` 修正为 `@property ?int $id`。
10+
- [#7784](https://github.com/hyperf/hyperf/pull/7784) [#7785](https://github.com/hyperf/hyperf/pull/7785) 修复 `Hyperf\ModelCache\Cacheable` 的 PHP 注释(phpdoc)。
11+
- [#7786](https://github.com/hyperf/hyperf/pull/7786) 修复 `Hyperf\Database\Model\Builder` 的 PHP 注释(phpdoc)。
12+
113
# v3.2.2 - 2026-07-26
214

315
## 移除
@@ -9,6 +21,7 @@
921
- [#7768](https://github.com/hyperf/hyperf/pull/7768) 修复 `Hyperf\Validation\Concerns\ValidatesAttributes::validateMultipleOf` 无法使用 `float` 的问题。
1022
- [#7771](https://github.com/hyperf/hyperf/pull/7771) 修复 `gen:migration-from-database` 无法正常使用的问题。
1123
- [#7774](https://github.com/hyperf/hyperf/pull/7774) 修复 `Hyperf\Di\ScanHandler\ProcScanHandler` 无法使用的问题。
24+
- [#7788](https://github.com/hyperf/hyperf/pull/7788) 修复 `MorphTo` 关联预加载指定字段时的 Bug。
1225

1326
# v3.2.1 - 2026-06-15
1427

‎docs/zh-hk/changelog/3.2.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# v3.2.3 - 2026-07-29
2+
3+
## 新增
4+
5+
- [#7783](https://github.com/hyperf/hyperf/pull/7783) 新增 `Hyperf\Support\existent` 函數。
6+
7+
## 修復
8+
9+
- [#7782](https://github.com/hyperf/hyperf/pull/7782) 修復模型生成時 `@property` 類型錯誤的問題,例如將 `@property int $id` 修正為 `@property ?int $id`。
10+
- [#7784](https://github.com/hyperf/hyperf/pull/7784) [#7785](https://github.com/hyperf/hyperf/pull/7785) 修復 `Hyperf\ModelCache\Cacheable` 的 PHP 註釋(phpdoc)。
11+
- [#7786](https://github.com/hyperf/hyperf/pull/7786) 修復 `Hyperf\Database\Model\Builder` 的 PHP 註釋(phpdoc)。
12+
113
# v3.2.2 - 2026-07-26
214

315
## 移除
@@ -9,6 +21,7 @@
921
- [#7768](https://github.com/hyperf/hyperf/pull/7768) 修復 `Hyperf\Validation\Concerns\ValidatesAttributes::validateMultipleOf` 無法使用 `float` 的問題。
1022
- [#7771](https://github.com/hyperf/hyperf/pull/7771) 修復 `gen:migration-from-database` 無法正常使用的問題。
1123
- [#7774](https://github.com/hyperf/hyperf/pull/7774) 修復 `Hyperf\Di\ScanHandler\ProcScanHandler` 無法使用的問題。
24+
- [#7788](https://github.com/hyperf/hyperf/pull/7788) 修復 `MorphTo` 關聯預加載指定字段時的 Bug。
1225

1326
# v3.2.1 - 2026-06-15
1427

‎docs/zh-tw/changelog/3.2.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# v3.2.3 - 2026-07-29
2+
3+
## 新增
4+
5+
- [#7783](https://github.com/hyperf/hyperf/pull/7783) 新增 `Hyperf\Support\existent` 函式。
6+
7+
## 修復
8+
9+
- [#7782](https://github.com/hyperf/hyperf/pull/7782) 修復模型生成時 `@property` 型別錯誤的問題,例如將 `@property int $id` 修正為 `@property ?int $id`。
10+
- [#7784](https://github.com/hyperf/hyperf/pull/7784) [#7785](https://github.com/hyperf/hyperf/pull/7785) 修復 `Hyperf\ModelCache\Cacheable` 的 PHP 註釋(phpdoc)。
11+
- [#7786](https://github.com/hyperf/hyperf/pull/7786) 修復 `Hyperf\Database\Model\Builder` 的 PHP 註釋(phpdoc)。
12+
113
# v3.2.2 - 2026-07-26
214

315
## 移除
@@ -9,6 +21,7 @@
921
- [#7768](https://github.com/hyperf/hyperf/pull/7768) 修復 `Hyperf\Validation\Concerns\ValidatesAttributes::validateMultipleOf` 無法使用 `float` 的問題。
1022
- [#7771](https://github.com/hyperf/hyperf/pull/7771) 修復 `gen:migration-from-database` 無法正常使用的問題。
1123
- [#7774](https://github.com/hyperf/hyperf/pull/7774) 修復 `Hyperf\Di\ScanHandler\ProcScanHandler` 無法使用的問題。
24+
- [#7788](https://github.com/hyperf/hyperf/pull/7788) 修復 `MorphTo` 關聯預載入指定欄位時的 Bug。
1225

1326
# v3.2.1 - 2026-06-15
1427

‎src/database/src/Model/Concerns/HasRelationships.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ public function morphMany($related, $name, $type = null, $id = null, $localKey =
361361
* @param string $relatedKey
362362
* @param string $relation
363363
*
364-
* @return BelongsToMany<TRelatedModel, $this, Pivot, 'pivot'>
364+
* @return BelongsToMany<TRelatedModel, static, Pivot, 'pivot'>
365365
*/
366366
public function belongsToMany(
367367
$related,
@@ -420,7 +420,7 @@ public function belongsToMany(
420420
* @param string $parentKey
421421
* @param string $relatedKey
422422
* @param bool $inverse
423-
* @return MorphToMany<TRelatedModel, $this, MorphPivot, 'pivot'>
423+
* @return MorphToMany<TRelatedModel, static, MorphPivot, 'pivot'>
424424
*/
425425
public function morphToMany(
426426
$related,
@@ -480,7 +480,7 @@ public function morphToMany(
480480
* @param string $relatedPivotKey
481481
* @param string $parentKey
482482
* @param string $relatedKey
483-
* @return MorphToMany<TRelatedModel, $this, MorphPivot, 'pivot'>
483+
* @return MorphToMany<TRelatedModel, static, MorphPivot, 'pivot'>
484484
*/
485485
public function morphedByMany(
486486
$related,

‎src/database/types/Model/Builder.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ function test(
196196

197197
class User extends Model
198198
{
199-
/** @return HasMany<Post, $this> */
199+
/** @return HasMany<Post, static> */
200200
public function posts(): HasMany
201201
{
202202
return $this->hasMany(Post::class);
@@ -205,13 +205,13 @@ public function posts(): HasMany
205205

206206
class Post extends Model
207207
{
208-
/** @return BelongsTo<User, $this> */
208+
/** @return BelongsTo<User, static> */
209209
public function user(): BelongsTo
210210
{
211211
return $this->belongsTo(User::class);
212212
}
213213

214-
/** @return MorphTo<Model, $this> */
214+
/** @return MorphTo<Model, static> */
215215
public function taggable(): MorphTo
216216
{
217217
return $this->morphTo();

‎src/database/types/Model/Relations.php‎

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -114,136 +114,136 @@ function test(User $user, Post $post, Comment $comment, ChildUser $child): void
114114

115115
class User extends Model
116116
{
117-
/** @return HasOne<Address, $this> */
117+
/** @return HasOne<Address, static> */
118118
public function address(): HasOne
119119
{
120120
$hasOne = $this->hasOne(Address::class);
121-
assertType('Hyperf\Database\Model\Relations\HasOne<Hyperf\Types\Relations\Address, $this(Hyperf\Types\Relations\User)>', $hasOne);
121+
assertType('Hyperf\Database\Model\Relations\HasOne<Hyperf\Types\Relations\Address, static(Hyperf\Types\Relations\User)>', $hasOne);
122122

123123
return $hasOne;
124124
}
125125

126-
/** @return HasMany<Post, $this> */
126+
/** @return HasMany<Post, static> */
127127
public function posts(): HasMany
128128
{
129129
$hasMany = $this->hasMany(Post::class);
130-
assertType('Hyperf\Database\Model\Relations\HasMany<Hyperf\Types\Relations\Post, $this(Hyperf\Types\Relations\User)>', $hasMany);
130+
assertType('Hyperf\Database\Model\Relations\HasMany<Hyperf\Types\Relations\Post, static(Hyperf\Types\Relations\User)>', $hasMany);
131131

132132
return $hasMany;
133133
}
134134

135-
/** @return BelongsToMany<Role, $this> */
135+
/** @return BelongsToMany<Role, static> */
136136
public function roles(): BelongsToMany
137137
{
138138
$belongsToMany = $this->belongsToMany(Role::class);
139-
assertType('Hyperf\Database\Model\Relations\BelongsToMany<Hyperf\Types\Relations\Role, $this(Hyperf\Types\Relations\User), Hyperf\Database\Model\Relations\Pivot, \'pivot\'>', $belongsToMany);
139+
assertType('Hyperf\Database\Model\Relations\BelongsToMany<Hyperf\Types\Relations\Role, static(Hyperf\Types\Relations\User), Hyperf\Database\Model\Relations\Pivot, \'pivot\'>', $belongsToMany);
140140

141141
return $belongsToMany;
142142
}
143143

144-
/** @return HasOne<Mechanic, $this> */
144+
/** @return HasOne<Mechanic, static> */
145145
public function mechanic(): HasOne
146146
{
147147
return $this->hasOne(Mechanic::class);
148148
}
149149

150-
/** @return HasMany<Mechanic, $this> */
150+
/** @return HasMany<Mechanic, static> */
151151
public function mechanics(): HasMany
152152
{
153153
return $this->hasMany(Mechanic::class);
154154
}
155155

156-
/** @return HasOneThrough<Car, Mechanic, $this> */
156+
/** @return HasOneThrough<Car, Mechanic, static> */
157157
public function car(): HasOneThrough
158158
{
159159
$hasOneThrough = $this->hasOneThrough(Car::class, Mechanic::class);
160-
assertType('Hyperf\Database\Model\Relations\HasOneThrough<Hyperf\Types\Relations\Car, Hyperf\Types\Relations\Mechanic, $this(Hyperf\Types\Relations\User)>', $hasOneThrough);
160+
assertType('Hyperf\Database\Model\Relations\HasOneThrough<Hyperf\Types\Relations\Car, Hyperf\Types\Relations\Mechanic, static(Hyperf\Types\Relations\User)>', $hasOneThrough);
161161

162162
return $hasOneThrough;
163163
}
164164

165-
/** @return HasManyThrough<Part, Mechanic, $this> */
165+
/** @return HasManyThrough<Part, Mechanic, static> */
166166
public function parts(): HasManyThrough
167167
{
168168
$hasManyThrough = $this->hasManyThrough(Part::class, Mechanic::class);
169-
assertType('Hyperf\Database\Model\Relations\HasManyThrough<Hyperf\Types\Relations\Part, Hyperf\Types\Relations\Mechanic, $this(Hyperf\Types\Relations\User)>', $hasManyThrough);
169+
assertType('Hyperf\Database\Model\Relations\HasManyThrough<Hyperf\Types\Relations\Part, Hyperf\Types\Relations\Mechanic, static(Hyperf\Types\Relations\User)>', $hasManyThrough);
170170

171171
return $hasManyThrough;
172172
}
173173
}
174174

175175
class Post extends Model
176176
{
177-
/** @return BelongsTo<User, $this> */
177+
/** @return BelongsTo<User, static> */
178178
public function user(): BelongsTo
179179
{
180180
$belongsTo = $this->belongsTo(User::class);
181-
assertType('Hyperf\Database\Model\Relations\BelongsTo<Hyperf\Types\Relations\User, $this(Hyperf\Types\Relations\Post)>', $belongsTo);
181+
assertType('Hyperf\Database\Model\Relations\BelongsTo<Hyperf\Types\Relations\User, static(Hyperf\Types\Relations\Post)>', $belongsTo);
182182

183183
return $belongsTo;
184184
}
185185

186-
/** @return MorphOne<Image, $this> */
186+
/** @return MorphOne<Image, static> */
187187
public function image(): MorphOne
188188
{
189189
$morphOne = $this->morphOne(Image::class, 'imageable');
190-
assertType('Hyperf\Database\Model\Relations\MorphOne<Hyperf\Types\Relations\Image, $this(Hyperf\Types\Relations\Post)>', $morphOne);
190+
assertType('Hyperf\Database\Model\Relations\MorphOne<Hyperf\Types\Relations\Image, static(Hyperf\Types\Relations\Post)>', $morphOne);
191191

192192
return $morphOne;
193193
}
194194

195-
/** @return MorphMany<Comment, $this> */
195+
/** @return MorphMany<Comment, static> */
196196
public function comments(): MorphMany
197197
{
198198
$morphMany = $this->morphMany(Comment::class, 'commentable');
199-
assertType('Hyperf\Database\Model\Relations\MorphMany<Hyperf\Types\Relations\Comment, $this(Hyperf\Types\Relations\Post)>', $morphMany);
199+
assertType('Hyperf\Database\Model\Relations\MorphMany<Hyperf\Types\Relations\Comment, static(Hyperf\Types\Relations\Post)>', $morphMany);
200200

201201
return $morphMany;
202202
}
203203

204-
/** @return MorphToMany<Tag, $this> */
204+
/** @return MorphToMany<Tag, static> */
205205
public function tags(): MorphToMany
206206
{
207207
$morphToMany = $this->morphedByMany(Tag::class, 'taggable');
208-
assertType('Hyperf\Database\Model\Relations\MorphToMany<Hyperf\Types\Relations\Tag, $this(Hyperf\Types\Relations\Post), Hyperf\Database\Model\Relations\MorphPivot, \'pivot\'>', $morphToMany);
208+
assertType('Hyperf\Database\Model\Relations\MorphToMany<Hyperf\Types\Relations\Tag, static(Hyperf\Types\Relations\Post), Hyperf\Database\Model\Relations\MorphPivot, \'pivot\'>', $morphToMany);
209209

210210
return $morphToMany;
211211
}
212212
}
213213

214214
class Comment extends Model
215215
{
216-
/** @return MorphTo<Model, $this> */
216+
/** @return MorphTo<Model, static> */
217217
public function commentable(): MorphTo
218218
{
219219
$morphTo = $this->morphTo();
220-
assertType('Hyperf\Database\Model\Relations\MorphTo<Hyperf\Database\Model\Model, $this(Hyperf\Types\Relations\Comment)>', $morphTo);
220+
assertType('Hyperf\Database\Model\Relations\MorphTo<Hyperf\Database\Model\Model, static(Hyperf\Types\Relations\Comment)>', $morphTo);
221221

222222
return $morphTo;
223223
}
224224
}
225225

226226
class Tag extends Model
227227
{
228-
/** @return MorphToMany<Post, $this> */
228+
/** @return MorphToMany<Post, static> */
229229
public function posts(): MorphToMany
230230
{
231231
$morphToMany = $this->morphToMany(Post::class, 'taggable');
232-
assertType('Hyperf\Database\Model\Relations\MorphToMany<Hyperf\Types\Relations\Post, $this(Hyperf\Types\Relations\Tag), Hyperf\Database\Model\Relations\MorphPivot, \'pivot\'>', $morphToMany);
232+
assertType('Hyperf\Database\Model\Relations\MorphToMany<Hyperf\Types\Relations\Post, static(Hyperf\Types\Relations\Tag), Hyperf\Database\Model\Relations\MorphPivot, \'pivot\'>', $morphToMany);
233233

234234
return $morphToMany;
235235
}
236236
}
237237

238238
class Mechanic extends Model
239239
{
240-
/** @return HasOne<Car, $this> */
240+
/** @return HasOne<Car, static> */
241241
public function car(): HasOne
242242
{
243243
return $this->hasOne(Car::class);
244244
}
245245

246-
/** @return HasMany<Part, $this> */
246+
/** @return HasMany<Part, static> */
247247
public function parts(): HasMany
248248
{
249249
return $this->hasMany(Part::class);

0 commit comments

Comments
 (0)