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 PhpRedisJSON library * * @project phpredis-json * @..

Decoded Output download

<?php
/**
 * This file is part of PhpRedisJSON library
 *
 * @project   phpredis-json
 * @author    Rafael Campoy <[email protected]>
 * @copyright 2019 Rafael Campoy <[email protected]>
 * @license   MIT
 * @link      https://github.com/averias/phpredis-json
 *
 * Copyright and license information, is included in
 * the LICENSE file that is distributed with this source code.
 */

namespace Averias\RedisJson\Factory;

use Averias\RedisJson\Adapter\AdapterProvider;
use Averias\RedisJson\Client\RedisJsonClient;
use Averias\RedisJson\Client\RedisJsonClientInterface;
use Averias\RedisJson\Exception\RedisClientException;
use Averias\RedisJson\Validator\RedisClientValidator;
use Exception;

class RedisJsonClientFactory implements RedisJsonClientFactoryInterface
{
    /** @var AdapterProvider */
    protected $adapterProvider;

    public function __construct()
    {
        $this->adapterProvider = new AdapterProvider(new RedisClientValidator());
    }

    /**
     * @param array|null $config
     * @return RedisJsonClientInterface
     * @throws RedisClientException
     */
    public function createClient(array $config = []): RedisJsonClientInterface
    {
        try {
            $adapter = $this->adapterProvider->get($config);
        } catch (Exception $e) {
            throw new RedisClientException($e->getMessage());
        }

        return new RedisJsonClient($adapter);
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php
/**
 * This file is part of PhpRedisJSON library
 *
 * @project   phpredis-json
 * @author    Rafael Campoy <[email protected]>
 * @copyright 2019 Rafael Campoy <[email protected]>
 * @license   MIT
 * @link      https://github.com/averias/phpredis-json
 *
 * Copyright and license information, is included in
 * the LICENSE file that is distributed with this source code.
 */

namespace Averias\RedisJson\Factory;

use Averias\RedisJson\Adapter\AdapterProvider;
use Averias\RedisJson\Client\RedisJsonClient;
use Averias\RedisJson\Client\RedisJsonClientInterface;
use Averias\RedisJson\Exception\RedisClientException;
use Averias\RedisJson\Validator\RedisClientValidator;
use Exception;

class RedisJsonClientFactory implements RedisJsonClientFactoryInterface
{
    /** @var AdapterProvider */
    protected $adapterProvider;

    public function __construct()
    {
        $this->adapterProvider = new AdapterProvider(new RedisClientValidator());
    }

    /**
     * @param array|null $config
     * @return RedisJsonClientInterface
     * @throws RedisClientException
     */
    public function createClient(array $config = []): RedisJsonClientInterface
    {
        try {
            $adapter = $this->adapterProvider->get($config);
        } catch (Exception $e) {
            throw new RedisClientException($e->getMessage());
        }

        return new RedisJsonClient($adapter);
    }
}

Function Calls

None

Variables

None

Stats

MD5 25b9f8b278e6a3c42cb24f0b3b3c091f
Eval Count 0
Decode Time 103 ms