# tablepress/3.4/libraries/vendor/PhpSpreadsheet/Calculation/CalculationParserOnly.php

TablePress – Tables in WordPress made easy, version 3.4. 44 lines.

- Page: https://pluginprobe.com/plugins/tablepress/3.4/code/libraries/vendor/PhpSpreadsheet/Calculation/CalculationParserOnly.php
- Raw: https://pluginprobe.com/plugins/tablepress/3.4/raw/libraries/vendor/PhpSpreadsheet/Calculation/CalculationParserOnly.php
- Modified: 2026-03-03T04:48:30+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/tablepress/3.4/code/libraries/vendor/PhpSpreadsheet/Calculation/CalculationParserOnly.php#L10-L20`.

```php
<?php

namespace TablePress\PhpOffice\PhpSpreadsheet\Calculation;

/**
 * A dedicated Calculation singleton for formula parsing only.
 *
 * This class provides an isolated instance specifically for parsing formulas
 * without branch pruning, avoiding state conflicts with the main Calculation
 * singleton used for cell value calculations.
 *
 * @internal
 */
final class CalculationParserOnly extends Calculation
{
	/**
	 * Instance of this class.
	 */
	private static ?CalculationParserOnly $parserInstance = null;

	/**
	 * Branch pruning is disabled by default for parsing-only operations.
	 */
	protected bool $branchPruningEnabled = false;

	/**
	 * Get the singleton instance of this parser-only calculator.
	 */
	public static function getParserInstance(): self
	{
		if (!self::$parserInstance) {
			self::$parserInstance = new self();
		}

		return self::$parserInstance;
	}

	/** @param mixed $enabled Unused, property will always be false in this class */
	public function setBranchPruningEnabled($enabled): self
	{
		return $this;
	}
}

```
