<?php

declare(strict_types=1);

use Phinx\Seed\AbstractSeed;

// phpcs:ignore PSR1.Classes.ClassDeclaration.MissingNamespace
final class BasicAdminUser extends AbstractSeed
{
    public function run(): void
    {
        $login = 'admin';
        $plainPassword = 'password';
        $hashedPassword = password_hash($plainPassword, PASSWORD_DEFAULT);

        $data = [
            [
                'username' => $login,
                'password' => $hashedPassword,
            ],
        ];

        $users = $this->table('users');
        $users->insert($data)->saveData();
    }
}
