Skip to content

Commit 3bdde9e

Browse files
committed
Fix PHPDoc syntax in @param, @return and @throws docblocks
1 parent 921636d commit 3bdde9e

File tree

29 files changed

+169
-183
lines changed

29 files changed

+169
-183
lines changed

src/Loggable/Document/Repository/LogEntryRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ protected function fillDocument($document, array $data)
133133
/**
134134
* Get the currently used LoggableListener
135135
*
136-
* @throws \Gedmo\Exception\RuntimeException - if listener is not found
136+
* @throws \Gedmo\Exception\RuntimeException if listener is not found
137137
*
138138
* @return LoggableListener
139139
*/

src/Loggable/Entity/Repository/LogEntryRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ protected function mapValue(ClassMetadata $objectMeta, $field, &$value)
134134
/**
135135
* Get the currently used LoggableListener
136136
*
137-
* @throws \Gedmo\Exception\RuntimeException - if listener is not found
137+
* @throws \Gedmo\Exception\RuntimeException if listener is not found
138138
*
139139
* @return LoggableListener
140140
*/

src/Mapping/Driver/AbstractAnnotationDriver.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ public function validateFullMetadata(ClassMetadata $meta, array $config)
9090
/**
9191
* Try to find out related class name out of mapping
9292
*
93-
* @param ClassMetadata $metadata - the mapped class metadata
94-
* @param $name - the related object class name
93+
* @param ClassMetadata $metadata the mapped class metadata
94+
* @param string $name the related object class name
9595
*
96-
* @return string - related class name or empty string if does not exist
96+
* @return string related class name or empty string if does not exist
9797
*/
9898
protected function getRelatedClassName($metadata, $name)
9999
{

src/Mapping/Driver/AnnotationDriverInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ interface AnnotationDriverInterface extends Driver
2222
* getPropertyAnnotations([reflectionProperty])
2323
* getPropertyAnnotation([reflectionProperty], [name])
2424
*
25-
* @param object $reader - annotation reader class
25+
* @param object $reader annotation reader class
2626
*/
2727
public function setAnnotationReader($reader);
2828
}

src/Mapping/Driver/Chain.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@ public function readExtendedMetadata($meta, array &$config)
9090

9191
/**
9292
* Passes in the mapping read by original driver
93-
*
94-
* @param $driver
95-
*
96-
* @return void
9793
*/
9894
public function setOriginalDriver($driver)
9995
{

src/Mapping/Driver/File.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Gedmo\Mapping\Driver;
44

5+
use Doctrine\Persistence\Mapping\ClassMetadata;
56
use Doctrine\Persistence\Mapping\Driver\FileDriver;
67
use Doctrine\Persistence\Mapping\Driver\FileLocator;
78
use Gedmo\Mapping\Driver;
@@ -123,10 +124,10 @@ public function setOriginalDriver($driver)
123124
/**
124125
* Try to find out related class name out of mapping
125126
*
126-
* @param $metadata - the mapped class metadata
127-
* @param $name - the related object class name
127+
* @param ClassMetadata $metadata the mapped class metadata
128+
* @param string $name the related object class name
128129
*
129-
* @return string - related class name or empty string if does not exist
130+
* @return string related class name or empty string if does not exist
130131
*/
131132
protected function getRelatedClassName($metadata, $name)
132133
{

src/Mapping/ExtensionMetadataFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function __construct(ObjectManager $objectManager, $extensionNamespace, $
7171
*
7272
* @param object $meta
7373
*
74-
* @return array - the metatada configuration
74+
* @return array the metatada configuration
7575
*/
7676
public function getExtensionMetadata($meta)
7777
{

src/Mapping/MappedEventSubscriber.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function __construct()
8585
* Get an event adapter to handle event specific
8686
* methods
8787
*
88-
* @throws \Gedmo\Exception\InvalidArgumentException - if event is not recognized
88+
* @throws \Gedmo\Exception\InvalidArgumentException if event is not recognized
8989
*
9090
* @return \Gedmo\Mapping\Event\AdapterInterface
9191
*/
@@ -179,7 +179,7 @@ public function getExtensionMetadataFactory(ObjectManager $objectManager)
179179
* getPropertyAnnotations([reflectionProperty])
180180
* getPropertyAnnotation([reflectionProperty], [name])
181181
*
182-
* @param Reader $reader - annotation reader class
182+
* @param Reader $reader annotation reader class
183183
*/
184184
public function setAnnotationReader($reader)
185185
{

src/References/Mapping/Driver/Annotation.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,6 @@ public function readExtendedMetadata($meta, array &$config)
9191

9292
/**
9393
* Passes in the mapping read by original driver
94-
*
95-
* @param $driver
96-
*
97-
* @return void
9894
*/
9995
public function setOriginalDriver($driver)
10096
{

src/Sluggable/Mapping/Driver/Annotation.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Gedmo\Sluggable\Mapping\Driver;
44

5+
use Doctrine\Persistence\Mapping\ClassMetadata;
56
use Gedmo\Exception\InvalidMappingException;
67
use Gedmo\Mapping\Annotation\Slug;
78
use Gedmo\Mapping\Annotation\SlugHandler;
@@ -64,7 +65,7 @@ public function readExtendedMetadata($meta, array &$config)
6465
) {
6566
continue;
6667
}
67-
$config = $this->retrieveSlug($meta, $config, $property, '');
68+
$config = $this->retrieveSlug($meta, $config, $property);
6869
}
6970

7071
// Embedded entity
@@ -81,15 +82,11 @@ public function readExtendedMetadata($meta, array &$config)
8182
}
8283

8384
/**
84-
* @param $meta
85-
* @param $property
86-
* @param $fieldNamePrefix
87-
*
88-
* @return array
85+
* @return array<string, array<string, mixed>>
8986
*/
90-
private function retrieveSlug($meta, array &$config, $property, $fieldNamePrefix)
87+
private function retrieveSlug(ClassMetadata $meta, array &$config, \ReflectionProperty $property, ?string $fieldNamePrefix = null): array
9188
{
92-
$fieldName = $fieldNamePrefix ? ($fieldNamePrefix.'.'.$property->getName()) : $property->getName();
89+
$fieldName = null !== $fieldNamePrefix ? ($fieldNamePrefix.'.'.$property->getName()) : $property->getName();
9390
// slug property
9491
if ($slug = $this->reader->getPropertyAnnotation($property, self::SLUG)) {
9592
if (!$meta->hasField($fieldName)) {
@@ -127,7 +124,7 @@ private function retrieveSlug($meta, array &$config, $property, $fieldNamePrefix
127124
throw new InvalidMappingException("Slug must contain at least one field for slug generation in class - {$meta->name}");
128125
}
129126
foreach ($slug->fields as $slugField) {
130-
$slugFieldWithPrefix = $fieldNamePrefix ? ($fieldNamePrefix.'.'.$slugField) : $slugField;
127+
$slugFieldWithPrefix = null !== $fieldNamePrefix ? ($fieldNamePrefix.'.'.$slugField) : $slugField;
131128
if (!$meta->hasField($slugFieldWithPrefix)) {
132129
throw new InvalidMappingException("Unable to find slug [{$slugFieldWithPrefix}] as mapped property in entity - {$meta->name}");
133130
}
@@ -152,7 +149,7 @@ private function retrieveSlug($meta, array &$config, $property, $fieldNamePrefix
152149
}
153150
$sluggableFields = [];
154151
foreach ($slug->fields as $field) {
155-
$sluggableFields[] = $fieldNamePrefix ? ($fieldNamePrefix.'.'.$field) : $field;
152+
$sluggableFields[] = null !== $fieldNamePrefix ? ($fieldNamePrefix.'.'.$field) : $field;
156153
}
157154

158155
// set all options

0 commit comments

Comments
 (0)