Skip to content

Novis\Spreadsheet\Formula::constructor

$formula->constructor(
    tainted string $text,
    string|int|float|null $cached,
): void

Makes a Formula from its two values: the formula text and the result the file has for it.

new Formula takes text and cached, in that order, and each becomes a read-only property. text is the formula without = at the start. cached is a string, a number or null. text is tainted, because Reader also makes a Formula when it reads a formula from a file that a user sent.

Good to know: Formula::of makes a Formula for you and removes a = at the start. Use Formula::of in your programs.

Parameters

  • $texttainted stringthe Excel text of the formula, with no = at the start. It is tainted, because Reader can read a formula from a file.
  • $cachedstring|int|float|nullthe result the file has for a program that does not calculate, or null

Return value

Returns void.