withAttributes
Learn how to set the context attributes for the evaluation.
This method sets the context attributes for the evaluation, replacing any existing ones.
Signature
This method has the following signature:
public function withAttributes(array $attributes): selfThis method returns a copy of the options with the change applied, leaving the original unchanged.
Example
Here is a basic example of how to use this method:
<?phpuse Croct\Plug\EvaluationOptions;
$options = EvaluationOptions::defaults()->withAttributes(['plan' => 'premium']);Parameters
The following list describes the supported parameters:
- attributesarray
The context attributes for the evaluation, replacing any existing ones.