You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -1034,140 +1034,40 @@ class UserValidator extends MagicObject
1034
1034
This enhancement makes the validator generator more expressive and future-proof, especially when building layered architectures or generating documentation automatically.
1035
1035
1036
1036
1037
-
# MagicObject Version 3.14.4
1038
-
1039
-
## What's Fixed
1040
-
1041
-
### Bug Fix: `numberFormat*` Methods Accept Single Parameter
1042
-
1043
-
In version 3.14.4, a bug has been fixed in the internal magic method handling for `numberFormat*` methods (such as `numberFormatPercent`, `numberFormatTotal`, etc.).
1044
-
1045
-
#### Previous Behavior (Before 3.14.4)
1046
-
1047
-
Calling a `numberFormat*` method with **only one argument** would trigger warnings:
1048
-
1049
-
```php
1050
-
$data = new MagicObject();
1051
-
$data->setPercent(2.123456);
1052
-
echo $data->numberFormatPercent(2);
1053
-
```
1054
-
1055
-
**Result:**
1056
-
1057
-
```txt
1058
-
Warning: Undefined index 1
1059
-
Warning: Undefined index 2
1060
-
```
1061
-
1062
-
This occurred because the internal handler expected three parameters and did not check for their existence properly.
1063
-
1064
-
#### New Behavior (Since 3.14.4)
1065
-
1066
-
These methods now safely accept **a single argument**, defaulting the missing parameters to reasonable values internally. The example above now works as expected and outputs:
1067
-
1068
-
```txt
1069
-
2.12
1070
-
```
1071
-
1072
-
#### Benefits:
1073
-
1074
-
- Improved developer experience when formatting numbers.
1075
-
1076
-
- No need to always pass three parameters for simple formatting.
1077
-
1078
-
- Prevents PHP warnings in production environments.
1079
-
1080
-
This bug fix enhances robustness and backward compatibility for developers using dynamic number formatting features in MagicObject.
1081
1037
1082
1038
1083
1039
# MagicObject Version 3.14.5
1084
1040
1085
-
## What's Changed
1086
-
1087
-
### New Feature: URL-Based Database Credential Parsing
1088
-
1089
-
MagicObject now supports importing database credentials from a **datasource URL** string using the new method `PicoDatabaseCredentials::importFromUrl()`.
1090
-
1091
-
This enhancement simplifies configuration and integration with environment-based or externalized connection settings (e.g., `DATABASE_URL`).
- Makes deployment and configuration more flexible in containerized or cloud environments.
1051
+
Each key is automatically camelized for consistent property access.
1052
+
If any key in the chain does not exist or returns `null`, the method will return `null`.
1129
1053
1130
-
- Simplifies integration with .env files, environment variables, or external secrets managers.
1054
+
This enhancement improves developer ergonomics when working with deeply nested data structures.
1131
1055
1132
-
- Supports both traditional and SQLite-based databases.
1056
+
### Validation: New `@TimeRange` Annotation
1133
1057
1134
-
### Backward Compatibility
1135
-
1136
-
This update is fully backward-compatible and does not change any existing behavior unless the new method is used explicitly.
1137
-
1138
-
1139
-
### Bug Fix: Class-Typed Default Parameters Now Compatible with PHP 5
1140
-
1141
-
Fixed a **fatal error** caused by the use of default parameters with a class type hint (`MagicObject`, `SecretObject`, `SetterGetter`, `MagicDto`) and non-null default values in the `validate()` method.
0 commit comments