Skip to content

Commit e09b4f9

Browse files
committed
minor symfony#13134 [2.3] Fixes various phpdoc and coding standards. (hhamon)
This PR was merged into the 2.3 branch. Discussion ---------- [2.3] Fixes various phpdoc and coding standards. | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | ~ | License | MIT | Doc PR | ~ Commits ------- b83da8f Fixes various phpdoc and coding standards.
2 parents 14ca1c5 + b83da8f commit e09b4f9

File tree

60 files changed

+168
-164
lines changed

Some content is hidden

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

60 files changed

+168
-164
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ protected function setMappingDriverAlias($mappingConfig, $mappingName)
129129
*/
130130
protected function setMappingDriverConfig(array $mappingConfig, $mappingName)
131131
{
132-
if (is_dir($mappingConfig['dir'])) {
133-
$this->drivers[$mappingConfig['type']][$mappingConfig['prefix']] = realpath($mappingConfig['dir']);
134-
} else {
132+
if (!is_dir($mappingConfig['dir'])) {
135133
throw new \InvalidArgumentException(sprintf('Invalid Doctrine mapping path given. Cannot load Doctrine mapping/bundle named "%s".', $mappingName));
136134
}
135+
136+
$this->drivers[$mappingConfig['type']][$mappingConfig['prefix']] = realpath($mappingConfig['dir']);
137137
}
138138

139139
/**

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

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList;
1717
use Doctrine\Common\Persistence\ObjectManager;
1818
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
19+
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
1920

2021
/**
2122
* A choice list presenting a list of Doctrine entities as choices.
@@ -35,7 +36,7 @@ class EntityChoiceList extends ObjectChoiceList
3536
private $class;
3637

3738
/**
38-
* @var \Doctrine\Common\Persistence\Mapping\ClassMetadata
39+
* @var ClassMetadata
3940
*/
4041
private $classMetadata;
4142

@@ -132,7 +133,7 @@ public function __construct(ObjectManager $manager, $class, $labelPath = null, E
132133
*
133134
* @return array
134135
*
135-
* @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface
136+
* @see ChoiceListInterface
136137
*/
137138
public function getChoices()
138139
{
@@ -148,7 +149,7 @@ public function getChoices()
148149
*
149150
* @return array
150151
*
151-
* @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface
152+
* @see ChoiceListInterface
152153
*/
153154
public function getValues()
154155
{
@@ -165,7 +166,7 @@ public function getValues()
165166
*
166167
* @return array
167168
*
168-
* @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface
169+
* @see ChoiceListInterface
169170
*/
170171
public function getPreferredViews()
171172
{
@@ -182,7 +183,7 @@ public function getPreferredViews()
182183
*
183184
* @return array
184185
*
185-
* @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface
186+
* @see ChoiceListInterface
186187
*/
187188
public function getRemainingViews()
188189
{
@@ -200,7 +201,7 @@ public function getRemainingViews()
200201
*
201202
* @return array
202203
*
203-
* @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface
204+
* @see ChoiceListInterface
204205
*/
205206
public function getChoicesForValues(array $values)
206207
{
@@ -253,7 +254,7 @@ public function getChoicesForValues(array $values)
253254
*
254255
* @return array
255256
*
256-
* @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface
257+
* @see ChoiceListInterface
257258
*/
258259
public function getValuesForChoices(array $entities)
259260
{
@@ -293,7 +294,7 @@ public function getValuesForChoices(array $entities)
293294
*
294295
* @return array
295296
*
296-
* @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface
297+
* @see ChoiceListInterface
297298
*/
298299
public function getIndicesForChoices(array $entities)
299300
{
@@ -333,7 +334,7 @@ public function getIndicesForChoices(array $entities)
333334
*
334335
* @return array
335336
*
336-
* @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface
337+
* @see ChoiceListInterface
337338
*/
338339
public function getIndicesForValues(array $values)
339340
{
@@ -416,6 +417,8 @@ protected function fixIndex($index)
416417

417418
/**
418419
* Loads the list with entities.
420+
*
421+
* @throws StringCastException
419422
*/
420423
private function load()
421424
{

src/Symfony/Bridge/Doctrine/Form/DoctrineOrmExtension.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Bridge\Doctrine\Form;
1313

1414
use Doctrine\Common\Persistence\ManagerRegistry;
15+
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
1516
use Symfony\Component\Form\AbstractExtension;
1617
use Symfony\Component\PropertyAccess\PropertyAccess;
1718

@@ -27,7 +28,7 @@ public function __construct(ManagerRegistry $registry)
2728
protected function loadTypes()
2829
{
2930
return array(
30-
new Type\EntityType($this->registry, PropertyAccess::createPropertyAccessor()),
31+
new EntityType($this->registry, PropertyAccess::createPropertyAccessor()),
3132
);
3233
}
3334

src/Symfony/Bridge/Doctrine/Form/EventListener/MergeDoctrineCollectionListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*
2424
* @author Bernhard Schussek <[email protected]>
2525
*
26-
* @see Doctrine\Common\Collections\Collection
26+
* @see Collection
2727
*/
2828
class MergeDoctrineCollectionListener implements EventSubscriberInterface
2929
{

src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ class DoctrineTokenProvider implements TokenProviderInterface
4141
* Doctrine DBAL database connection
4242
* F.ex. service id: doctrine.dbal.default_connection.
4343
*
44-
* @var \Doctrine\DBAL\Connection
44+
* @var Connection
4545
*/
4646
private $conn;
4747

4848
/**
4949
* new DoctrineTokenProvider for the RemembeMe authentication service.
5050
*
51-
* @param \Doctrine\DBAL\Connection $conn
51+
* @param Connection $conn
5252
*/
5353
public function __construct(Connection $conn)
5454
{
@@ -65,14 +65,10 @@ public function loadTokenBySeries($series)
6565
$paramValues = array('series' => $series);
6666
$paramTypes = array('series' => \PDO::PARAM_STR);
6767
$stmt = $this->conn->executeQuery($sql, $paramValues, $paramTypes);
68-
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
68+
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
69+
6970
if ($row) {
70-
return new PersistentToken($row['class'],
71-
$row['username'],
72-
$series,
73-
$row['value'],
74-
new \DateTime($row['lastUsed'])
75-
);
71+
return new PersistentToken($row['class'], $row['username'], $series, $row['value'], new \DateTime($row['lastUsed']));
7672
}
7773

7874
throw new TokenNotFoundException('No token found.');

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ class UniqueEntityValidator extends ConstraintValidator
2929
*/
3030
private $registry;
3131

32-
/**
33-
* @param ManagerRegistry $registry
34-
*/
3532
public function __construct(ManagerRegistry $registry)
3633
{
3734
$this->registry = $registry;

src/Symfony/Bridge/Monolog/Logger.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function warn($message, array $context = array())
5555
}
5656

5757
/**
58-
* @see Symfony\Component\HttpKernel\Log\DebugLoggerInterface
58+
* {@inheritdoc}
5959
*/
6060
public function getLogs()
6161
{
@@ -67,7 +67,7 @@ public function getLogs()
6767
}
6868

6969
/**
70-
* @see Symfony\Component\HttpKernel\Log\DebugLoggerInterface
70+
* {@inheritdoc}
7171
*/
7272
public function countErrors()
7373
{

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

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

1212
namespace Symfony\Bridge\Propel1\Form\ChoiceList;
1313

14-
use ModelCriteria;
15-
use BaseObject;
16-
use Persistent;
14+
use Symfony\Bridge\Propel1\Form\Type\ModelType;
1715
use Symfony\Component\Form\Exception\StringCastException;
1816
use Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList;
17+
use Symfony\Component\Form\Extension\Core\DataTransformer\ChoiceToValueTransformer;
18+
use Symfony\Component\Form\Extension\Core\DataTransformer\ChoicesToValuesTransformer;
1919
use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
2020
use Symfony\Component\OptionsResolver\Exception\MissingOptionsException;
2121
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
@@ -40,14 +40,14 @@ class ModelChoiceList extends ObjectChoiceList
4040
/**
4141
* The query to retrieve the choices of this list.
4242
*
43-
* @var ModelCriteria
43+
* @var \ModelCriteria
4444
*/
4545
protected $query;
4646

4747
/**
4848
* The query to retrieve the preferred choices for this list.
4949
*
50-
* @var ModelCriteria
50+
* @var \ModelCriteria
5151
*/
5252
protected $preferredQuery;
5353

@@ -68,16 +68,16 @@ class ModelChoiceList extends ObjectChoiceList
6868
/**
6969
* Constructor.
7070
*
71-
* @see \Symfony\Bridge\Propel1\Form\Type\ModelType How to use the preferred choices.
71+
* @see ModelType How to use the preferred choices.
7272
*
7373
* @param string $class The FQCN of the model class to be loaded.
7474
* @param string $labelPath A property path pointing to the property used for the choice labels.
7575
* @param array $choices An optional array to use, rather than fetching the models.
76-
* @param ModelCriteria $queryObject The query to use retrieving model data from database.
76+
* @param \ModelCriteria $queryObject The query to use retrieving model data from database.
7777
* @param string $groupPath A property path pointing to the property used to group the choices.
78-
* @param array|ModelCriteria $preferred The preferred items of this choice.
78+
* @param array|\ModelCriteria $preferred The preferred items of this choice.
7979
* Either an array if $choices is given,
80-
* or a ModelCriteria to be merged with the $queryObject.
80+
* or a \ModelCriteria to be merged with the $queryObject.
8181
* @param PropertyAccessorInterface $propertyAccessor The reflection graph for reading property paths.
8282
*
8383
* @throws MissingOptionsException when no model class is given
@@ -101,7 +101,7 @@ public function __construct($class, $labelPath = null, $choices = null, $queryOb
101101
$this->identifier = $this->query->getTableMap()->getPrimaryKeys();
102102
$this->loaded = is_array($choices) || $choices instanceof \Traversable;
103103

104-
if ($preferred instanceof ModelCriteria) {
104+
if ($preferred instanceof \ModelCriteria) {
105105
$this->preferredQuery = $preferred->mergeWith($this->query);
106106
}
107107

@@ -184,8 +184,8 @@ public function getChoicesForValues(array $values)
184184
* * The choice option "expanded" is set to false.
185185
* * The current request is the submission of the selected value.
186186
*
187-
* @see \Symfony\Component\Form\Extension\Core\DataTransformer\ChoicesToValuesTransformer::reverseTransform
188-
* @see \Symfony\Component\Form\Extension\Core\DataTransformer\ChoiceToValueTransformer::reverseTransform
187+
* @see ChoicesToValuesTransformer::reverseTransform()
188+
* @see ChoiceToValueTransformer::reverseTransform()
189189
*/
190190
if (!$this->loaded) {
191191
if (1 === count($this->identifier)) {
@@ -239,8 +239,8 @@ public function getValuesForChoices(array $models)
239239
* It correlates with the performance optimization in {@link ModelChoiceList::getChoicesForValues()}
240240
* as it won't load the actual entries from the database.
241241
*
242-
* @see \Symfony\Component\Form\Extension\Core\DataTransformer\ChoicesToValuesTransformer::transform
243-
* @see \Symfony\Component\Form\Extension\Core\DataTransformer\ChoiceToValueTransformer::transform
242+
* @see ChoicesToValuesTransformer::transform()
243+
* @see ChoiceToValueTransformer::transform()
244244
*/
245245
if (1 === count($this->identifier)) {
246246
$values = array();
@@ -404,7 +404,7 @@ private function load()
404404
$models = (array) $this->query->find();
405405

406406
$preferred = array();
407-
if ($this->preferredQuery instanceof ModelCriteria) {
407+
if ($this->preferredQuery instanceof \ModelCriteria) {
408408
$preferred = (array) $this->preferredQuery->find();
409409
}
410410

@@ -435,12 +435,12 @@ private function getIdentifierValues($model)
435435
return array();
436436
}
437437

438-
if ($model instanceof Persistent) {
438+
if ($model instanceof \Persistent) {
439439
return array($model->getPrimaryKey());
440440
}
441441

442-
// readonly="true" models do not implement Persistent.
443-
if ($model instanceof BaseObject && method_exists($model, 'getPrimaryKey')) {
442+
// readonly="true" models do not implement \Persistent.
443+
if ($model instanceof \BaseObject && method_exists($model, 'getPrimaryKey')) {
444444
return array($model->getPrimaryKey());
445445
}
446446

src/Symfony/Bridge/ProxyManager/LazyProxy/Instantiator/RuntimeInstantiator.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,13 @@
2727
class RuntimeInstantiator implements InstantiatorInterface
2828
{
2929
/**
30-
* @var \ProxyManager\Factory\LazyLoadingValueHolderFactory
30+
* @var LazyLoadingValueHolderFactory
3131
*/
3232
private $factory;
3333

34-
/**
35-
* Constructor.
36-
*/
3734
public function __construct()
3835
{
3936
$config = new Configuration();
40-
4137
$config->setGeneratorStrategy(new EvaluatingGeneratorStrategy());
4238

4339
$this->factory = new LazyLoadingValueHolderFactory($config);

src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
class ProxyDumper implements DumperInterface
2828
{
2929
/**
30-
* @var \ProxyManager\ProxyGenerator\LazyLoadingValueHolderGenerator
30+
* @var LazyLoadingValueHolderGenerator
3131
*/
3232
private $proxyGenerator;
3333

3434
/**
35-
* @var \ProxyManager\GeneratorStrategy\BaseGeneratorStrategy
35+
* @var BaseGeneratorStrategy
3636
*/
3737
private $classGenerator;
3838

0 commit comments

Comments
 (0)