Skip to content

Commit 912ac16

Browse files
committed
removed obsolete use statements
1 parent d19d78c commit 912ac16

File tree

5 files changed

+7
-12
lines changed

5 files changed

+7
-12
lines changed

EventListener/FormatListener.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@
1212
namespace FOS\RestBundle\EventListener;
1313

1414
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
15-
use Symfony\Component\HttpKernel\Exception\HttpException;
1615
use Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException;
1716
use Symfony\Component\HttpKernel\HttpKernelInterface;
1817

19-
use FOS\RestBundle\Util\Codes;
2018
use FOS\RestBundle\Util\FormatNegotiatorInterface;
2119
use FOS\RestBundle\Util\MediaTypeNegotiatorInterface;
2220

@@ -47,7 +45,7 @@ public function __construct(FormatNegotiatorInterface $formatNegotiator)
4745
*
4846
* @param GetResponseEvent $event The event
4947
*
50-
* @throws HttpException
48+
* @throws NotAcceptableHttpException
5149
*/
5250
public function onKernelRequest(GetResponseEvent $event)
5351
{

Request/ParamFetcher.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@
1111

1212
namespace FOS\RestBundle\Request;
1313

14-
use FOS\RestBundle\Util\Codes;
1514
use FOS\RestBundle\Controller\Annotations\QueryParam;
1615
use FOS\RestBundle\Controller\Annotations\Param;
1716
use FOS\RestBundle\Controller\Annotations\RequestParam;
1817
use Doctrine\Common\Util\ClassUtils;
1918
use Symfony\Component\HttpFoundation\Request;
2019
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
21-
use Symfony\Component\HttpKernel\Exception\HttpException;
2220

2321
/**
2422
* Helper to validate parameters of the active request.
@@ -153,7 +151,7 @@ public function get($name, $strict = null)
153151
* @param string $param param to clean
154152
* @param boolean $strict is strict
155153
*
156-
* @throws \RuntimeException
154+
* @throws BadRequestHttpException
157155
* @return string
158156
*/
159157
public function cleanParamWithRequirements(Param $config, $param, $strict)
@@ -167,7 +165,9 @@ public function cleanParamWithRequirements(Param $config, $param, $strict)
167165
if ($strict) {
168166
$paramType = $config instanceof QueryParam ? 'Query' : 'Request';
169167

170-
throw new BadRequestHttpException($paramType . " parameter value '$param', does not match requirements '{$config->requirements}'");
168+
throw new BadRequestHttpException(
169+
$paramType . " parameter value '$param', does not match requirements '{$config->requirements}'"
170+
);
171171
}
172172

173173
return null === $default ? '' : $default;

Request/RequestBodyParamConverter.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Symfony\Component\HttpFoundation\Request;
1515
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
16-
use Symfony\Component\HttpKernel\Exception\HttpException;
1716
use Symfony\Component\HttpKernel\Exception\UnsupportedMediaTypeHttpException;
1817
use Symfony\Component\OptionsResolver\OptionsResolver;
1918
use Symfony\Component\Serializer\Exception\Exception as SymfonySerializerException;
@@ -25,7 +24,6 @@
2524
use JMS\Serializer\Exception\Exception as JMSSerializerException;
2625
use JMS\Serializer\DeserializationContext;
2726
use JMS\Serializer\SerializerInterface;
28-
use FOS\RestBundle\Util\Codes;
2927

3028
/**
3129
* @author Tyler Stroud <[email protected]>

View/JsonpHandler.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
use Symfony\Component\HttpFoundation\Response;
1515
use Symfony\Component\HttpFoundation\Request;
1616
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
17-
use Symfony\Component\HttpKernel\Exception\HttpException;
18-
19-
use FOS\RestBundle\Util\Codes;
2017

2118
/**
2219
* Implements a custom handler for JSONP leveraging the ViewHandler

View/ViewHandler.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ protected function getTemplating()
278278
* @param Request $request Request object
279279
*
280280
* @return Response
281+
*
282+
* @throws UnsupportedMediaTypeHttpException
281283
*/
282284
public function handle(View $view, Request $request = null)
283285
{

0 commit comments

Comments
 (0)