Skip to content

Commit 6c43e2e

Browse files
committed
merged branch dlsniper/docblock-enhancements (PR symfony#6383)
This PR was squashed before being merged into the master branch (closes symfony#6383). Commits ------- c2acc6c Fixed most of the docblocks/unused namespaces Discussion ---------- Fixed most of the docblocks/unused namespaces This PR fixes most/all of the docblocks in the framework. Also, this removes the unused namespaces from the sources. I've inspected the sources with the latest EAP of PhpStorm 6. Thanks! --------------------------------------------------------------------------- by dlsniper at 2012-12-16T21:03:32Z @stof let me know if I can squash the commits. Also, I've did considered about using the short class name but sometime that is not available for certain classes/contexts and it's better for IDEs to have the FQNS. --------------------------------------------------------------------------- by stof at 2012-12-16T22:32:32Z Using the short class name is a matter of coding standards. For the squashijng, I would suggest waiting the end of the work (or even letting @fabpot squash it when merging). Seeing the changes in a new commit makes it easier to review as we can see the diff between the previous review and the current state. --------------------------------------------------------------------------- by dlsniper at 2012-12-16T22:51:46Z I know about the review that's why I've asked you about squashing the commits ;) I'll commit the reminder of the needed changes asap. But on the more important part, I'll remove the long declarations where the class is already imported via ```use``` but it some cases, like https://github.com/symfony/symfony/pull/6383/files#L41R145 , I don't think it's ok not to provide IDE auto-completion just because the coding standard says so as we are using namespaces and IDEs might not be able to get it right without some small hints. What do you think? --------------------------------------------------------------------------- by dlsniper at 2012-12-16T23:14:46Z Also, look on this: ![snapshot6](https://f.cloud.github.com/assets/607868/15850/23ee18f6-47d6-11e2-8285-0c3c06a1e60d.png) As you can see, the IDE is confused about the type of the expected parameter vs returned parameter because the class isn't properly namespaced. Like I've said, humans might do ok when reading it but the tools we use to code might not so we should help them out a bit. --------------------------------------------------------------------------- by stof at 2012-12-17T09:54:04Z @dlsniper This is because the phpdoc of the ``TreeBuilder::buildTree`` is wrong. It uses the short class name but the use statement is missing --------------------------------------------------------------------------- by dlsniper at 2012-12-17T21:45:50Z That's true but I'm not sure what's the preferred fix for this. Add the missing use statement or do the FQNS which breaks the CS like you've pointed out. Any pointers? --------------------------------------------------------------------------- by mvrhov at 2012-12-18T09:37:51Z I'm adding the use statements. Beware PhpStorm will report the classes that are used only in annotations as unused! --------------------------------------------------------------------------- by stof at 2012-12-18T09:41:08Z @dlsniper there is already a bunch of places where we have use statements added for the phpdoc for return values --------------------------------------------------------------------------- by dlsniper at 2012-12-18T09:41:53Z Ok, I'll fix this issue tonight then and revert the changes. Thanks for feedback. --------------------------------------------------------------------------- by dlsniper at 2012-12-18T22:03:25Z I believe this is done. Anything that I might have missed?
2 parents 7bc9caa + c2acc6c commit 6c43e2e

File tree

159 files changed

+466
-114
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+466
-114
lines changed

src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ public function hasListeners($event)
9393
*
9494
* @param string|array $events The event(s) to listen on.
9595
* @param object|string $listener The listener object.
96+
*
97+
* @throws \RuntimeException
9698
*/
9799
public function addEventListener($events, $listener)
98100
{

src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ abstract class AbstractDoctrineExtension extends Extension
4242
/**
4343
* @param array $objectManager A configured object manager.
4444
* @param ContainerBuilder $container A ContainerBuilder instance
45+
*
46+
* @throws \InvalidArgumentException
4547
*/
4648
protected function loadMappingInformation(array $objectManager, ContainerBuilder $container)
4749
{
@@ -119,6 +121,8 @@ protected function setMappingDriverAlias($mappingConfig, $mappingName)
119121
*
120122
* @param array $mappingConfig
121123
* @param string $mappingName
124+
*
125+
* @throws \InvalidArgumentException
122126
*/
123127
protected function setMappingDriverConfig(array $mappingConfig, $mappingName)
124128
{
@@ -228,6 +232,8 @@ protected function registerMappingDrivers($objectManager, ContainerBuilder $cont
228232
*
229233
* @param array $mappingConfig
230234
* @param string $objectManagerName
235+
*
236+
* @throws \InvalidArgumentException
231237
*/
232238
protected function assertValidMappingConfiguration(array $mappingConfig, $objectManagerName)
233239
{

src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function process(ContainerBuilder $container)
4747
*
4848
* @param ContainerBuilder $container
4949
* @param string $mapping
50-
* @param type $extension
50+
* @param string $extension
5151
*/
5252
private function updateValidatorMappingFiles(ContainerBuilder $container, $mapping, $extension)
5353
{

src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ORMQueryBuilderLoader implements EntityLoaderInterface
2626
*
2727
* This property should only be accessed through queryBuilder.
2828
*
29-
* @var Doctrine\ORM\QueryBuilder
29+
* @var QueryBuilder
3030
*/
3131
private $queryBuilder;
3232

@@ -36,6 +36,8 @@ class ORMQueryBuilderLoader implements EntityLoaderInterface
3636
* @param QueryBuilder|\Closure $queryBuilder
3737
* @param EntityManager $manager
3838
* @param string $class
39+
*
40+
* @throws UnexpectedTypeException
3941
*/
4042
public function __construct($queryBuilder, $manager = null, $class = null)
4143
{

src/Symfony/Bridge/Doctrine/Form/DataTransformer/CollectionToArrayTransformer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ class CollectionToArrayTransformer implements DataTransformerInterface
2727
* @param Collection $collection A collection of entities
2828
*
2929
* @return mixed An array of entities
30+
*
31+
* @throws UnexpectedTypeException
3032
*/
3133
public function transform($collection)
3234
{

src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandler.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ public function write($id, $data)
157157
*
158158
* @param string $id
159159
* @param string $data
160+
*
161+
* @return Boolean
160162
*/
161163
private function createNewSession($id, $data = '')
162164
{

src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ public function __construct(ManagerRegistry $registry)
4040
/**
4141
* @param object $entity
4242
* @param Constraint $constraint
43+
*
44+
* @throws UnexpectedTypeException
45+
* @throws ConstraintDefinitionException
4346
*/
4447
public function validate($entity, Constraint $constraint)
4548
{

src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,8 @@ private function load()
348348
*
349349
* @param object $model The model for which to get the identifier
350350
*
351+
* @return array
352+
*
351353
* @throws FormException If the model does not exist
352354
*/
353355
private function getIdentifierValues($model)
@@ -367,7 +369,7 @@ private function getIdentifierValues($model)
367369
/**
368370
* Whether this column in an integer
369371
*
370-
* @param ColumnMap $column
372+
* @param \ColumnMap $column
371373
*
372374
* @return Boolean
373375
*/

src/Symfony/Bridge/Twig/Extension/HttpKernelExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ public function getFunctions()
5151
* @param string $uri The URI to render
5252
*
5353
* @return string The Response content
54+
*
55+
* @throws \RuntimeException
5456
*/
5557
public function render(\Twig_Environment $twig, $uri)
5658
{

src/Symfony/Bridge/Twig/TokenParser/TransChoiceTokenParser.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ class TransChoiceTokenParser extends TransTokenParser
2626
* @param \Twig_Token $token A Twig_Token instance
2727
*
2828
* @return \Twig_NodeInterface A Twig_NodeInterface instance
29+
*
30+
* @throws \Twig_Error_Syntax
2931
*/
3032
public function parse(\Twig_Token $token)
3133
{

0 commit comments

Comments
 (0)