HEX
Server: Apache
System: Linux webm004.cluster121.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User: grainesdfo (155059)
PHP: 5.4.45
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/grainesdfo/www/wp-content/plugins/tablepress/libraries/vendor/PhpSpreadsheet/NamedFormula.php
<?php

namespace TablePress\PhpOffice\PhpSpreadsheet;

use TablePress\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;

class NamedFormula extends DefinedName
{
	/**
	 * Create a new Named Formula.
	 */
	public function __construct(
		string $name,
		?Worksheet $worksheet = null,
		?string $formula = null,
		bool $localOnly = false,
		?Worksheet $scope = null
	) {
		// Validate data
		if (!isset($formula)) {
			throw new Exception('You must specify a Formula value for a Named Formula');
		}
		parent::__construct($name, $worksheet, $formula, $localOnly, $scope);
	}

	/**
	 * Get the formula value.
	 */
	public function getFormula(): string
	{
		return $this->value;
	}

	/**
	 * Set the formula value.
	 */
	public function setFormula(string $formula): self
	{
		if (!empty($formula)) {
			$this->value = $formula;
		}

		return $this;
	}
}