Skip to content

Commit 017495b

Browse files
author
Hugo Hamon
committed
Fixes various phpdoc and coding standards.
1 parent 2996e32 commit 017495b

File tree

6 files changed

+23
-26
lines changed

6 files changed

+23
-26
lines changed

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
/**

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
{

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

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
{

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.');

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;

0 commit comments

Comments
 (0)