withAttribute
Learn how to add a context attribute to the evaluation.
This method adds a context attribute, identified by a name, to the evaluation.
Signature
This method has the following signature:
public function withAttribute(string $name, mixed $value): 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()->withAttribute('plan', 'premium');Parameters
The following list describes the supported parameters: