Skip to content

Commit ca28496

Browse files
authored
Improve phpdoc by using a more specific types
1 parent d9c1305 commit ca28496

File tree

22 files changed

+110
-3
lines changed

22 files changed

+110
-3
lines changed

src/Loggable/LoggableListener.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace Gedmo\Loggable;
1111

1212
use Doctrine\Common\EventArgs;
13+
use Doctrine\Persistence\Event\LoadClassMetadataEventArgs;
1314
use Gedmo\Loggable\Mapping\Event\LoggableAdapter;
1415
use Gedmo\Mapping\MappedEventSubscriber;
1516
use Gedmo\Tool\Wrapper\AbstractWrapper;
@@ -100,6 +101,8 @@ public function getSubscribedEvents()
100101
/**
101102
* Maps additional metadata
102103
*
104+
* @param LoadClassMetadataEventArgs $eventArgs
105+
*
103106
* @return void
104107
*/
105108
public function loadClassMetadata(EventArgs $eventArgs)

src/Loggable/Mapping/Event/Adapter/ORM.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
namespace Gedmo\Loggable\Mapping\Event\Adapter;
1111

12+
use Doctrine\ORM\Mapping\ClassMetadata;
1213
use Gedmo\Loggable\Entity\LogEntry;
1314
use Gedmo\Loggable\Mapping\Event\LoggableAdapter;
1415
use Gedmo\Mapping\Event\Adapter\ORM as BaseAdapterORM;
@@ -26,6 +27,9 @@ public function getDefaultLogEntryClass()
2627
return LogEntry::class;
2728
}
2829

30+
/**
31+
* @param ClassMetadata $meta
32+
*/
2933
public function isPostInsertGenerator($meta)
3034
{
3135
return $meta->idGenerator->isPostInsertGenerator();

src/Mapping/Event/Adapter/ODM.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Doctrine\Common\EventArgs;
1313
use Doctrine\ODM\MongoDB\DocumentManager;
1414
use Doctrine\ODM\MongoDB\Event\LifecycleEventArgs;
15+
use Doctrine\ODM\MongoDB\Mapping\ClassMetadata;
1516
use Gedmo\Exception\RuntimeException;
1617
use Gedmo\Mapping\Event\AdapterInterface;
1718

@@ -58,6 +59,9 @@ public function getManagerName()
5859
return 'ODM';
5960
}
6061

62+
/**
63+
* @param ClassMetadata $meta
64+
*/
6165
public function getRootObjectClass($meta)
6266
{
6367
return $meta->rootDocumentName;

src/Mapping/Event/Adapter/ORM.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Doctrine\Common\EventArgs;
1313
use Doctrine\ORM\EntityManagerInterface;
1414
use Doctrine\ORM\Event\LifecycleEventArgs;
15+
use Doctrine\ORM\Mapping\ClassMetadata;
1516
use Gedmo\Exception\RuntimeException;
1617
use Gedmo\Mapping\Event\AdapterInterface;
1718

@@ -58,6 +59,9 @@ public function getManagerName()
5859
return 'ORM';
5960
}
6061

62+
/**
63+
* @param ClassMetadata $meta
64+
*/
6165
public function getRootObjectClass($meta)
6266
{
6367
return $meta->rootEntityName;
@@ -95,6 +99,9 @@ public function getObjectChangeSet($uow, $object)
9599
return $uow->getEntityChangeSet($object);
96100
}
97101

102+
/**
103+
* @param ClassMetadata $meta
104+
*/
98105
public function getSingleIdentifierFieldName($meta)
99106
{
100107
return $meta->getSingleIdentifierFieldName();

src/ReferenceIntegrity/ReferenceIntegrityListener.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace Gedmo\ReferenceIntegrity;
1111

1212
use Doctrine\Common\EventArgs;
13+
use Doctrine\Persistence\Event\LoadClassMetadataEventArgs;
1314
use Gedmo\Exception\InvalidMappingException;
1415
use Gedmo\Exception\ReferenceIntegrityStrictException;
1516
use Gedmo\Mapping\MappedEventSubscriber;
@@ -36,6 +37,8 @@ public function getSubscribedEvents()
3637
/**
3738
* Maps additional metadata for the Document
3839
*
40+
* @param LoadClassMetadataEventArgs $eventArgs
41+
*
3942
* @return void
4043
*/
4144
public function loadClassMetadata(EventArgs $eventArgs)

src/References/ReferencesListener.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
use Doctrine\Common\Collections\ArrayCollection;
1313
use Doctrine\Common\EventArgs;
14+
use Doctrine\Persistence\Event\LoadClassMetadataEventArgs;
1415
use Doctrine\Persistence\ObjectManager;
1516
use Gedmo\Mapping\MappedEventSubscriber;
1617

@@ -39,6 +40,8 @@ public function __construct(array $managers = [])
3940
}
4041

4142
/**
43+
* @param LoadClassMetadataEventArgs $eventArgs
44+
*
4245
* @return void
4346
*/
4447
public function loadClassMetadata(EventArgs $eventArgs)

src/Sluggable/SluggableListener.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace Gedmo\Sluggable;
1111

1212
use Doctrine\Common\EventArgs;
13+
use Doctrine\Persistence\Event\LoadClassMetadataEventArgs;
1314
use Doctrine\Persistence\ObjectManager;
1415
use Gedmo\Mapping\MappedEventSubscriber;
1516
use Gedmo\Sluggable\Handler\SlugHandlerInterface;
@@ -172,6 +173,8 @@ public function removeManagedFilter($name)
172173
/**
173174
* Mapps additional metadata
174175
*
176+
* @param LoadClassMetadataEventArgs $eventArgs
177+
*
175178
* @return void
176179
*/
177180
public function loadClassMetadata(EventArgs $eventArgs)

src/SoftDeleteable/Mapping/Event/Adapter/ODM.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
namespace Gedmo\SoftDeleteable\Mapping\Event\Adapter;
1111

12+
use Doctrine\ODM\MongoDB\Mapping\ClassMetadata;
1213
use Gedmo\Mapping\Event\Adapter\ODM as BaseAdapterODM;
1314
use Gedmo\SoftDeleteable\Mapping\Event\SoftDeleteableAdapter;
1415

@@ -20,6 +21,9 @@
2021
*/
2122
final class ODM extends BaseAdapterODM implements SoftDeleteableAdapter
2223
{
24+
/**
25+
* @param ClassMetadata $meta
26+
*/
2327
public function getDateValue($meta, $field)
2428
{
2529
$mapping = $meta->getFieldMapping($field);

src/SoftDeleteable/Mapping/Event/Adapter/ORM.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
use Doctrine\DBAL\Types\Type;
1313
use Doctrine\DBAL\Types\Types;
14+
use Doctrine\ORM\Mapping\ClassMetadata;
1415
use Gedmo\Mapping\Event\Adapter\ORM as BaseAdapterORM;
1516
use Gedmo\SoftDeleteable\Mapping\Event\SoftDeleteableAdapter;
1617

@@ -22,6 +23,9 @@
2223
*/
2324
final class ORM extends BaseAdapterORM implements SoftDeleteableAdapter
2425
{
26+
/**
27+
* @param ClassMetadata $meta
28+
*/
2529
public function getDateValue($meta, $field)
2630
{
2731
$mapping = $meta->getFieldMapping($field);

src/SoftDeleteable/SoftDeleteableListener.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
use Doctrine\Common\EventArgs;
1313
use Doctrine\ODM\MongoDB\UnitOfWork as MongoDBUnitOfWork;
14+
use Doctrine\Persistence\Event\LoadClassMetadataEventArgs;
1415
use Gedmo\Mapping\MappedEventSubscriber;
1516

1617
/**
@@ -102,6 +103,8 @@ public function onFlush(EventArgs $args)
102103
/**
103104
* Maps additional metadata
104105
*
106+
* @param LoadClassMetadataEventArgs $eventArgs
107+
*
105108
* @return void
106109
*/
107110
public function loadClassMetadata(EventArgs $eventArgs)

0 commit comments

Comments
 (0)