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\Worksheet\Table; ..

Decoded Output download

<?php

declare(strict_types=1);

namespace PhpOffice\PhpSpreadsheetTests\Worksheet\Table;

use PhpOffice\PhpSpreadsheet\Worksheet\Table;

class Issue3820Test extends SetupTeardown
{
    public function testTableOnOtherSheet(): void
    {
        // Clone worksheet failed when table was on sheet
        $spreadsheet = $this->getSpreadsheet();
        $sheet = $this->getSheet();
        $sheet->setTitle('Original');
        $sheet->fromArray(
            [
                ['MyCol', 'Colonne2', 'Colonne3'],
                [10, 20],
                [2],
                [3],
                [4],
            ],
            null,
            'B1',
            true
        );
        $table = new Table('B1:D5', 'Tableau1');
        $sheet->addTable($table);
        $clonedSheet = clone $sheet;
        $clonedSheet->setTitle('Cloned');
        $spreadsheet->addsheet($clonedSheet);
        $originalTable = $spreadsheet->getTableByName('Tableau1');
        $newTable = $spreadsheet->getTableByName('Tableau1clone');
        self::assertNotNull($newTable);
        self::assertSame($table, $originalTable);
        self::assertSame('Cloned', $newTable->getWorksheet()?->getTitle());
        self::assertSame('B1:D5', $newTable->getRange());
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

declare(strict_types=1);

namespace PhpOffice\PhpSpreadsheetTests\Worksheet\Table;

use PhpOffice\PhpSpreadsheet\Worksheet\Table;

class Issue3820Test extends SetupTeardown
{
    public function testTableOnOtherSheet(): void
    {
        // Clone worksheet failed when table was on sheet
        $spreadsheet = $this->getSpreadsheet();
        $sheet = $this->getSheet();
        $sheet->setTitle('Original');
        $sheet->fromArray(
            [
                ['MyCol', 'Colonne2', 'Colonne3'],
                [10, 20],
                [2],
                [3],
                [4],
            ],
            null,
            'B1',
            true
        );
        $table = new Table('B1:D5', 'Tableau1');
        $sheet->addTable($table);
        $clonedSheet = clone $sheet;
        $clonedSheet->setTitle('Cloned');
        $spreadsheet->addsheet($clonedSheet);
        $originalTable = $spreadsheet->getTableByName('Tableau1');
        $newTable = $spreadsheet->getTableByName('Tableau1clone');
        self::assertNotNull($newTable);
        self::assertSame($table, $originalTable);
        self::assertSame('Cloned', $newTable->getWorksheet()?->getTitle());
        self::assertSame('B1:D5', $newTable->getRange());
    }
}

Function Calls

None

Variables

None

Stats

MD5 ddfea52f031abb9f8ca9ca4df976dab8
Eval Count 0
Decode Time 84 ms