<commit_before><?php

namespace Bakgat\Notos;


use Atrauzzi\LaravelDoctrine\DoctrineRegistry;
use Bakgat\Notos\Domain\Model\ACL\RoleRepository;
use Bakgat\Notos\Domain\Model\ACL\UserRolesRepository;
use Bakgat\Notos\Domain\Model\Curricula\CourseRepository;
use Bakgat\Notos\Domain\Model\Curricula\CurriculumRepository;
use Bakgat\Notos\Domain\Model\Descriptive\TagRepository;
use Bakgat\Notos\Domain\Model\Identity\OrganizationRepository;
use Bakgat\Notos\Domain\Model\Identity\UserRepository;
use Bakgat\Notos\Domain\Model\Location\WebsitesRepository;
use Bakgat\Notos\Domain\Model\Relations\PartyRelationRepository;
use Bakgat\Notos\Infrastructure\Repositories\Curriculum\CurriculumDoctrineORMRepository;
use Bakgat\Notos\Infrastructure\Repositories\Descriptive\TagDoctrineORMRepository;
use Bakgat\Notos\Infrastructure\Repositories\Location\WebsitesDoctrineORMRepository;
use Bakgat\Notos\Infrastructure\Repositories\ACL\RoleDoctrineORMRepository;
use Bakgat\Notos\Infrastructure\Repositories\ACL\UserRolesDoctrineORMRepository;
use Bakgat\Notos\Infrastructure\Repositories\Curriculum\CourseDoctrineORMRepository;
use Bakgat\Notos\Infrastructure\Repositories\OrganizationDoctrineORMRepository;
use Bakgat\Notos\Infrastructure\Repositories\PartyRelationDoctrineORMRepository;
use Bakgat\Notos\Infrastructure\Repositories\UserDoctrineORMRepository;
use Bakgat\Notos\Providers\NotosUserProvider;
use Doctrine\ORM\EntityManager;
use Illuminate\Auth\AuthManager;
use Illuminate\Support\Facades\App;
use Illuminate\Support\ServiceProvider;

class NotosServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap the application services.
     *
     * @return void
     */
    public function boot()
    {
        /*$this->loadViewsFrom(__DIR__ . '/views', 'notos');
        $this->publishes([
            __DIR__ . '/views' => base_path('resources/views'),
        ]);


        */
        $this->extendAuthManager();
    }

    /**
     * Register the application services.
     *
     * @return void
     */
    public function register()
    {
        // Bootstrap the JMS custom annotations for Object to Json mapping
        \Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace(
            'JMS\Serializer\Annotation',
            __DIR__ . '/../vendor/jms/serializer/src'
        );

        include __DIR__ . '/Http/routes.php';

        $this->app->register(\Atrauzzi\LaravelDoctrine\ServiceProvider::class);
        //$this->app->register(\Atrauzzi\LaravelSerializer\ServiceProvider::class);

        $loader = \Illuminate\Foundation\AliasLoader::getInstance();
        $loader->alias('EntityManager', \Atrauzzi\LaravelDoctrine\Support\Facades\Doctrine::class);

        $this->mergeConfigFrom(
            __DIR__ . '/../config/doctrine.php', 'doctrine'
        );

        /*
         |----------------------------------------------------------------------------------------------
         | Repositories
         |----------------------------------------------------------------------------------------------
         |
         |
         */


        $repos = [
            [UserRepository::class, UserDoctrineORMRepository::class],
            [OrganizationRepository::class, OrganizationDoctrineORMRepository::class],
            [PartyRelationRepository::class, PartyRelationDoctrineORMRepository::class],
            [RoleRepository::class, RoleDoctrineORMRepository::class],
            [UserRolesRepository::class, UserRolesDoctrineORMRepository::class],
            [CourseRepository::class, CourseDoctrineORMRepository::class],
            [WebsitesRepository::class, WebsitesDoctrineORMRepository::class],
            [CurriculumRepository::class, CurriculumDoctrineORMRepository::class],
            [TagRepository::class, TagDoctrineORMRepository::class],
        ];
        $this->simpleBindRepositories($repos);


    }


    /* ***************************************************
     * Private methods
     * **************************************************/
    private function simpleBindRepositories($repos)
    {
        foreach ($repos as $repo) {
            $this->app->bind($repo[0], function ($app) use($repo) {
                return new $repo[1](
                    $app->make(EntityManager::class)
                );
            });
        }

    }

    private function extendAuthManager()
    {
        $this->app[AuthManager::class]->extend('notos', function ($app) {
            return new NotosUserProvider(
                $app['Illuminate\Contracts\Hashing\Hasher'],
                $app[EntityManager::class],
                config('auth.model')
            );
        });
    }
}
<commit_msg>updated vendor path<commit_after><?php

namespace Bakgat\Notos;


use Atrauzzi\LaravelDoctrine\DoctrineRegistry;
use Bakgat\Notos\Domain\Model\ACL\RoleRepository;
use Bakgat\Notos\Domain\Model\ACL\UserRolesRepository;
use Bakgat\Notos\Domain\Model\Curricula\CourseRepository;
use Bakgat\Notos\Domain\Model\Curricula\CurriculumRepository;
use Bakgat\Notos\Domain\Model\Descriptive\TagRepository;
use Bakgat\Notos\Domain\Model\Identity\OrganizationRepository;
use Bakgat\Notos\Domain\Model\Identity\UserRepository;
use Bakgat\Notos\Domain\Model\Location\WebsitesRepository;
use Bakgat\Notos\Domain\Model\Relations\PartyRelationRepository;
use Bakgat\Notos\Infrastructure\Repositories\Curriculum\CurriculumDoctrineORMRepository;
use Bakgat\Notos\Infrastructure\Repositories\Descriptive\TagDoctrineORMRepository;
use Bakgat\Notos\Infrastructure\Repositories\Location\WebsitesDoctrineORMRepository;
use Bakgat\Notos\Infrastructure\Repositories\ACL\RoleDoctrineORMRepository;
use Bakgat\Notos\Infrastructure\Repositories\ACL\UserRolesDoctrineORMRepository;
use Bakgat\Notos\Infrastructure\Repositories\Curriculum\CourseDoctrineORMRepository;
use Bakgat\Notos\Infrastructure\Repositories\OrganizationDoctrineORMRepository;
use Bakgat\Notos\Infrastructure\Repositories\PartyRelationDoctrineORMRepository;
use Bakgat\Notos\Infrastructure\Repositories\UserDoctrineORMRepository;
use Bakgat\Notos\Providers\NotosUserProvider;
use Doctrine\ORM\EntityManager;
use Illuminate\Auth\AuthManager;
use Illuminate\Support\Facades\App;
use Illuminate\Support\ServiceProvider;

class NotosServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap the application services.
     *
     * @return void
     */
    public function boot()
    {
        /*$this->loadViewsFrom(__DIR__ . '/views', 'notos');
        $this->publishes([
            __DIR__ . '/views' => base_path('resources/views'),
        ]);


        */
        $this->extendAuthManager();
    }

    /**
     * Register the application services.
     *
     * @return void
     */
    public function register()
    {
        // Bootstrap the JMS custom annotations for Object to Json mapping
        \Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace(
            'JMS\Serializer\Annotation',
            app_path() . '/../vendor/jms/serializer/src'
        );

        include __DIR__ . '/Http/routes.php';

        $this->app->register(\Atrauzzi\LaravelDoctrine\ServiceProvider::class);
        //$this->app->register(\Atrauzzi\LaravelSerializer\ServiceProvider::class);

        $loader = \Illuminate\Foundation\AliasLoader::getInstance();
        $loader->alias('EntityManager', \Atrauzzi\LaravelDoctrine\Support\Facades\Doctrine::class);

        $this->mergeConfigFrom(
            __DIR__ . '/../config/doctrine.php', 'doctrine'
        );

        /*
         |----------------------------------------------------------------------------------------------
         | Repositories
         |----------------------------------------------------------------------------------------------
         |
         |
         */


        $repos = [
            [UserRepository::class, UserDoctrineORMRepository::class],
            [OrganizationRepository::class, OrganizationDoctrineORMRepository::class],
            [PartyRelationRepository::class, PartyRelationDoctrineORMRepository::class],
            [RoleRepository::class, RoleDoctrineORMRepository::class],
            [UserRolesRepository::class, UserRolesDoctrineORMRepository::class],
            [CourseRepository::class, CourseDoctrineORMRepository::class],
            [WebsitesRepository::class, WebsitesDoctrineORMRepository::class],
            [CurriculumRepository::class, CurriculumDoctrineORMRepository::class],
            [TagRepository::class, TagDoctrineORMRepository::class],
        ];
        $this->simpleBindRepositories($repos);


    }


    /* ***************************************************
     * Private methods
     * **************************************************/
    private function simpleBindRepositories($repos)
    {
        foreach ($repos as $repo) {
            $this->app->bind($repo[0], function ($app) use($repo) {
                return new $repo[1](
                    $app->make(EntityManager::class)
                );
            });
        }

    }

    private function extendAuthManager()
    {
        $this->app[AuthManager::class]->extend('notos', function ($app) {
            return new NotosUserProvider(
                $app['Illuminate\Contracts\Hashing\Hasher'],
                $app[EntityManager::class],
                config('auth.model')
            );
        });
    }
}

{'fraction_non_alphanumeric': 0.1685717337891251, 'fraction_numerical': 0.0004273047751308621, 'mean_word_length': 2.728395061728395, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, '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': '6060351', 'n_tokens_mistral': 2570, 'n_tokens_neox': 2575, 'n_words': 318}