public function createServiceInstance(ServiceManagerInterface $serviceManager)
 {
     /** @var ThreadRepositoryInterface $threadRepository */
     $threadRepository = $serviceManager->get('ThreadRepository');
     /** @var PostRepositoryInterface $postRepository */
     $postRepository = $serviceManager->get('PostRepository');
     return new ThreadFeedRESTService($threadRepository, $postRepository);
 }
 public function createServiceInstance(ServiceManagerInterface $serviceManager)
 {
     $entityDirectory = $serviceManager->get('DoctrineApplicationPath') . '/../../Domain/Entity';
     $configuration = Setup::createAnnotationMetadataConfiguration([$entityDirectory], true);
     $connectConfiguration = $serviceManager->get('DoctrineConfiguration');
     $configuration->setNamingStrategy(new UnderscoreNamingStrategy());
     return EntityManager::create($connectConfiguration['connection'], $configuration);
 }
 public function createServiceInstance(ServiceManagerInterface $serviceManager)
 {
     /** @var ThreadRepositoryInterface $threadRepository */
     $threadRepository = $serviceManager->get('ThreadRepository');
     /** @var UploadService $postAttachmentUploadService */
     $postAttachmentUploadService = $serviceManager->get('PostAttachmentUploadService');
     /** @var EntityManager $entityManager */
     $entityManager = $serviceManager->get('EntityManager');
     return new ThreadReplyService($entityManager, $threadRepository, $postAttachmentUploadService);
 }
 /**
  * @inheritDoc
  */
 public function run()
 {
     /** @var RouteCollection $router */
     $router = $this->serviceManager->get('Router');
     $request = Request::createFromGlobals();
     try {
         $response = $router->getDispatcher()->dispatch($request->getMethod(), $request->getPathInfo());
     } catch (\Exception $e) {
         $response = new JsonResponse(['status_code' => 500, 'message' => $e->getMessage(), 'trace' => $e->getTrace()]);
         $response->setStatusCode(Response::HTTP_BAD_REQUEST);
     }
     $response->send();
 }
 /**
  * @inheritDoc
  */
 public function dispatch($controller, array $vars)
 {
     $action = 'action' . ucfirst($controller[1]);
     $controller = self::CONTROLLER_PREFIX . '\\' . $controller[0];
     /** @var AbstractController $controllerInstance */
     $controllerInstance = $this->serviceManager->get($controller);
     if (!$controllerInstance instanceof AbstractController) {
         throw new \Exception(sprintf('Invalid controller `%s`', get_class($controllerInstance)));
     }
     $controllerInstance->setup($this->getRequest(), $vars);
     if (!method_exists($controllerInstance, $action)) {
         throw new NotFoundException(sprintf('Action `%s` not found', $action));
     }
     return $controllerInstance->{$action}();
 }
 public function createServiceInstance(ServiceManagerInterface $serviceManager)
 {
     /** @var BoardRESTService $boardRESTService */
     $boardRESTService = $serviceManager->get('BoardRESTService');
     return new IndexController($boardRESTService);
 }
 public function createServiceInstance(ServiceManagerInterface $serviceManager)
 {
     /** @var BoardRepositoryInterface $boardRepository */
     $boardRepository = $serviceManager->get('BoardRepository');
     return new BoardRESTService($boardRepository);
 }
 public function createServiceInstance(ServiceManagerInterface $serviceManager)
 {
     /** @var ThreadReplyService $threadReplyService */
     $threadReplyService = $serviceManager->get('ThreadReplyService');
     return new ThreadReplyRESTService($threadReplyService);
 }
 public function createServiceInstance(ServiceManagerInterface $serviceManager)
 {
     /** @var Repositories $repositories */
     $repositories = $serviceManager->get('Repositories');
     return new PostRepository($repositories);
 }
 /**
  * Returns boards list
  * @return array
  */
 private function getBoards()
 {
     /** @var BoardRESTService $boardsRestService */
     $boardsRestService = $this->serviceManager->get('BoardRESTService');
     return json_decode($boardsRestService->getAll()->getContent(), true);
 }
 public function createServiceInstance(ServiceManagerInterface $serviceManager)
 {
     /** @var PostRepositoryInterface $postRepository */
     $postRepository = $serviceManager->get('PostRepository');
     return new PostRESTService($postRepository);
 }
 public function createServiceInstance(ServiceManagerInterface $serviceManager)
 {
     /** @var EntityManager $entityManager */
     $entityManager = $serviceManager->get('EntityManager');
     return new Repositories($entityManager);
 }
 public function createServiceInstance(ServiceManagerInterface $serviceManager)
 {
     /** @var ThreadFeedRESTService $threadFeedRESTService */
     $threadFeedRESTService = $serviceManager->get('ThreadFeedRESTService');
     return new FeedController($threadFeedRESTService);
 }
 public function createServiceInstance(ServiceManagerInterface $serviceManager)
 {
     /** @var BootstrapService $bootstrapService */
     $bootstrapService = $serviceManager->get('Bootstrap');
     return new BootstrapController($bootstrapService);
 }