<commit_before><?php

/**
 * Created by Prowect
 * Author: <NAME>
 * Date: 03.05.15 - 13:13.
 * Copyright Prowect
 */

/**
 * Alternative zu var_dump mit formatierter HTML-Ausgabe
 *
 * @param   mixed  $var
 * @param  integer $indentBy
 * @param  integer $indentationLevel
 */
function dump($var, $indentBy = 2, $indentationLevel = 0)
{
    $stringStyle = 'color:#8cc152;';
    $propertyStyle = 'color:#967adc;';
    $classStyle = 'color:#f6bb42;';
    $nullStyle = 'color:#aab2bd;';
    $integerStyle = 'color:#e9573f;';
    $doubleStyle = 'color:#e9573f;';
    $boolStyle = 'color:#aab2bd;';
    $arrayStyle = '';
    $resourceStyle = '';
    $privateStyle = '';
    $unknownTypeStyle = '';

    if (PHP_SAPI == "cli") {
        var_dump($var);
    } else {
        if ($indentationLevel == 0) {
            echo '<pre style="background-color:#434a54;color:#f5f7fa;padding:1em;">'.PHP_EOL;
        }
        $parentIndentation = str_repeat(" ", $indentationLevel);
        $indentation = str_repeat(" ", $indentBy);
        if ($var === null) {
            echo '<span style="'.$nullStyle.'">NULL</span>'.PHP_EOL;
        } elseif (is_array($var)) {
            $array = (array) $var;
            $type = 'array';
            $len = sizeof($array);
            echo $type.' ('.$len.') '.'{';
            if ($len > 0) {
                echo PHP_EOL;
                foreach ($array as $key => $value) {
                    echo $parentIndentation.$indentation.'['.$key.'] =&gt; ';
                    dump($value, $indentBy, $indentationLevel + $indentBy);
                }
                echo $parentIndentation;
            }
            echo '}'.PHP_EOL;
        } elseif (is_object($var)) {
            $type = 'object';
            $reflect = new ReflectionClass($var);
            $properties = $reflect->getProperties();
            $len = sizeof($properties);
            echo $type.'<span style="'.$classStyle.'">('.$reflect->getName().')</span>'.' ('.$len.') '.'{'.PHP_EOL;
            foreach ($properties as $property) {
                echo $parentIndentation.$indentation.'<span style="'.$propertyStyle.'">['.($property->isStatic() ? 'static ' : '').($property->isPublic() ? 'public ' : ($property->isProtected() ? 'protected ' : ($property->isPrivate() ? 'private ' : ''))).'$'.$property->getName().']</span> =&gt; ';
                $property->setAccessible(true);
                dump($property->getValue($var), $indentBy, $indentationLevel + $indentBy);
            }
            echo $parentIndentation.'}'.PHP_EOL;
        } elseif (is_string($var)) {
            echo gettype($var).' ('.strlen($var).') <span style="'.$stringStyle.'">"'.$var.'"</span>'.PHP_EOL;
        } elseif (is_bool($var)) {
            echo gettype($var).' <span style="'.$boolStyle.'">'.(($var == 1) ? 'true' : 'false').'</span>'.PHP_EOL;
        } else {
            $type = gettype($var);
            echo $type.' ('.sizeof($var).') <span style="'.${str_replace(' t', 'T', gettype($var)).'Style'}.'">'.$var.'</span>'.PHP_EOL;
        }
        if ($indentationLevel == 0) {
            echo '</pre>';
        }
    }
}<commit_msg>UNGETESTET Dump auf Debugbar einschränken<commit_after><?php

/**
 * Created by Prowect
 * Author: <NAME>
 * Date: 03.05.15 - 13:13.
 * Copyright Prowect
 */

/**
 * Alternative zu var_dump mit formatierter HTML-Ausgabe
 *
 * @param   mixed  $var
 * @param  integer $indentBy
 * @param  integer $indentationLevel
 */
function dump($var, $indentBy = 2, $indentationLevel = 0) {
    $stringStyle = 'color:#8cc152;';
    $propertyStyle = 'color:#967adc;';
    $classStyle = 'color:#f6bb42;';
    $nullStyle = 'color:#aab2bd;';
    $integerStyle = 'color:#e9573f;';
    $doubleStyle = 'color:#e9573f;';
    $boolStyle = 'color:#aab2bd;';
    $arrayStyle = '';
    $resourceStyle = '';
    $privateStyle = '';
    $unknownTypeStyle = '';

    if (PHP_SAPI == 'cli') {
        var_dump($var);
    } else {
        if (class_exists('\Drips\Debugbar\Debugbar')) {
            $output = '';
            
            if ($indentationLevel == 0) {
                $output .= '<pre style="background-color:#434a54;color:#f5f7fa;padding:1em;">'.PHP_EOL;
            }
            $parentIndentation = str_repeat(" ", $indentationLevel);
            $indentation = str_repeat(" ", $indentBy);
            if ($var === null) {
                $output .= '<span style="'.$nullStyle.'">NULL</span>'.PHP_EOL;
            } elseif (is_array($var)) {
                $array = (array) $var;
                $type = 'array';
                $len = sizeof($array);
                $output .= $type.' ('.$len.') '.'{';
                if ($len > 0) {
                    echo PHP_EOL;
                    foreach ($array as $key => $value) {
                        $output .= $parentIndentation.$indentation.'['.$key.'] =&gt; ';
                        $output .= dump($value, $indentBy, $indentationLevel + $indentBy);
                    }
                    $output .= $parentIndentation;
                }
                $output .= '}'.PHP_EOL;
            } elseif (is_object($var)) {
                $type = 'object';
                $reflect = new ReflectionClass($var);
                $properties = $reflect->getProperties();
                $len = sizeof($properties);
                $output .= $type.'<span style="'.$classStyle.'">('.$reflect->getName().')</span>'.' ('.$len.') '.'{'.PHP_EOL;
                foreach ($properties as $property) {
                    echo $parentIndentation.$indentation.'<span style="'.$propertyStyle.'">['.($property->isStatic() ? 'static ' : '').($property->isPublic() ? 'public ' : ($property->isProtected() ? 'protected ' : ($property->isPrivate() ? 'private ' : ''))).'$'.$property->getName().']</span> =&gt; ';
                    $property->setAccessible(true);
                    $output .= dump($property->getValue($var), $indentBy, $indentationLevel + $indentBy);
                }
                $output .= $parentIndentation.'}'.PHP_EOL;
            } elseif (is_string($var)) {
                $output .= gettype($var).' ('.strlen($var).') <span style="'.$stringStyle.'">"'.$var.'"</span>'.PHP_EOL;
            } elseif (is_bool($var)) {
                $output .= gettype($var).' <span style="'.$boolStyle.'">'.(($var == 1) ? 'true' : 'false').'</span>'.PHP_EOL;
            } else {
                $type = gettype($var);
                $output .= $type.' ('.sizeof($var).') <span style="'.${str_replace(' t', 'T', gettype($var)).'Style'}.'">'.$var.'</span>'.PHP_EOL;
            }
            if ($indentationLevel == 0) {
                $output .= '</pre>';
            }
            
            return $output;
        }
    }
}
{'fraction_non_alphanumeric': 0.2045929018789144, 'fraction_numerical': 0.0131225767968983, 'mean_word_length': 2.0389669234254644, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 55, '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': '290423', 'n_tokens_mistral': 2167, 'n_tokens_neox': 2076, 'n_words': 365}