<commit_before><?php

use Illuminate\Database\Seeder;

class ActivityTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $posts = \Coyote\Post::limit(10)->get();
        $comments = \Coyote\Post\Comment::limit(10)->get();

        $items = collect($posts)->merge($comments)->sortBy('created_at');

        foreach ($items as $item) {
            $data = ['created_at' => $item->created_at->toDateTimeString(), 'user_id' => $item->user_id];

            if (isset($item['topic_id'])) {
                $data += [
                    'topic_id' => $item->topic_id,
                    'forum_id' => $item->forum_id,
                    'excerpt' => excerpt($item->text),
                    'content_id' => $item->id,
                    'content_type' => \Coyote\Post::class,
                    'user_name' => $item->user_name
                ];
            } else {
                $data += [
                    'topic_id' => $item->post->topic_id,
                    'forum_id' => $item->post->topic->forum_id,
                    'excerpt' => excerpt($item->text),
                    'content_id' => $item->id,
                    'content_type' => \Coyote\Post\Comment::class
                ];
            }

            $this->db->table('activities')->insert($data);
        }
    }<commit_msg>dodatkowy warunek (tymczasowo)<commit_after><?php

use Illuminate\Database\Seeder;

class ActivityTableSeeder extends Seeder
{
    use SchemaBuilder;

    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $posts = \Coyote\Post::limit(10)->get();
        $comments = \Coyote\Post\Comment::limit(10)->get();

        $items = collect($posts)->merge($comments)->sortBy('created_at');

        foreach ($items as $item) {
            $data = ['created_at' => $item->created_at->toDateTimeString(), 'user_id' => $item->user_id];

            if (isset($item['topic_id'])) {
                $data += [
                    'topic_id' => $item->topic_id,
                    'forum_id' => $item->forum_id,
                    'excerpt' => excerpt($item->text),
                    'content_id' => $item->id,
                    'content_type' => \Coyote\Post::class,
                    'user_name' => $item->user_name
                ];

                $this->db->table('activities')->insert($data);
            } elseif (!empty($item->post->topic_id)) {
                $data += [
                    'topic_id' => $item->post->topic_id,
                    'forum_id' => $item->post->topic->forum_id,
                    'excerpt' => excerpt($item->text),
                    'content_id' => $item->id,
                    'content_type' => \Coyote\Post\Comment::class
                ];

                $this->db->table('activities')->insert($data);
            }
        }
    }
{'fraction_non_alphanumeric': 0.17059024223814398, 'fraction_numerical': 0.002729443875810304, 'mean_word_length': 1.540727902946274, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 78, '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': '3854135', 'n_tokens_mistral': 901, 'n_tokens_neox': 841, 'n_words': 124}