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 TestApp\Datasource; use Cake\Datasource\Connect..

Decoded Output download

<?php
declare(strict_types=1);

namespace TestApp\Datasource;

use Cake\Datasource\ConnectionInterface;
use Psr\Log\LoggerInterface;
use Psr\SimpleCache\CacheInterface;
use RuntimeException;

class FakeConnection implements ConnectionInterface
{
    protected $_config = [];

    /**
     * Constructor.
     *
     * @param array $config configuration for connecting to database
     */
    public function __construct($config = [])
    {
        $this->_config = $config;
    }

    /**
     * Returns the set config
     *
     * @return array
     */
    public function config(): array
    {
        return $this->_config;
    }

    /**
     * Returns the set name
     */
    public function configName(): string
    {
        if (empty($this->_config['name'])) {
            return '';
        }

        return $this->_config['name'];
    }

    public function getDriver(string $role = self::ROLE_WRITE): object
    {
        throw new RuntimeException('Not implemented');
    }

    public function getLogger(): LoggerInterface
    {
        throw new RuntimeException('Not implemented');
    }

    public function setLogger(LoggerInterface $logger): void
    {
    }

    public function setCacher(CacheInterface $cacher)
    {
        throw new RuntimeException('Not implemented');
    }

    public function getCacher(): CacheInterface
    {
        throw new RuntimeException('Not implemented');
    }

    public function enableQueryLogging(bool $enable = true)
    {
        return $this;
    }

    public function disableQueryLogging()
    {
        return $this;
    }

    public function isQueryLoggingEnabled(): bool
    {
        return false;
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php
declare(strict_types=1);

namespace TestApp\Datasource;

use Cake\Datasource\ConnectionInterface;
use Psr\Log\LoggerInterface;
use Psr\SimpleCache\CacheInterface;
use RuntimeException;

class FakeConnection implements ConnectionInterface
{
    protected $_config = [];

    /**
     * Constructor.
     *
     * @param array $config configuration for connecting to database
     */
    public function __construct($config = [])
    {
        $this->_config = $config;
    }

    /**
     * Returns the set config
     *
     * @return array
     */
    public function config(): array
    {
        return $this->_config;
    }

    /**
     * Returns the set name
     */
    public function configName(): string
    {
        if (empty($this->_config['name'])) {
            return '';
        }

        return $this->_config['name'];
    }

    public function getDriver(string $role = self::ROLE_WRITE): object
    {
        throw new RuntimeException('Not implemented');
    }

    public function getLogger(): LoggerInterface
    {
        throw new RuntimeException('Not implemented');
    }

    public function setLogger(LoggerInterface $logger): void
    {
    }

    public function setCacher(CacheInterface $cacher)
    {
        throw new RuntimeException('Not implemented');
    }

    public function getCacher(): CacheInterface
    {
        throw new RuntimeException('Not implemented');
    }

    public function enableQueryLogging(bool $enable = true)
    {
        return $this;
    }

    public function disableQueryLogging()
    {
        return $this;
    }

    public function isQueryLoggingEnabled(): bool
    {
        return false;
    }
}

Function Calls

None

Variables

None

Stats

MD5 3fb9966772bdd58fc3ca7dbb48e8b737
Eval Count 0
Decode Time 113 ms