<commit_before><?php
namespace Oro\Bundle\UserBundle\DataFixtures\ORM;

use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;

use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

class LoadUserData extends AbstractFixture implements  ContainerAwareInterface, OrderedFixtureInterface
{
    private $container;

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

    public function load(ObjectManager $manager)
    {
        /** @var \Oro\Bundle\UserBundle\Entity\UserManager $userManager */
        $userManager = $this->container->get('oro_user.manager');

        $admin = $userManager->createUser();
        $admin->setUsername('admin');
        $admin->setPlainPassword('<PASSWORD>');
        $admin->addRole($this->getReference('admin_role'));
        $admin->setEmail('<EMAIL>');
        $userManager->updateUser($admin);
    }

    public function getOrder()
    {
        return 110;
    }
}
<commit_msg>Added default API key (equal to "admin_api_key") for "admin" user<commit_after><?php
namespace Oro\Bundle\UserBundle\DataFixtures\ORM;

use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;

use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

use Oro\Bundle\UserBundle\Entity\UserApi;

class LoadUserData extends AbstractFixture implements  ContainerAwareInterface, OrderedFixtureInterface
{
    private $container;

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

    public function load(ObjectManager $manager)
    {
        /** @var \Oro\Bundle\UserBundle\Entity\UserManager $userManager */
        $userManager = $this->container->get('oro_user.manager');

        $admin = $userManager->createUser();
        $api   = new UserApi();

        $api->setApiKey('admin_api_key')
            ->setUser($admin);

        $admin
            ->setUsername('admin')
            ->setPlainPassword('<PASSWORD>')
            ->addRole($this->getReference('admin_role'))
            ->setEmail('<EMAIL>')
            ->setApi($api);

        $userManager->updateUser($admin);
    }

    public function getOrder()
    {
        return 110;
    }
}

{'fraction_non_alphanumeric': 0.11879640484564283, 'fraction_numerical': 0.0023446658851113715, 'mean_word_length': 3.6126126126126126, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 30, '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': '3809399', 'n_tokens_mistral': 723, 'n_tokens_neox': 707, 'n_words': 118}