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 /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@..

Decoded Output download

<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Cache\Traits;

/**
 * @internal
 */
trait RedisProxyTrait
{
    private \Closure $initializer;
    private ?parent $realInstance = null;

    public static function createLazyProxy(\Closure $initializer, ?self $instance = null): static
    {
        $instance ??= (new \ReflectionClass(static::class))->newInstanceWithoutConstructor();
        $instance->realInstance = null;
        $instance->initializer = $initializer;

        return $instance;
    }

    public function isLazyObjectInitialized(bool $partial = false): bool
    {
        return isset($this->realInstance);
    }

    public function initializeLazyObject(): object
    {
        return $this->realInstance ??= ($this->initializer)();
    }

    public function resetLazyObject(): bool
    {
        $this->realInstance = null;

        return true;
    }

    public function __destruct()
    {
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Cache\Traits;

/**
 * @internal
 */
trait RedisProxyTrait
{
    private \Closure $initializer;
    private ?parent $realInstance = null;

    public static function createLazyProxy(\Closure $initializer, ?self $instance = null): static
    {
        $instance ??= (new \ReflectionClass(static::class))->newInstanceWithoutConstructor();
        $instance->realInstance = null;
        $instance->initializer = $initializer;

        return $instance;
    }

    public function isLazyObjectInitialized(bool $partial = false): bool
    {
        return isset($this->realInstance);
    }

    public function initializeLazyObject(): object
    {
        return $this->realInstance ??= ($this->initializer)();
    }

    public function resetLazyObject(): bool
    {
        $this->realInstance = null;

        return true;
    }

    public function __destruct()
    {
    }
}

Function Calls

None

Variables

None

Stats

MD5 8d8ba28f227e90e9cb8fc6de0f06123b
Eval Count 0
Decode Time 94 ms