File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed
Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change 11# CHANGELOG
22
3+ ## [ v2.4.4] - 2025-09-10
4+
5+ ### 🐞 修正
6+
7+ - 修復 ` toArray() ` 判斷順序錯誤,導致包含 UnionType 屬性的物件使用 ` toArray() ` 時會一律拋錯狀況。
8+
9+ ## [ v2.4.3] - 2025-09-03
10+
11+ - 調整專案描述
12+
13+ ## [ v2.4.2] - 2025-09-03
14+
15+ ### 🐞 修正
16+
17+ - 修復 ` ?array ` 傳入 ` [] ` 時,toArray() 輸出遺失該屬性問題(#2 )。
18+
319## [ v2.4.1] - 2025-09-02
420
521### 🐞 修正
Original file line number Diff line number Diff line change @@ -213,12 +213,10 @@ final public function toArray(): array
213213 }
214214 }
215215 } else {
216- if ($ property ->getType ()->isBuiltin ()) {
217- $ properties [$ key ] = $ value ;
218- } elseif (is_object ($ value ) && method_exists ($ value , 'toArray ' )) {
216+ if (is_object ($ value ) && method_exists ($ value , 'toArray ' )) {
219217 $ properties [$ key ] = $ value ->toArray ();
220218 } elseif ($ value ) {
221- throw new Exception ( ' 不是一種 class 或未提供 toArray 方法 ' ) ;
219+ $ properties [ $ key ] = $ value ;
222220 }
223221 }
224222 });
You can’t perform that action at this time.
0 commit comments