From 3ebf6ac45b9863c29815e8dbdb17997c7ec52a73 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 28 Oct 2017 20:50:41 +0200 Subject: [PATCH] [FrameworkBundle] Fix docblocks --- .../Controller/ControllerTrait.php | 14 +-- .../Tests/Controller/ControllerTraitTest.php | 116 ++++-------------- .../Extractor/PhpDocExtractor.php | 11 -- .../PropertyInfoCacheExtractor.php | 11 -- 4 files changed, 28 insertions(+), 124 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php b/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php index 7d47d59585762..65350e40cc85b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php +++ b/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Controller; +use Doctrine\Common\Persistence\ManagerRegistry; use Psr\Container\ContainerInterface; use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\JsonResponse; @@ -23,10 +24,9 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Symfony\Component\Security\Csrf\CsrfToken; use Symfony\Component\Form\Extension\Core\Type\FormType; -use Symfony\Component\Form\Form; -use Symfony\Component\Form\FormBuilder; +use Symfony\Component\Form\FormInterface; +use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; -use Doctrine\Bundle\DoctrineBundle\Registry; /** * Common features needed in controllers. @@ -43,7 +43,7 @@ trait ControllerTrait * Generates a URL from the given parameters. * * @param string $route The name of the route - * @param mixed $parameters An array of parameters + * @param array $parameters An array of parameters * @param int $referenceType The type of reference (one of the constants in UrlGeneratorInterface) * * @return string The generated URL @@ -324,7 +324,7 @@ protected function createAccessDeniedException($message = 'Access Denied.', \Exc * @param mixed $data The initial data for the form * @param array $options Options for the form * - * @return Form + * @return FormInterface */ protected function createForm($type, $data = null, array $options = array()) { @@ -337,7 +337,7 @@ protected function createForm($type, $data = null, array $options = array()) * @param mixed $data The initial data for the form * @param array $options Options for the form * - * @return FormBuilder + * @return FormBuilderInterface */ protected function createFormBuilder($data = null, array $options = array()) { @@ -347,7 +347,7 @@ protected function createFormBuilder($data = null, array $options = array()) /** * Shortcut to return the Doctrine Registry service. * - * @return Registry + * @return ManagerRegistry * * @throws \LogicException If DoctrineBundle is not available */ diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTraitTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTraitTest.php index e5688af00fbe3..a208775cf23d7 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTraitTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTraitTest.php @@ -12,6 +12,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Tests\TestCase; +use Symfony\Bundle\FrameworkBundle\Controller\ControllerTrait; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\File\File; @@ -21,8 +22,6 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\ResponseHeaderBag; use Symfony\Component\HttpFoundation\Session\Flash\FlashBag; -use Symfony\Component\HttpFoundation\StreamedResponse; -use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Symfony\Component\Security\Core\User\User; @@ -533,98 +532,25 @@ public function testGetDoctrine() trait TestControllerTrait { - public function generateUrl($route, $parameters = array(), $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH) - { - return parent::generateUrl($route, $parameters, $referenceType); - } - - public function redirect($url, $status = 302) - { - return parent::redirect($url, $status); - } - - public function forward($controller, array $path = array(), array $query = array()) - { - return parent::forward($controller, $path, $query); - } - - public function getUser() - { - return parent::getUser(); - } - - public function json($data, $status = 200, $headers = array(), $context = array()) - { - return parent::json($data, $status, $headers, $context); - } - - public function file($file, $fileName = null, $disposition = ResponseHeaderBag::DISPOSITION_ATTACHMENT) - { - return parent::file($file, $fileName, $disposition); - } - - public function isGranted($attributes, $object = null) - { - return parent::isGranted($attributes, $object); - } - - public function denyAccessUnlessGranted($attributes, $object = null, $message = 'Access Denied.') - { - parent::denyAccessUnlessGranted($attributes, $object, $message); - } - - public function redirectToRoute($route, array $parameters = array(), $status = 302) - { - return parent::redirectToRoute($route, $parameters, $status); - } - - public function addFlash($type, $message) - { - parent::addFlash($type, $message); - } - - public function isCsrfTokenValid($id, $token) - { - return parent::isCsrfTokenValid($id, $token); - } - - public function renderView($view, array $parameters = array()) - { - return parent::renderView($view, $parameters); - } - - public function render($view, array $parameters = array(), Response $response = null) - { - return parent::render($view, $parameters, $response); - } - - public function stream($view, array $parameters = array(), StreamedResponse $response = null) - { - return parent::stream($view, $parameters, $response); - } - - public function createNotFoundException($message = 'Not Found', \Exception $previous = null) - { - return parent::createNotFoundException($message, $previous); - } - - public function createAccessDeniedException($message = 'Access Denied.', \Exception $previous = null) - { - return parent::createAccessDeniedException($message, $previous); - } - - public function createForm($type, $data = null, array $options = array()) - { - return parent::createForm($type, $data, $options); - } - - public function createFormBuilder($data = null, array $options = array()) - { - return parent::createFormBuilder($data, $options); - } - - public function getDoctrine() - { - return parent::getDoctrine(); + use ControllerTrait { + generateUrl as public; + redirect as public; + forward as public; + getUser as public; + json as public; + file as public; + isGranted as public; + denyAccessUnlessGranted as public; + redirectToRoute as public; + addFlash as public; + isCsrfTokenValid as public; + renderView as public; + render as public; + stream as public; + createNotFoundException as public; + createAccessDeniedException as public; + createForm as public; + createFormBuilder as public; + getDoctrine as public; } } diff --git a/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php b/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php index 3a59cc74cd9cc..600280bad5749 100644 --- a/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php +++ b/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php @@ -38,19 +38,8 @@ class PhpDocExtractor implements PropertyDescriptionExtractorInterface, Property */ private $docBlocks = array(); - /** - * @var DocBlockFactory - */ private $docBlockFactory; - - /** - * @var ContextFactory - */ private $contextFactory; - - /** - * @var PhpDocTypeHelper - */ private $phpDocTypeHelper; public function __construct(DocBlockFactoryInterface $docBlockFactory = null) diff --git a/src/Symfony/Component/PropertyInfo/PropertyInfoCacheExtractor.php b/src/Symfony/Component/PropertyInfo/PropertyInfoCacheExtractor.php index ff04a3d6ee65c..c1010832df471 100644 --- a/src/Symfony/Component/PropertyInfo/PropertyInfoCacheExtractor.php +++ b/src/Symfony/Component/PropertyInfo/PropertyInfoCacheExtractor.php @@ -22,19 +22,8 @@ */ class PropertyInfoCacheExtractor implements PropertyInfoExtractorInterface { - /** - * @var PropertyInfoExtractorInterface - */ private $propertyInfoExtractor; - - /** - * @var CacheItemPoolInterface - */ private $cacheItemPool; - - /** - * @var array - */ private $arrayCache = array(); public function __construct(PropertyInfoExtractorInterface $propertyInfoExtractor, CacheItemPoolInterface $cacheItemPool) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy