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\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Style\Alignment;
use PhpOffice\PhpSpreadsheet\Style\Border;
use PhpOffice\PhpSpreadsheet\Style\Borders;
use PhpOffice\PhpSpreadsheet\Style\Protection;
use PhpOffice\PhpSpreadsheetTests\Functional\AbstractFunctional;

class CoverageGapsTest extends AbstractFunctional
{
    public function testCoverageGaps(): void
    {
        $spreadsheet = new Spreadsheet();
        $sheet = $spreadsheet->getActiveSheet();
        $sheet
            ->getStyle('A1')
            ->getBorders()
            ->setDiagonalDirection(Borders::DIAGONAL_BOTH)
            ->getDiagonal()
            ->setBorderStyle(Border::BORDER_DASHDOTDOT);
        $sheet
            ->getStyle('A2')
            ->getProtection()
            ->setLocked(Protection::PROTECTION_PROTECTED);
        $sheet
            ->getStyle('A3')
            ->getAlignment()
            ->setTextRotation(Alignment::TEXTROTATION_STACK_EXCEL);
        $reloadedSpreadsheet = $this->writeAndReload($spreadsheet, 'Xlsx');
        $spreadsheet->disconnectWorksheets();

        $rsheet = $reloadedSpreadsheet->getActiveSheet();
        self::assertSame(Borders::DIAGONAL_BOTH, $rsheet->getStyle('A1')->getBorders()->getDiagonalDirection());
        self::assertSame(Border::BORDER_DASHDOTDOT, $rsheet->getStyle('A1')->getBorders()->getDiagonal()->getBorderStyle());
        self::assertSame(Protection::PROTECTION_PROTECTED, $rsheet->getStyle('A2')->getProtection()->getLocked());
        self::assertSame(Alignment::TEXTROTATION_STACK_PHPSPREADSHEET, $rsheet->getStyle('A3')->getAlignment()->getTextRotation());

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

Did this file decode correctly?

Original Code

<?php

declare(strict_types=1);

namespace PhpOffice\PhpSpreadsheetTests\Reader\Xlsx;

use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Style\Alignment;
use PhpOffice\PhpSpreadsheet\Style\Border;
use PhpOffice\PhpSpreadsheet\Style\Borders;
use PhpOffice\PhpSpreadsheet\Style\Protection;
use PhpOffice\PhpSpreadsheetTests\Functional\AbstractFunctional;

class CoverageGapsTest extends AbstractFunctional
{
    public function testCoverageGaps(): void
    {
        $spreadsheet = new Spreadsheet();
        $sheet = $spreadsheet->getActiveSheet();
        $sheet
            ->getStyle('A1')
            ->getBorders()
            ->setDiagonalDirection(Borders::DIAGONAL_BOTH)
            ->getDiagonal()
            ->setBorderStyle(Border::BORDER_DASHDOTDOT);
        $sheet
            ->getStyle('A2')
            ->getProtection()
            ->setLocked(Protection::PROTECTION_PROTECTED);
        $sheet
            ->getStyle('A3')
            ->getAlignment()
            ->setTextRotation(Alignment::TEXTROTATION_STACK_EXCEL);
        $reloadedSpreadsheet = $this->writeAndReload($spreadsheet, 'Xlsx');
        $spreadsheet->disconnectWorksheets();

        $rsheet = $reloadedSpreadsheet->getActiveSheet();
        self::assertSame(Borders::DIAGONAL_BOTH, $rsheet->getStyle('A1')->getBorders()->getDiagonalDirection());
        self::assertSame(Border::BORDER_DASHDOTDOT, $rsheet->getStyle('A1')->getBorders()->getDiagonal()->getBorderStyle());
        self::assertSame(Protection::PROTECTION_PROTECTED, $rsheet->getStyle('A2')->getProtection()->getLocked());
        self::assertSame(Alignment::TEXTROTATION_STACK_PHPSPREADSHEET, $rsheet->getStyle('A3')->getAlignment()->getTextRotation());

        $reloadedSpreadsheet->disconnectWorksheets();
    }
}

Function Calls

None

Variables

None

Stats

MD5 3298e3297425c516bbab6d1e2a6d0173
Eval Count 0
Decode Time 111 ms