<commit_before><?php

namespace Dormant;

use Ornament\Storage;
use Ornament\Table;
use Dabble\Adapter;

trait Dabble
{
    use Storage;
    use Table;

    protected function addDabbleAdapter(
        Adapter $adapter,
        $id = null,
        array $fields = null
    ) {
        if (!isset($id)) {
            $annotations = $this->annotations()['class'];
            $id = isset($annotations['Identifier']) ?
                $annotations['Identifier'] :
                $this->guessTableName();
        }
        $annotations = $this->annotations()['properties'];
        if (!isset($fields)) {
            $fields = [];
            foreach ($this->properties($this) as $prop) {
                if (property_exists($this, $prop)
                    && !isset($annotations[$prop]['Virtual'])
                ) {
                    $fields[] = $prop;
                }
            }
        }<commit_msg>check for arrayness too<commit_after><?php

namespace Dormant;

use Ornament\Storage;
use Ornament\Table;
use Dabble\Adapter;

trait Dabble
{
    use Storage;
    use Table;

    protected function addDabbleAdapter(
        Adapter $adapter,
        $id = null,
        array $fields = null
    ) {
        if (!isset($id)) {
            $annotations = $this->annotations()['class'];
            $id = isset($annotations['Identifier']) ?
                $annotations['Identifier'] :
                $this->guessTableName();
        }
        $annotations = $this->annotations()['properties'];
        if (!isset($fields)) {
            $fields = [];
            foreach ($this->properties($this) as $prop) {
                if (property_exists($this, $prop)
                    && !isset($annotations[$prop]['Virtual'])
                    && !is_array($this->$prop)
                ) {
                    $fields[] = $prop;
                }
            }
        }
{'fraction_non_alphanumeric': 0.14437932871603623, 'fraction_numerical': 0.0, 'mean_word_length': 1.6488011283497885, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, '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': '4575374', 'n_tokens_mistral': 509, 'n_tokens_neox': 494, 'n_words': 100}