fuel / parser

Fuel PHP Framework - v1.x template parser package adapters
http://fuelphp.com
64 stars 45 forks source link

This param 'default' is optional in a function 'config_get', is not this? #90

Closed YukiKojima closed 8 years ago

YukiKojima commented 8 years ago

Sorry,I'm not good at English. Is the 9th line correct? ($default = ...)

    /**
     * Usage: {config item='' default=''}
     * Required: item
     *
     * @return  mixed string or array
     */
    public function config_get($params) {
        if (isset($params['item'])) {
            $default = $params['default'] ? null : $params['default'];
            return Config::get($params['item'], $default);
        }
        return '';
    }
WanWizard commented 8 years ago

Yes, it is equal to

if (empty($params['default']))
{
    $default = null;
}
else
{
    $default = $params['default'];
}