<commit_before><?php

declare(strict_types=1);

namespace Inowas\ModflowBundle\DataFixtures\Scenarios;

use FOS\UserBundle\Model\UserManager;
use Inowas\Common\Fixtures\DataFixtureInterface;
use Inowas\Common\Id\UserId;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;


abstract class LoadScenarioBase implements ContainerAwareInterface, DataFixtureInterface
{

    /**
     * @var ContainerInterface
     */
    protected $container;

    /** @var  UserId */
    protected $ownerId;

    /** @var  array */
    protected $userIdList;

    /**
     * {@inheritDoc}
     */
    public function setContainer(ContainerInterface $container = null)
    {
        $this->container = $container;
    }

    protected function loadUsers(UserManager $userManager): void
    {

        $userListHeads = array('username', 'name', 'email', 'password', 'roles');
        $userList = array(
            array('guest', 'guest', '<EMAIL>', 'guest', []),
            array('inowas', 'inowas', '<EMAIL>', '#inowas#', ['ROLE_NM_MF']),
            array('ralf.junghanns', '<NAME>', '<EMAIL>', '#inowas#', ['ROLE_NM_MF']),
            array('jana.glass', '<NAME>', '<EMAIL>', '#inowas#', ['ROLE_NM_MF']),
            array('j<EMAIL>.sallwey', '<NAME>', '<EMAIL>', '#inowas#', ['ROLE_NM_MF']),
            array('catalin.stefan', '<NAME>', '<EMAIL>', '#inowas#', ['ROLE_NM_MF']),
            array('martin.wudenka', '<NAME>', '<EMAIL>', '#inowas#', ['ROLE_NM_MF']),
            array('sandro.keil', '<NAME>', '<EMAIL>', '#inowas#', ['ROLE_NM_MF']),
            array('maike.groeschke', '<NAME>', '<EMAIL>', 'mg_inowas_221', ['ROLE_NM_MF']),
            array('nawapi', 'nawapi', '<EMAIL>', 'na-ql-ww-pi', ['ROLE_NM_MF']),
            array('inowas1', 'inowas1', '<EMAIL>', 'cheekohk', ['ROLE_NM_MF']),
            array('malena', 'malena', 'mal<EMAIL>', 'wohchoad', ['ROLE_NM_MF']),
            array('jorge', 'jorge', '<EMAIL>', 'geuwaexu', ['ROLE_NM_MF']),
            array('ahmad', 'ahmad', '<EMAIL>', 'eipobung', ['ROLE_NM_MF']),
            array('jonas', 'jonas', '<EMAIL>', 'eyipuamo', ['ROLE_NM_MF']),
            array('guzman', 'guzman', 'gu<EMAIL>', 'xookahbi', ['ROLE_NM_MF']),
            array('cristiano', 'cristiano', '<EMAIL>', 'ohfohfum', ['ROLE_NM_MF']),
            array('anna', 'anna', 'anna<EMAIL>', 'ahmohnah', ['ROLE_NM_MF']),
            array('byambasuren', 'byambasuren', '<EMAIL>', 'aejohque', ['ROLE_NM_MF']),
            array('jeanne', 'jeanne', '<EMAIL>', 'xiegooge', ['ROLE_NM_MF']),
            array('nguyen', 'nguyen', 'ng<EMAIL>', 'uvupauho', ['ROLE_NM_MF']),
            array('meng', 'meng', '<EMAIL>', 'thauzeej', ['ROLE_NM_MF']),
            array('xueyan', 'xueyan', '<EMAIL>', 'rohpooqu', ['ROLE_NM_MF']),
            array('badia', 'badia', '<EMAIL>', 'caegouno', ['ROLE_NM_MF']),
            array('rodrigo', 'rodrigo', '<EMAIL>', 'ahdeogei', ['ROLE_NM_MF']),
            array('guillermo', 'guillermo', '<EMAIL>', 'yeuvoolo', ['ROLE_NM_MF']),
            array('angel', 'angel', '<EMAIL>', 'aezepees', ['ROLE_NM_MF']),
            array('sospeter', 'sospeter', '<EMAIL>', 'uuchahth', ['ROLE_NM_MF']),
            array('bhesh', 'bhesh', 'b<EMAIL>', 'teigotab', ['ROLE_NM_MF']),
            array('vahid', 'vahid', 'v<EMAIL>', 'ophiebah', ['ROLE_NM_MF']),
            array('andre', 'andre', '<EMAIL>', 'ohsohshi', ['ROLE_NM_MF']),
            array('adeyinka', 'adeyinka', '<EMAIL>', 'aimeipae', ['ROLE_NM_MF']),
            array('muna', 'muna', '<EMAIL>', 'iegheith', ['ROLE_NM_MF']),
            array('bewuket', 'bewuket', 'b<EMAIL>', 'hohreith', ['ROLE_NM_MF']),
            array('mutaz', 'mutaz', '<EMAIL>', 'chohexai', ['ROLE_NM_MF'])
        );

        foreach ($userList as $item){
            $item = array_combine($userListHeads, $item);
            $user = $userManager->findUserByUsername($item['username']);

            if (!$user) {
                // Add new User
                $user = $userManager->createUser();
                $user->setUsername($item['username']);
                $user->setName($item['name']);
                $user->setEmail($item['email']);
                $user->setPlainPassword($item['password']);
                $user->setEnabled(true);

                /** @var string $role */
                foreach ($item['roles'] as $role) {
                    $user->addRole($role);
                }

                $userManager->updateUser($user);
            }

            /** @var string $role */<commit_msg>Update fixtures<commit_after><?php

declare(strict_types=1);

namespace Inowas\ModflowBundle\DataFixtures\Scenarios;

use FOS\UserBundle\Model\UserManager;
use Inowas\Common\Fixtures\DataFixtureInterface;
use Inowas\Common\Id\UserId;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;


abstract class LoadScenarioBase implements ContainerAwareInterface, DataFixtureInterface
{

    /**
     * @var ContainerInterface
     */
    protected $container;

    /** @var  UserId */
    protected $ownerId;

    /** @var  array */
    protected $userIdList;

    /**
     * {@inheritDoc}
     */
    public function setContainer(ContainerInterface $container = null)
    {
        $this->container = $container;
    }

    protected function loadUsers(UserManager $userManager): void
    {

        $userListHeads = array('username', 'name', 'email', 'password', 'roles');
        $userList = array(
            array('guest', 'guest', '<EMAIL>', 'guest', []),
            array('inowas', 'inowas', '<EMAIL>', '#inowas#', ['ROLE_NM_MF']),
            array('ralf.junghanns', '<NAME>', '<EMAIL>', '#inowas#', ['ROLE_NM_MF']),
            array('jana.glass', '<NAME>', '<EMAIL>', '#inowas#', ['ROLE_NM_MF']),
            array('jana.sallwey', '<NAME>', '<EMAIL>', '#inowas#', ['ROLE_NM_MF']),
            array('catalin.stefan', '<NAME>', '<EMAIL>', '#inowas#', ['ROLE_NM_MF']),
            array('martin.wudenka', '<NAME>', '<EMAIL>', '#inowas#', ['ROLE_NM_MF']),
            array('sandro.keil', '<NAME>', '<EMAIL>', '#inowas#', ['ROLE_NM_MF']),
            array('maike.groeschke', '<NAME>', '<EMAIL>', 'mg_inowas_221', ['ROLE_NM_MF']),
            array('nawapi', 'nawapi', '<EMAIL>', 'na-ql-ww-pi', ['ROLE_NM_MF']),
            array('inowas1', 'inowas1', '<EMAIL>', 'cheekohk', ['ROLE_NM_MF']),
            array('malena', 'malena', '<EMAIL>', 'wohchoad', ['ROLE_NM_MF']),
            array('jorge', 'jorge', '<EMAIL>', 'geuwaexu', ['ROLE_NM_MF']),
            array('ahmad', 'ahmad', '<EMAIL>', 'eipobung', ['ROLE_NM_MF']),
            array('jonas', 'jonas', '<EMAIL>', 'eyipuamo', ['ROLE_NM_MF']),
            array('guzman', 'guzman', '<EMAIL>', 'xookahbi', ['ROLE_NM_MF']),
            array('cristiano', 'cristiano', '<EMAIL>', 'ohfohfum', ['ROLE_NM_MF']),
            array('anna', 'anna', '<EMAIL>', 'ahmohnah', ['ROLE_NM_MF']),
            array('byambasuren', 'byambasuren', '<EMAIL>', 'aejohque', ['ROLE_NM_MF']),
            array('jeanne', 'jeanne', '<EMAIL>', 'xiegooge', ['ROLE_NM_MF']),
            array('nguyen', 'nguyen', 'nguyen@gast', 'uvupauho', ['ROLE_NM_MF']),
            array('meng', 'meng', 'm<EMAIL>', 'thauzeej', ['ROLE_NM_MF']),
            array('xueyan', 'xueyan', 'xueyan@<EMAIL>', 'rohpooqu', ['ROLE_NM_MF']),
            array('badia', 'badia', 'bad<EMAIL>', 'caegouno', ['ROLE_NM_MF']),
            array('rodrigo', 'rodrigo', '<EMAIL>', 'ahdeogei', ['ROLE_NM_MF']),
            array('guillermo', 'guillermo', 'guillermo@<EMAIL>', 'yeuvoolo', ['ROLE_NM_MF']),
            array('angel', 'angel', 'angel<EMAIL>', 'aezepees', ['ROLE_NM_MF']),
            array('sospeter', 'sospeter', '<EMAIL>', 'uuchahth', ['ROLE_NM_MF']),
            array('bhesh', 'bhesh', 'bhesh@gast', 'teigotab', ['ROLE_NM_MF']),
            array('vahid', 'vahid', 'v<EMAIL>', 'ophiebah', ['ROLE_NM_MF']),
            array('andre', 'andre', '<EMAIL>', 'ohsohshi', ['ROLE_NM_MF']),
            array('adeyinka', 'adeyinka', 'ade<EMAIL>', 'aimeipae', ['ROLE_NM_MF']),
            array('muna', 'muna', '<EMAIL>', 'iegheith', ['ROLE_NM_MF']),
            array('bewuket', 'bewuket', 'bew<EMAIL>', 'hohreith', ['ROLE_NM_MF']),
            array('mutaz', 'mutaz', '<EMAIL>', 'chohexai', ['ROLE_NM_MF']),
            array('michael.rustler', 'Michael Rustler', '<EMAIL>', 'kw#inowas', []),
        );

        foreach ($userList as $item){
            $item = array_combine($userListHeads, $item);
            $user = $userManager->findUserByUsername($item['username']);

            if (!$user) {
                // Add new User
                $user = $userManager->createUser();
                $user->setUsername($item['username']);
                $user->setName($item['name']);
                $user->setEmail($item['email']);
                $user->setPlainPassword($item['password']);
                $user->setEnabled(true);

                /** @var string $role */
                foreach ($item['roles'] as $role) {
                    $user->addRole($role);
                }

                $userManager->updateUser($user);
            }

            /** @var string $role */
{'fraction_non_alphanumeric': 0.22135585878275937, 'fraction_numerical': 0.001299545159194282, 'mean_word_length': 2.9961055819991347, 'pattern_counts': {'":': 0, '<': 89, '<?xml version=': 0, '>': 107, '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': '1891093', 'n_tokens_mistral': 3264, 'n_tokens_neox': 3302, 'n_words': 526}