<commit_before><?php namespace OpenCFP\Provider; 

use OpenCFP\Application\Speakers;
use OpenCFP\Domain\CallForProposal;
use OpenCFP\Http\API\TalkController;
use OpenCFP\Infrastructure\Auth\SentryIdentityProvider;
use OpenCFP\Infrastructure\Auth\UhhhmIdentityProvider;
use OpenCFP\Infrastructure\Persistence\SpotSpeakerRepository;
use OpenCFP\Infrastructure\Persistence\SpotTalkRepository;
use Silex\Application;
use Silex\ServiceProviderInterface;

class ApplicationServiceProvider implements ServiceProviderInterface
{

    /**
     * {@inheritdoc}
     */
    public function register(Application $app)
    {
        $this->bindApplicationServices($app);
        $this->bindControllersAsServices($app);
    }

    /**
     * {@inheritdoc}
     */
    public function boot(Application $app)
    {
    }

    /**
     * @param Application $app
     */
    protected function bindApplicationServices(Application $app)
    {
        $app['application.speakers'] = $app->share(
            function ($app) {
                $userMapper = $app['spot']->mapper('OpenCFP\Domain\Entity\User');
                $talkMapper = $app['spot']->mapper('OpenCFP\Domain\Entity\Talk');
                $speakerRepository = new SpotSpeakerRepository($userMapper);

                return new Speakers(
                    new CallForProposal(new \DateTime($app->config('application.enddate'))),
                    new SentryIdentityProvider($app['sentry'], $speakerRepository),
                    $speakerRepository,
                    new SpotTalkRepository($talkMapper)
                );
            }
        );

        $app['application.speakers.api'] = $app->share(
            function ($app) {
                $userMapper = $app['spot']->mapper('OpenCFP\Domain\Entity\User');
                $talkMapper = $app['spot']->mapper('OpenCFP\Domain\Entity\Talk');
                $speakerRepository = new SpotSpeakerRepository($userMapper);

                return new Speakers(
                    new CallForProposal(new \DateTime($app->config('application.enddate'))),
                    new UhhhmIdentityProvider($app['request'], $speakerRepository),
                    $speakerRepository,
                    new SpotTalkRepository($talkMapper)
                );
            }
        );
    }

    private function bindControllersAsServices($app)
    {
        $app['controller.api.talk'] = $app->share(function ($app) {
            return new TalkController($app['application.speakers.api']);
        });
    }
}<commit_msg>Fix service registrations for Speakers application service<commit_after><?php namespace OpenCFP\Provider; 

use OpenCFP\Application\Speakers;
use OpenCFP\Domain\CallForProposal;
use OpenCFP\Http\API\TalkController;
use OpenCFP\Infrastructure\Auth\SentryIdentityProvider;
use OpenCFP\Infrastructure\Auth\UhhhmIdentityProvider;
use OpenCFP\Infrastructure\Persistence\SpotSpeakerRepository;
use OpenCFP\Infrastructure\Persistence\SpotTalkRepository;
use Silex\Application;
use Silex\ServiceProviderInterface;

class ApplicationServiceProvider implements ServiceProviderInterface
{

    /**
     * {@inheritdoc}
     */
    public function register(Application $app)
    {
        $this->bindApplicationServices($app);
        $this->bindControllersAsServices($app);
    }

    /**
     * {@inheritdoc}
     */
    public function boot(Application $app)
    {
    }

    /**
     * @param Application $app
     */
    protected function bindApplicationServices(Application $app)
    {
        $app['application.speakers'] = $app->share(
            function ($app) {
                $userMapper = $app['spot']->mapper('OpenCFP\Domain\Entity\User');
                $talkMapper = $app['spot']->mapper('OpenCFP\Domain\Entity\Talk');
                $speakerRepository = new SpotSpeakerRepository($userMapper);

                return new Speakers(
                    new CallForProposal(new \DateTime($app->config('application.enddate'))),
                    new SentryIdentityProvider($app['sentry'], $speakerRepository),
                    $speakerRepository,
                    new SpotTalkRepository($talkMapper),
                    $app['dispatcher']
                );
            }
        );

        $app['application.speakers.api'] = $app->share(
            function ($app) {
                $userMapper = $app['spot']->mapper('OpenCFP\Domain\Entity\User');
                $talkMapper = $app['spot']->mapper('OpenCFP\Domain\Entity\Talk');
                $speakerRepository = new SpotSpeakerRepository($userMapper);

                return new Speakers(
                    new CallForProposal(new \DateTime($app->config('application.enddate'))),
                    new UhhhmIdentityProvider($app['request'], $speakerRepository),
                    $speakerRepository,
                    new SpotTalkRepository($talkMapper),
                    $app['dispatcher']
                );
            }
        );
    }

    private function bindControllersAsServices($app)
    {
        $app['controller.api.talk'] = $app->share(function ($app) {
            return new TalkController($app['application.speakers.api']);
        });

        $app['controller.oauth'] = $app->share(function($app) {
            
        });
    }
}
{'fraction_non_alphanumeric': 0.12317049990496104, 'fraction_numerical': 0.0, 'mean_word_length': 2.351592356687898, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 26, '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': '3518134', 'n_tokens_mistral': 1424, 'n_tokens_neox': 1357, 'n_words': 208}