<commit_before><?php

namespace OwenIt\Auditing\Auditors;

use OwenIt\Auditing\Auditing;

class DatabaseAuditor
{
    /**
     * Audit the model auditable.
     *
     * @param mixed $auditable
     *
     * @return \Illuminate\Database\Eloquent\Model
     */
    public function audit($auditable)
    {
        $report = Auditing::create(
            $auditable->toAudit()
        );

        if ($report) {
            $auditable->clearOlderAudits();
        }

        return $report;
    }
}<commit_msg>feat(Auditors): type hint the Auditable interface + cleanups<commit_after><?php

namespace OwenIt\Auditing\Auditors;

use OwenIt\Auditing\Contracts\Auditable;
use OwenIt\Auditing\Models\Audit;

class DatabaseAuditor
{
    /**
     * Perform an audit to the Auditable model.
     *
     * @param \OwenIt\Auditing\Contracts\Auditable $model
     *
     * @return \Illuminate\Database\Eloquent\Model
     */
    public function audit(Auditable $model)
    {
        $report = Audit::create($model->toAudit());

        if ($report) {
            $model->clearOlderAudits();
        }

        return $report;
    }
}
{'fraction_non_alphanumeric': 0.12053571428571429, 'fraction_numerical': 0.0, 'mean_word_length': 2.3165680473372783, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '1861363', 'n_tokens_mistral': 354, 'n_tokens_neox': 354, 'n_words': 65}