Closed (fixed)
Project:
Parameters
Version:
1.6.0
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Jul 2025 at 11:28 UTC
Updated:
15 Sep 2025 at 17:34 UTC
Jump to comment: Most recent
The recommended way to get a strict Parameter doesn't really work. You can't just say:
Parameter::get('mykey','strict');
This fails because all the other following arguments need to be call-by-reference.
So if you want the strict call you have the rather complicated:
$context='strict';
echo Parameter::get('mykey',$context);
Additionally you also need the "->getProcessedData()->getValue();" part everytime.
This is a bit complicated for simple strings or secrets. I'd suggest providing a convenience method:
echo Parameter::getStrictValue('mykey');
that does all these things at once and is thus equivalent to:
$context='strict';
echo Parameter::get('mykey',$context)->getProcessedData()->getValue();
Comments
Comment #3
mxh commentedI have added a convenience shortcut into the Parameter class. It should now be possible to do the following:
Also this should work now as originally intended:
Comment #4
mxh commented