From 46502c4a8067a760d97f73407dbed0be930f2cd7 Mon Sep 17 00:00:00 2001 From: Alexey Skobkin Date: Sun, 5 Nov 2017 05:39:52 +0300 Subject: [PATCH] deprecations removal. --- app/config/config.yml | 1 - app/config/config_dev.yml | 4 ++-- .../PointToolsBundle/Command/ImportUsersCommand.php | 4 ++-- .../PointToolsBundle/Command/TelegramWebHookCommand.php | 5 ++--- .../PointToolsBundle/Controller/Api/CrawlerController.php | 6 +++--- .../Bundle/PointToolsBundle/Service/Api/AbstractApi.php | 8 +++++--- .../Bundle/PointToolsBundle/Service/Api/PostApi.php | 4 ++-- .../Bundle/PointToolsBundle/Service/Api/UserApi.php | 6 ++++-- 8 files changed, 20 insertions(+), 18 deletions(-) diff --git a/app/config/config.yml b/app/config/config.yml index e2c9412..3b8eaa3 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -27,7 +27,6 @@ framework: engines: ['twig'] default_locale: "%locale%" trusted_hosts: ~ - trusted_proxies: ~ session: # handler_id set to null will use default session handler from php.ini handler_id: ~ diff --git a/app/config/config_dev.yml b/app/config/config_dev.yml index c8c5ec1..d5f0878 100644 --- a/app/config/config_dev.yml +++ b/app/config/config_dev.yml @@ -18,12 +18,12 @@ monolog: path: "%kernel.logs_dir%/%kernel.environment%.log" max_files: 2 level: debug - channels: [!event] + channels: ['!event'] console: type: console verbosity_levels: VERBOSITY_NORMAL: WARNING - channels: [!event, !doctrine] + channels: ['!event', '!doctrine'] # uncomment to get logging in your browser # you may have to allow bigger header sizes in your Web server configuration #firephp: diff --git a/src/Skobkin/Bundle/PointToolsBundle/Command/ImportUsersCommand.php b/src/Skobkin/Bundle/PointToolsBundle/Command/ImportUsersCommand.php index ed690c9..1f76a38 100644 --- a/src/Skobkin/Bundle/PointToolsBundle/Command/ImportUsersCommand.php +++ b/src/Skobkin/Bundle/PointToolsBundle/Command/ImportUsersCommand.php @@ -2,7 +2,7 @@ namespace Skobkin\Bundle\PointToolsBundle\Command; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\{EntityManager, EntityManagerInterface}; use Skobkin\Bundle\PointToolsBundle\Entity\User; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\{InputInterface, InputArgument, InputOption}; @@ -23,7 +23,7 @@ class ImportUsersCommand extends Command /** @var EntityManager */ private $em; - public function __construct(EntityManager $em) + public function __construct(EntityManagerInterface $em) { $this->em = $em; diff --git a/src/Skobkin/Bundle/PointToolsBundle/Command/TelegramWebHookCommand.php b/src/Skobkin/Bundle/PointToolsBundle/Command/TelegramWebHookCommand.php index 7a0fe6a..794edd2 100644 --- a/src/Skobkin/Bundle/PointToolsBundle/Command/TelegramWebHookCommand.php +++ b/src/Skobkin/Bundle/PointToolsBundle/Command/TelegramWebHookCommand.php @@ -2,7 +2,6 @@ namespace Skobkin\Bundle\PointToolsBundle\Command; -use Symfony\Bundle\FrameworkBundle\Routing\Router; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\{InputArgument, InputInterface}; use Symfony\Component\Console\Output\OutputInterface; @@ -22,7 +21,7 @@ class TelegramWebHookCommand extends Command /** @var TgLog */ private $client; - /** @var Router */ + /** @var UrlGeneratorInterface */ private $router; /** @var string */ @@ -31,7 +30,7 @@ class TelegramWebHookCommand extends Command /** @var int */ private $maxConnections; - public function __construct(TgLog $client, Router $router, string $telegramToken, int $telegramWebhookMaxConnections) + public function __construct(TgLog $client, UrlGeneratorInterface $router, string $telegramToken, int $telegramWebhookMaxConnections) { parent::__construct(); diff --git a/src/Skobkin/Bundle/PointToolsBundle/Controller/Api/CrawlerController.php b/src/Skobkin/Bundle/PointToolsBundle/Controller/Api/CrawlerController.php index 7ecc95a..bf6dd03 100644 --- a/src/Skobkin/Bundle/PointToolsBundle/Controller/Api/CrawlerController.php +++ b/src/Skobkin/Bundle/PointToolsBundle/Controller/Api/CrawlerController.php @@ -2,8 +2,8 @@ namespace Skobkin\Bundle\PointToolsBundle\Controller\Api; -use Doctrine\ORM\EntityManager; -use JMS\Serializer\Serializer; +use Doctrine\ORM\EntityManagerInterface; +use JMS\Serializer\SerializerInterface; use Skobkin\Bundle\PointToolsBundle\DTO\Api\PostsPage; use Skobkin\Bundle\PointToolsBundle\Service\Factory\Blogs\PostFactory; use Symfony\Component\HttpFoundation\{Request, Response}; @@ -18,7 +18,7 @@ class CrawlerController extends AbstractApiController $this->crawlerToken = $crawlerToken; } - public function receiveAllPageAction(Request $request, Serializer $serializer, PostFactory $postFactory, EntityManager $em): Response + public function receiveAllPageAction(Request $request, SerializerInterface $serializer, PostFactory $postFactory, EntityManagerInterface $em): Response { $remoteToken = $request->request->get('token'); diff --git a/src/Skobkin/Bundle/PointToolsBundle/Service/Api/AbstractApi.php b/src/Skobkin/Bundle/PointToolsBundle/Service/Api/AbstractApi.php index 73dc076..10be5a7 100644 --- a/src/Skobkin/Bundle/PointToolsBundle/Service/Api/AbstractApi.php +++ b/src/Skobkin/Bundle/PointToolsBundle/Service/Api/AbstractApi.php @@ -4,7 +4,9 @@ namespace Skobkin\Bundle\PointToolsBundle\Service\Api; use GuzzleHttp\ClientInterface; use GuzzleHttp\Exception\TransferException; -use JMS\Serializer\{DeserializationContext, Serializer}; +use JMS\Serializer\{ + DeserializationContext, SerializerInterface +}; use Psr\Http\Message\{ResponseInterface, StreamInterface}; use Psr\Log\LoggerInterface; use Skobkin\Bundle\PointToolsBundle\Exception\Api\{ForbiddenException, NetworkException, NotFoundException, ServerProblemException, UnauthorizedException}; @@ -18,7 +20,7 @@ class AbstractApi protected $client; /** - * @var Serializer + * @var SerializerInterface */ protected $serializer; @@ -38,7 +40,7 @@ class AbstractApi protected $csRfToken; - public function __construct(ClientInterface $httpClient, Serializer $serializer, LoggerInterface $logger) + public function __construct(ClientInterface $httpClient, SerializerInterface $serializer, LoggerInterface $logger) { $this->client = $httpClient; $this->serializer = $serializer; diff --git a/src/Skobkin/Bundle/PointToolsBundle/Service/Api/PostApi.php b/src/Skobkin/Bundle/PointToolsBundle/Service/Api/PostApi.php index 69b5812..e9875a4 100644 --- a/src/Skobkin/Bundle/PointToolsBundle/Service/Api/PostApi.php +++ b/src/Skobkin/Bundle/PointToolsBundle/Service/Api/PostApi.php @@ -3,7 +3,7 @@ namespace Skobkin\Bundle\PointToolsBundle\Service\Api; use GuzzleHttp\ClientInterface; -use JMS\Serializer\Serializer; +use JMS\Serializer\SerializerInterface; use Psr\Log\LoggerInterface; use Skobkin\Bundle\PointToolsBundle\Service\Factory\Blogs\PostFactory; @@ -18,7 +18,7 @@ class PostApi extends AbstractApi private $postFactory; - public function __construct(ClientInterface $httpClient, Serializer $serializer, LoggerInterface $logger, PostFactory $postFactory) + public function __construct(ClientInterface $httpClient, SerializerInterface $serializer, LoggerInterface $logger, PostFactory $postFactory) { parent::__construct($httpClient, $serializer, $logger); diff --git a/src/Skobkin/Bundle/PointToolsBundle/Service/Api/UserApi.php b/src/Skobkin/Bundle/PointToolsBundle/Service/Api/UserApi.php index 7bf6404..fc265e0 100644 --- a/src/Skobkin/Bundle/PointToolsBundle/Service/Api/UserApi.php +++ b/src/Skobkin/Bundle/PointToolsBundle/Service/Api/UserApi.php @@ -3,7 +3,9 @@ namespace Skobkin\Bundle\PointToolsBundle\Service\Api; use GuzzleHttp\ClientInterface; -use JMS\Serializer\{DeserializationContext, Serializer}; +use JMS\Serializer\{ + DeserializationContext, SerializerInterface +}; use Psr\Log\LoggerInterface; use Skobkin\Bundle\PointToolsBundle\DTO\Api\{Auth, User as UserDTO}; use Skobkin\Bundle\PointToolsBundle\Entity\User; @@ -22,7 +24,7 @@ class UserApi extends AbstractApi */ private $userFactory; - public function __construct(ClientInterface $httpClient, Serializer $serializer, LoggerInterface $logger, UserFactory $userFactory) + public function __construct(ClientInterface $httpClient, SerializerInterface $serializer, LoggerInterface $logger, UserFactory $userFactory) { parent::__construct($httpClient, $serializer, $logger);