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 Typecho\Db\Adapter; /** * Build Sql */ trait QueryTrait { /** ..

Decoded Output download

<?php

namespace Typecho\Db\Adapter;

/**
 * Build Sql
 */
trait QueryTrait
{
    /**
     * @param array $sql
     * @return string
     */
    private function buildQuery(array $sql): string
    {
        if (!empty($sql['join'])) {
            foreach ($sql['join'] as $val) {
                [$table, $condition, $op] = $val;
                $sql['table'] = "{$sql['table']} {$op} JOIN {$table} ON {$condition}";
            }
        }

        $sql['limit'] = isset($sql['limit']) ? ' LIMIT ' . $sql['limit'] : '';
        $sql['offset'] = isset($sql['offset']) ? ' OFFSET ' . $sql['offset'] : '';

        return 'SELECT ' . $sql['fields'] . ' FROM ' . $sql['table'] .
            $sql['where'] . $sql['group'] . $sql['having'] . $sql['order'] . $sql['limit'] . $sql['offset'];
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace Typecho\Db\Adapter;

/**
 * Build Sql
 */
trait QueryTrait
{
    /**
     * @param array $sql
     * @return string
     */
    private function buildQuery(array $sql): string
    {
        if (!empty($sql['join'])) {
            foreach ($sql['join'] as $val) {
                [$table, $condition, $op] = $val;
                $sql['table'] = "{$sql['table']} {$op} JOIN {$table} ON {$condition}";
            }
        }

        $sql['limit'] = isset($sql['limit']) ? ' LIMIT ' . $sql['limit'] : '';
        $sql['offset'] = isset($sql['offset']) ? ' OFFSET ' . $sql['offset'] : '';

        return 'SELECT ' . $sql['fields'] . ' FROM ' . $sql['table'] .
            $sql['where'] . $sql['group'] . $sql['having'] . $sql['order'] . $sql['limit'] . $sql['offset'];
    }
}

Function Calls

None

Variables

None

Stats

MD5 079cd8d2cfb51ac02e84b7d722d25491
Eval Count 0
Decode Time 89 ms