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\Reader\Xls\Style; use PhpOffice\PhpSpreadsheet\..

Decoded Output download

<?php

namespace PhpOffice\PhpSpreadsheet\Reader\Xls\Style;

use PhpOffice\PhpSpreadsheet\Style\Alignment;

class CellAlignment
{
    /**
     * @var array<int, string>
     */
    protected static array $horizontalAlignmentMap = [
        0 => Alignment::HORIZONTAL_GENERAL,
        1 => Alignment::HORIZONTAL_LEFT,
        2 => Alignment::HORIZONTAL_CENTER,
        3 => Alignment::HORIZONTAL_RIGHT,
        4 => Alignment::HORIZONTAL_FILL,
        5 => Alignment::HORIZONTAL_JUSTIFY,
        6 => Alignment::HORIZONTAL_CENTER_CONTINUOUS,
    ];

    /**
     * @var array<int, string>
     */
    protected static array $verticalAlignmentMap = [
        0 => Alignment::VERTICAL_TOP,
        1 => Alignment::VERTICAL_CENTER,
        2 => Alignment::VERTICAL_BOTTOM,
        3 => Alignment::VERTICAL_JUSTIFY,
    ];

    public static function horizontal(Alignment $alignment, int $horizontal): void
    {
        if (array_key_exists($horizontal, self::$horizontalAlignmentMap)) {
            $alignment->setHorizontal(self::$horizontalAlignmentMap[$horizontal]);
        }
    }

    public static function vertical(Alignment $alignment, int $vertical): void
    {
        if (array_key_exists($vertical, self::$verticalAlignmentMap)) {
            $alignment->setVertical(self::$verticalAlignmentMap[$vertical]);
        }
    }

    public static function wrap(Alignment $alignment, int $wrap): void
    {
        $alignment->setWrapText((bool) $wrap);
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace PhpOffice\PhpSpreadsheet\Reader\Xls\Style;

use PhpOffice\PhpSpreadsheet\Style\Alignment;

class CellAlignment
{
    /**
     * @var array<int, string>
     */
    protected static array $horizontalAlignmentMap = [
        0 => Alignment::HORIZONTAL_GENERAL,
        1 => Alignment::HORIZONTAL_LEFT,
        2 => Alignment::HORIZONTAL_CENTER,
        3 => Alignment::HORIZONTAL_RIGHT,
        4 => Alignment::HORIZONTAL_FILL,
        5 => Alignment::HORIZONTAL_JUSTIFY,
        6 => Alignment::HORIZONTAL_CENTER_CONTINUOUS,
    ];

    /**
     * @var array<int, string>
     */
    protected static array $verticalAlignmentMap = [
        0 => Alignment::VERTICAL_TOP,
        1 => Alignment::VERTICAL_CENTER,
        2 => Alignment::VERTICAL_BOTTOM,
        3 => Alignment::VERTICAL_JUSTIFY,
    ];

    public static function horizontal(Alignment $alignment, int $horizontal): void
    {
        if (array_key_exists($horizontal, self::$horizontalAlignmentMap)) {
            $alignment->setHorizontal(self::$horizontalAlignmentMap[$horizontal]);
        }
    }

    public static function vertical(Alignment $alignment, int $vertical): void
    {
        if (array_key_exists($vertical, self::$verticalAlignmentMap)) {
            $alignment->setVertical(self::$verticalAlignmentMap[$vertical]);
        }
    }

    public static function wrap(Alignment $alignment, int $wrap): void
    {
        $alignment->setWrapText((bool) $wrap);
    }
}

Function Calls

None

Variables

None

Stats

MD5 caa0f1893fb737eaa40c8f07a3d313d9
Eval Count 0
Decode Time 93 ms