sms-store/src/App/Service/SZEPManagerServiceFactory.php
Danyi Dávid b1f6daf424 * lib update
* static analyzer added
* new tags
* logger improvements
2018-12-03 22:13:57 +01:00

37 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Service;
use Doctrine\ORM\EntityManager; // @phan-suppress-current-line PhanUnreferencedUseNormal
use GuzzleHttp\Client;
use Interop\Container\ContainerInterface;
class SZEPManagerServiceFactory
{
/**
* @param ContainerInterface $container
* @return SZEPManagerService
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
*/
public function __invoke(ContainerInterface $container)
{
$httpClient = new Client([
'cookies' => true,
'headers' => [
'Content-Type' => 'text/xml; charset=UTF-8',
'User-Agent' => 'Dalvik/2.1.0 (Linux; U; Android 7.0; SM-A510F Build/NRD90M)',
]
]);
$config = $container->get('config');
/** @var EntityManager $em */
$em = $container->get('doctrine.entity_manager.orm_default');
/** @var KoinService $koinService */
$koinService = $container->get(KoinService::class);
return new SZEPManagerService($httpClient, $config, $em, $koinService);
}
}