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 /** * @package Grav\Common\Assets * * @copyright Copyright (c) 2015 - 2024 T..

Decoded Output download

<?php

/**
 * @package    Grav\Common\Assets
 *
 * @copyright  Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
 * @license    MIT License; see LICENSE file for details.
 */

namespace Grav\Common\Assets;

use Grav\Common\Utils;

/**
 * Class Css
 * @package Grav\Common\Assets
 */
class Css extends BaseAsset
{
    /**
     * Css constructor.
     * @param array $elements
     * @param string|null $key
     */
    public function __construct(array $elements = [], ?string $key = null)
    {
        $base_options = [
            'asset_type' => 'css',
            'attributes' => [
                'type' => 'text/css',
                'rel' => 'stylesheet'
            ]
        ];

        $merged_attributes = Utils::arrayMergeRecursiveUnique($base_options, $elements);

        parent::__construct($merged_attributes, $key);
    }

    /**
     * @return string
     */
    public function render()
    {
        if (isset($this->attributes['loading']) && $this->attributes['loading'] === 'inline') {
            $buffer = $this->gatherLinks([$this], self::CSS_ASSET);
            return "<style>\n" . trim($buffer) . "\n</style>\n";
        }

        return '<link href="' . trim($this->asset) . $this->renderQueryString() . '"' . $this->renderAttributes() . $this->integrityHash($this->asset) . ">\n";
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

/**
 * @package    Grav\Common\Assets
 *
 * @copyright  Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
 * @license    MIT License; see LICENSE file for details.
 */

namespace Grav\Common\Assets;

use Grav\Common\Utils;

/**
 * Class Css
 * @package Grav\Common\Assets
 */
class Css extends BaseAsset
{
    /**
     * Css constructor.
     * @param array $elements
     * @param string|null $key
     */
    public function __construct(array $elements = [], ?string $key = null)
    {
        $base_options = [
            'asset_type' => 'css',
            'attributes' => [
                'type' => 'text/css',
                'rel' => 'stylesheet'
            ]
        ];

        $merged_attributes = Utils::arrayMergeRecursiveUnique($base_options, $elements);

        parent::__construct($merged_attributes, $key);
    }

    /**
     * @return string
     */
    public function render()
    {
        if (isset($this->attributes['loading']) && $this->attributes['loading'] === 'inline') {
            $buffer = $this->gatherLinks([$this], self::CSS_ASSET);
            return "<style>\n" . trim($buffer) . "\n</style>\n";
        }

        return '<link href="' . trim($this->asset) . $this->renderQueryString() . '"' . $this->renderAttributes() . $this->integrityHash($this->asset) . ">\n";
    }
}

Function Calls

None

Variables

None

Stats

MD5 28f0ce1eec29c49b24405bfb1b2cb795
Eval Count 0
Decode Time 89 ms