Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php namespace PhpOffice\PhpSpreadsheet\Worksheet; use PhpOffice\PhpSpreadsheet\Cell\Ce..
Decoded Output download
<?php
namespace PhpOffice\PhpSpreadsheet\Worksheet;
use PhpOffice\PhpSpreadsheet\Cell\CellAddress;
use PhpOffice\PhpSpreadsheet\Cell\CellRange;
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
class AutoFit
{
protected Worksheet $worksheet;
public function __construct(Worksheet $worksheet)
{
$this->worksheet = $worksheet;
}
public function getAutoFilterIndentRanges(): array
{
$autoFilterIndentRanges = [];
$autoFilterIndentRanges[] = $this->getAutoFilterIndentRange($this->worksheet->getAutoFilter());
foreach ($this->worksheet->getTableCollection() as $table) {
/** @var Table $table */
if ($table->getShowHeaderRow() === true && $table->getAllowFilter() === true) {
$autoFilter = $table->getAutoFilter();
if ($autoFilter !== null) {
$autoFilterIndentRanges[] = $this->getAutoFilterIndentRange($autoFilter);
}
}
}
return array_filter($autoFilterIndentRanges);
}
private function getAutoFilterIndentRange(AutoFilter $autoFilter): ?string
{
$autoFilterRange = $autoFilter->getRange();
$autoFilterIndentRange = null;
if (!empty($autoFilterRange)) {
$autoFilterRangeBoundaries = Coordinate::rangeBoundaries($autoFilterRange);
$autoFilterIndentRange = (string) new CellRange(
CellAddress::fromColumnAndRow($autoFilterRangeBoundaries[0][0], $autoFilterRangeBoundaries[0][1]),
CellAddress::fromColumnAndRow($autoFilterRangeBoundaries[1][0], $autoFilterRangeBoundaries[0][1])
);
}
return $autoFilterIndentRange;
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace PhpOffice\PhpSpreadsheet\Worksheet;
use PhpOffice\PhpSpreadsheet\Cell\CellAddress;
use PhpOffice\PhpSpreadsheet\Cell\CellRange;
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
class AutoFit
{
protected Worksheet $worksheet;
public function __construct(Worksheet $worksheet)
{
$this->worksheet = $worksheet;
}
public function getAutoFilterIndentRanges(): array
{
$autoFilterIndentRanges = [];
$autoFilterIndentRanges[] = $this->getAutoFilterIndentRange($this->worksheet->getAutoFilter());
foreach ($this->worksheet->getTableCollection() as $table) {
/** @var Table $table */
if ($table->getShowHeaderRow() === true && $table->getAllowFilter() === true) {
$autoFilter = $table->getAutoFilter();
if ($autoFilter !== null) {
$autoFilterIndentRanges[] = $this->getAutoFilterIndentRange($autoFilter);
}
}
}
return array_filter($autoFilterIndentRanges);
}
private function getAutoFilterIndentRange(AutoFilter $autoFilter): ?string
{
$autoFilterRange = $autoFilter->getRange();
$autoFilterIndentRange = null;
if (!empty($autoFilterRange)) {
$autoFilterRangeBoundaries = Coordinate::rangeBoundaries($autoFilterRange);
$autoFilterIndentRange = (string) new CellRange(
CellAddress::fromColumnAndRow($autoFilterRangeBoundaries[0][0], $autoFilterRangeBoundaries[0][1]),
CellAddress::fromColumnAndRow($autoFilterRangeBoundaries[1][0], $autoFilterRangeBoundaries[0][1])
);
}
return $autoFilterIndentRange;
}
}
Function Calls
None |
Stats
MD5 | 233152897103488e3bcae9f3d2a6972b |
Eval Count | 0 |
Decode Time | 85 ms |