<?php
namespace PhpOffice\PhpSpreadsheet\Writer;
abstract class BaseWriter implements IWriter
{
/**
* Write charts that are defined in the workbook?
* Identifies whether the Writer should write definitions for any charts that exist in the PhpSpreadsheet object.
*
* @var bool
*/
protected $includeCharts = false;
/**
* Pre-calculate formulas
* Forces PhpSpreadsheet to recalculate all formulae in a workbook when saving, so that the pre-calculated values are
* immediately available to MS Excel or other office spreadsheet viewer when opening the file.
*
* @var bool
*/
protected $preCalculateFormulas = true;
/**
* Use disk caching where possible?
*
* @var bool
*/
private $useDiskCaching = false;
/**
* Disk caching directory.
*
* @var string
*/
private $diskCachingDirectory = './';
/**
* @var resource
*/
protected $fileHandle;
/**
* @var bool
*/
private $shouldCloseFile;
public function getIncludeCharts()
{
return $this->includeCharts;
}
public function setIncludeCharts($includeCharts)
{
$this->includeCharts = (bool) $includeCharts;
return $this;
}
public function getPreCalculateFormulas()
{
return $this->preCalculateFormulas;
}
public function setPreCalculateFormulas($precalculateFormulas)
{
$this->preCalculateFormulas = (bool) $precalculateFormulas;
return $this;
}
public function getUseDiskCaching()
{
return $this->useDiskCaching;
}
public function setUseDiskCaching($useDiskCache, $cacheDirectory = null)
{
$this->useDiskCaching = $useDiskCache;
if ($cacheDirectory !== null) {
if (is_dir($cacheDirectory)) {
$this->diskCachingDirectory = $cacheDirectory;
} else {
throw new Exception("Directory does not exist: $cacheDirectory");
}
}
return $this;
}
public function getDiskCachingDirectory()
{
return $this->diskCachingDirectory;
}
protected function processFlags(int $flags): void
{
if (((bool) ($flags & self::SAVE_WITH_CHARTS)) === true) {
$this->setIncludeCharts(true);
}
if (((bool) ($flags & self::DISABLE_PRECALCULATE_FORMULAE)) === true) {
$this->setPreCalculateFormulas(false);
}
}
/**
* Open file handle.
*
* @param resource|string $filename
*/
public function openFileHandle($filename): void
{
if (is_resource($filename)) {
$this->fileHandle = $filename;
$this->shouldCloseFile = false;
return;
}
$mode = 'wb';
$scheme = parse_url($filename, PHP_URL_SCHEME);
if ($scheme === 's3') {
// @codeCoverageIgnoreStart
$mode = 'w';
// @codeCoverageIgnoreEnd
}
$fileHandle = $filename ? fopen($filename, $mode) : false;
if ($fileHandle === false) {
throw new Exception('Could not open file "' . $filename . '" for writing.');
}
$this->fileHandle = $fileHandle;
$this->shouldCloseFile = true;
}
/**
* Close file handle only if we opened it ourselves.
*/
protected function maybeCloseFileHandle(): void
{
if ($this->shouldCloseFile) {
if (!fclose($this->fileHandle)) {
throw new Exception('Could not close file after writing.');
}
}
}
}
At NFC Pay, we strive to provide a seamless and satisfactory experience with our services. This Refund Policy outlines the circumstances under which refunds may be issued for transactions made through our platform. Please read this policy carefully to understand your rights regarding refunds.
1. Eligibility for Refunds
Refunds may be considered under the following circumstances:
2. Non-Refundable Situations
Refunds will generally not be issued in the following situations:
3. Refund Process
To request a refund, please follow these steps:
4. Refund Exceptions
Certain transactions may be subject to specific terms and conditions, including non-refundable fees or charges. Please review the terms associated with each transaction carefully, as some fees may not be eligible for refunds.
5. Modifications to the Refund Policy
NFC Pay reserves the right to modify this Refund Policy at any time. Changes will be communicated through updates on our website and app, and the effective date will be updated accordingly. We encourage you to review this policy periodically to stay informed about our refund practices.
By using NFC Pay, you agree to this Refund Policy and understand the terms under which refunds may be issued. Our goal is to ensure a fair and transparent refund process, providing you with confidence and peace of mind when using our services.