RSS Feed/News XF options do not round-trip integer/boolean values as expected

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
26,838
Points
823

Reputation:

PHP:

Code:
var_dump(\XF::Options()->changeLogLength);

$option = Helper::find(\XF\Entity\Option::class, 'changeLogLength');
$option->option_value = 0;
var_dump($option->option_value);

Both of these will output a string type instead of the expected int type. This matters because xf-dev:generate-options-stub CLI command gives strongly typed hints, and phpstorm (and other php code formatting tools) will suggest to unwrap any casts. Except the underlying type is stringy so...

Read more

Continue reading...
 
Status
Not open for further replies.
Top