Skip to content

[FrameworkBundle] Fix docblocks #24726

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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())
{
Expand All @@ -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())
{
Expand All @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}
}
11 changes: 0 additions & 11 deletions src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 0 additions & 11 deletions src/Symfony/Component/PropertyInfo/PropertyInfoCacheExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down