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 declare(strict_types=1); namespace PhpOffice\PhpSpreadsheetTests\Reader\Xlsx; use..

Decoded Output download

<?php

declare(strict_types=1);

namespace PhpOffice\PhpSpreadsheetTests\Reader\Xlsx;

use PhpOffice\PhpSpreadsheet\Reader\Xlsx;
use PhpOffice\PhpSpreadsheetTests\Functional\AbstractFunctional;

class Issue4049Test extends AbstractFunctional
{
    public function testColorScale(): void
    {
        $xlsxFile = 'tests/data/Reader/XLSX/issue.4049.xlsx';
        $reader = new Xlsx();
        $oldSpreadsheet = $reader->load($xlsxFile);
        $spreadsheet = $this->writeAndReload($oldSpreadsheet, 'Xlsx');
        $oldSpreadsheet->disconnectWorksheets();
        $sheet = $spreadsheet->getActiveSheet();
        $conditionals = $sheet->getConditionalStylesCollection();
        self::assertCount(1, $conditionals);
        self::assertSame('E9:E14', array_keys($conditionals)[0]);
        $cond1 = $conditionals['E9:E14'];
        self::assertCount(1, $cond1);
        self::assertSame('colorScale', $cond1[0]->getConditionType());
        $colorScale = $cond1[0]->getColorScale();
        self::assertNotNull($colorScale);
        $min = $colorScale->getMinimumConditionalFormatValueObject();
        self::assertSame('formula', $min->getType());
        self::assertSame('25', $min->getCellFormula());

        self::assertNull($colorScale->getMidpointConditionalFormatValueObject());

        $max = $colorScale->getMaximumConditionalFormatValueObject();
        self::assertSame('max', $max->getType());
        self::assertNull($max->getValue());

        $spreadsheet->disconnectWorksheets();
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

declare(strict_types=1);

namespace PhpOffice\PhpSpreadsheetTests\Reader\Xlsx;

use PhpOffice\PhpSpreadsheet\Reader\Xlsx;
use PhpOffice\PhpSpreadsheetTests\Functional\AbstractFunctional;

class Issue4049Test extends AbstractFunctional
{
    public function testColorScale(): void
    {
        $xlsxFile = 'tests/data/Reader/XLSX/issue.4049.xlsx';
        $reader = new Xlsx();
        $oldSpreadsheet = $reader->load($xlsxFile);
        $spreadsheet = $this->writeAndReload($oldSpreadsheet, 'Xlsx');
        $oldSpreadsheet->disconnectWorksheets();
        $sheet = $spreadsheet->getActiveSheet();
        $conditionals = $sheet->getConditionalStylesCollection();
        self::assertCount(1, $conditionals);
        self::assertSame('E9:E14', array_keys($conditionals)[0]);
        $cond1 = $conditionals['E9:E14'];
        self::assertCount(1, $cond1);
        self::assertSame('colorScale', $cond1[0]->getConditionType());
        $colorScale = $cond1[0]->getColorScale();
        self::assertNotNull($colorScale);
        $min = $colorScale->getMinimumConditionalFormatValueObject();
        self::assertSame('formula', $min->getType());
        self::assertSame('25', $min->getCellFormula());

        self::assertNull($colorScale->getMidpointConditionalFormatValueObject());

        $max = $colorScale->getMaximumConditionalFormatValueObject();
        self::assertSame('max', $max->getType());
        self::assertNull($max->getValue());

        $spreadsheet->disconnectWorksheets();
    }
}

Function Calls

None

Variables

None

Stats

MD5 36cc6d1b1eb102240add28aa35c718d3
Eval Count 0
Decode Time 81 ms