<commit_before><?php
/**
 * This file is part of the Laravel Auditing package.
 *
 * @author     <NAME> <<EMAIL>>
 * @author     <NAME>  <<EMAIL>>
 * @author     <NAME> <<EMAIL>>
 * @copyright  2015-2017
 *
 * For the full copyright and license information,
 * please view the LICENSE.md file that was distributed
 * with this source code.
 */

namespace OwenIt\Auditing\Drivers;

use OwenIt\Auditing\Contracts\Auditable;
use OwenIt\Auditing\Contracts\AuditDriver;
use Illuminate\Support\Facades\Config;

class Database implements AuditDriver
{
    /**
     * {@inheritdoc}
     */
    public function audit(Auditable $model)
    {
        $class = Config::get('audit.implementation', \OwenIt\Auditing\Models\Audit::class);
        
        return $class::create($model->toAudit());
    }
    
    /**
     * {@inheritdoc}
     */
    public function prune(Auditable $model)
    {
        if (($threshold = $model->getAuditThreshold()) > 0) {
            $total = $model->audits()->count();
            
            $forRemoval = ($total - $threshold);
            
            if ($forRemoval > 0) {
                $model->audits()
                    ->orderBy('created_at', 'asc')
                    ->limit($forRemoval)
                    ->delete();
                
                return true;
            }
        }
        
        return false;
    }
}
<commit_msg>Fixed code style... I hope<commit_after><?php
/**
 * This file is part of the Laravel Auditing package.
 *
 * @author     <NAME> <<EMAIL>>
 * @author     <NAME>  <<EMAIL>>
 * @author     <NAME> <<EMAIL>>
 * @copyright  2015-2017
 *
 * For the full copyright and license information,
 * please view the LICENSE.md file that was distributed
 * with this source code.
 */

namespace OwenIt\Auditing\Drivers;

use Illuminate\Support\Facades\Config;
use OwenIt\Auditing\Contracts\Auditable;
use OwenIt\Auditing\Contracts\AuditDriver;

class Database implements AuditDriver
{
    /**
     * {@inheritdoc}
     */
    public function audit(Auditable $model)
    {
        $class = Config::get('audit.implementation', \OwenIt\Auditing\Models\Audit::class);
        
        return $class::create($model->toAudit());
    }

    /**
     * {@inheritdoc}
     */
    public function prune(Auditable $model)
    {
        if (($threshold = $model->getAuditThreshold()) > 0) {
            $total = $model->audits()->count();

            $forRemoval = ($total - $threshold);

            if ($forRemoval > 0) {
                $model->audits()
                    ->orderBy('created_at', 'asc')
                    ->limit($forRemoval)
                    ->delete();

                return true;
            }
        }

        return false;
    }
}

{'fraction_non_alphanumeric': 0.13791835233541744, 'fraction_numerical': 0.00735564545788893, 'mean_word_length': 1.9437229437229437, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 41, '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': '3794802', 'n_tokens_mistral': 819, 'n_tokens_neox': 789, 'n_words': 180}