# tablepress/3.4/libraries/vendor/PhpSpreadsheet/Calculation/Financial/CashFlow/CashFlowValidations.php

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

- Page: https://pluginprobe.com/plugins/tablepress/3.4/code/libraries/vendor/PhpSpreadsheet/Calculation/Financial/CashFlow/CashFlowValidations.php
- Raw: https://pluginprobe.com/plugins/tablepress/3.4/raw/libraries/vendor/PhpSpreadsheet/Calculation/Financial/CashFlow/CashFlowValidations.php
- Modified: 2025-04-29T05:06:50+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/Financial/CashFlow/CashFlowValidations.php#L10-L20`.

```php
<?php

namespace TablePress\PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow;

use TablePress\PhpOffice\PhpSpreadsheet\Calculation\Exception;
use TablePress\PhpOffice\PhpSpreadsheet\Calculation\Financial\Constants as FinancialConstants;
use TablePress\PhpOffice\PhpSpreadsheet\Calculation\Financial\FinancialValidations;
use TablePress\PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;

class CashFlowValidations extends FinancialValidations
{
	/**
				 * @param mixed $rate
				 */
				public static function validateRate($rate): float
	{
		$rate = self::validateFloat($rate);

		return $rate;
	}

	/**
				 * @param mixed $type
				 */
				public static function validatePeriodType($type): int
	{
		$rate = self::validateInt($type);
		if (
			$type !== FinancialConstants::PAYMENT_END_OF_PERIOD
			&& $type !== FinancialConstants::PAYMENT_BEGINNING_OF_PERIOD
		) {
			throw new Exception(ExcelError::NAN());
		}

		return $rate;
	}

	/**
				 * @param mixed $presentValue
				 */
				public static function validatePresentValue($presentValue): float
	{
		return self::validateFloat($presentValue);
	}

	/**
				 * @param mixed $futureValue
				 */
				public static function validateFutureValue($futureValue): float
	{
		return self::validateFloat($futureValue);
	}
}

```
