24 )`. * * @var array */ private $params; /** * Create an error. * * @param string $path Dot path to the value. * @param string $code Error code. * @param array $params Message values. */ public function __construct( string $path, string $code, array $params = array() ) { $this->path = $path; $this->code = $code; $this->params = $params; } /** * Dot path to the value. * * @return string */ public function get_path() { return $this->path; } /** * Error code. * * @return string */ public function get_code() { return $this->code; } /** * Message values. * * @return array */ public function get_params() { return $this->params; } /** * The error as an array. * * @return array{path: string, code: string, params: array} */ public function to_array() { return array( 'path' => $this->path, 'code' => $this->code, 'params' => $this->params, ); } }