<commit_before><?php

/*
 * This file is part of the Incipio package.
 *
 * (c) <NAME>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace App\DataFixtures;

use App\Entity\Treso\BaseURSSAF;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\Persistence\ObjectManager;

class LoadBaseURSSAFData extends Fixture
{
    /**
     * {@inheritdoc}
     */
    public function load(ObjectManager $manager)
    {
        $base = [
            2017 => 39.04,
            2016 => 38.68,
            2015 => 38.44,
            2014 => 38.12,
            2013 => 37.72,
            2012 => 36.88,
            2011 => 36,
            2010 => 35.44,
            2009 => 34.84,
            2008 => 33.76,
            2007 => 33.08,
        ];
        for ($y = 2009; $y < 2018; ++$y) {
            $baseURSSAF = new BaseURSSAF();
            if (array_key_exists($y, $base)) {
                $baseURSSAF->setBaseURSSAF($base[$y])->setDateDebut(new \DateTime("$y-01-01"))->setDateFin(new \DateTime("$y-12-31"));
                $manager->persist($baseURSSAF);
            }
        }
        if (!$manager->getRepository(BaseURSSAF::class)->findBy([
            'dateDebut' => $baseURSSAF->getDateDebut(),
            ])) {
            $manager->flush();
        }
    }
}<commit_msg>Add URSSAF bases<commit_after><?php

/*
 * This file is part of the Incipio package.
 *
 * (c) <NAME>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace App\DataFixtures;

use App\Entity\Treso\BaseURSSAF;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\Persistence\ObjectManager;

class LoadBaseURSSAFData extends Fixture
{
    /**
     * {@inheritdoc}
     */
    public function load(ObjectManager $manager)
    {
        $base = [
            2019 => 40.12,
            2018 => 39.54,
            2017 => 39.04,
            2016 => 38.68,
            2015 => 38.44,
            2014 => 38.12,
            2013 => 37.72,
            2012 => 36.88,
            2011 => 36.00,
            2010 => 35.44,
            2009 => 34.84,
            2008 => 33.76,
            2007 => 33.08,
        ];
        foreach ($base as $y => $b) {
            $baseURSSAF = new BaseURSSAF();
            $baseURSSAF->setBaseURSSAF($b)->setDateDebut(new \DateTime("$y-01-01"))->setDateFin(new \DateTime("$y-12-31"));
            $manager->persist($baseURSSAF);
        }
        if (!$manager->getRepository(BaseURSSAF::class)->findBy([
            'dateDebut' => $baseURSSAF->getDateDebut(),
            ])) {
            $manager->flush();
        }
    }
}
{'fraction_non_alphanumeric': 0.14547453279589592, 'fraction_numerical': 0.07841700256504214, 'mean_word_length': 1.7885597548518897, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 48, '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': '4426821', 'n_tokens_mistral': 1020, 'n_tokens_neox': 852, 'n_words': 184}