<commit_before><?php

// helpers

function getLadybug()
{
    global $ladybug;

    if (is_null($ladybug)) {
        $ladybug = new \Ladybug\Dumper();
    }

    return $ladybug;
}

function ladybug_set_theme($theme)
{
    $ladybug = getLadybug();
    $ladybug->setTheme($theme);
}

function ladybug_set_format($format)
{
    $ladybug = getLadybug();
    $ladybug->setFormat($format);
}

function ladybug_set_option($name, $value)
{
    $ladybug = getLadybug();
    $ladybug->setOption($name, $value);
}

function ladybug_dump(/*$var1 [, $var2...$varN]*/)
{
    $ladybug = getLadybug();
    echo call_user_func_array(array($ladybug,'dump'), func_get_args());
}

function ladybug_dump_die(/*$var1 [, $var2...$varN]*/)
{
    $ladybug = getLadybug();
    echo call_user_func_array(array($ladybug,'dump'), func_get_args());
    die();
}

// Shortcuts
if (!function_exists('ld')) {
    function ld(/*$var1 [, $var2...$varN]*/)
    {
        call_user_func_array('ladybug_dump', func_get_args());
    }
}<commit_msg>Allow passing an array of options<commit_after><?php

// helpers

function getLadybug()
{
    global $ladybug;

    if (is_null($ladybug)) {
        $ladybug = new \Ladybug\Dumper();
    }

    return $ladybug;
}

function ladybug_set_theme($theme)
{
    $ladybug = getLadybug();
    $ladybug->setTheme($theme);
}

function ladybug_set_format($format)
{
    $ladybug = getLadybug();
    $ladybug->setFormat($format);
}

function ladybug_set_option($name, $value)
{
    $ladybug = getLadybug();
    $ladybug->setOption($name, $value);
}

function ladybug_set_options(array $options)
{
    foreach ($options as $name => $value) {
        ladybug_set_option($name, $value);
    }
}

function ladybug_dump(/*$var1 [, $var2...$varN]*/)
{
    $ladybug = getLadybug();
    echo call_user_func_array(array($ladybug,'dump'), func_get_args());
}

function ladybug_dump_die(/*$var1 [, $var2...$varN]*/)
{
    $ladybug = getLadybug();
    echo call_user_func_array(array($ladybug,'dump'), func_get_args());
    die();
}

// Shortcuts
if (!function_exists('ld')) {
    function ld(/*$var1 [, $var2...$varN]*/)
    {
        call_user_func_array('ladybug_dump', func_get_args());
    }
}
{'fraction_non_alphanumeric': 0.1841502519468621, 'fraction_numerical': 0.005497022446174988, 'mean_word_length': 3.875, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5289159', 'n_tokens_mistral': 866, 'n_tokens_neox': 845, 'n_words': 125}