Skip to content

Commit f7d2ceb

Browse files
Cleanup more @return annotations
1 parent 44db13e commit f7d2ceb

25 files changed

+61
-69
lines changed

Constraint.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ abstract class Constraint
6161
/**
6262
* Returns the name of the given error code.
6363
*
64-
* @return string The name of the error code
64+
* @return string
6565
*
6666
* @throws InvalidArgumentException If the error code does not exist
6767
*/
@@ -201,7 +201,7 @@ public function __set(string $option, $value)
201201
* this method will be called at most once per constraint instance and
202202
* option name.
203203
*
204-
* @return mixed The value of the option
204+
* @return mixed
205205
*
206206
* @throws InvalidOptionsException If an invalid option name is given
207207
*/

ConstraintValidator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function initialize(ExecutionContextInterface $context)
5454
*
5555
* @param mixed $value The value to return the type of
5656
*
57-
* @return string The type of the value
57+
* @return string
5858
*/
5959
protected function formatTypeOf($value)
6060
{
@@ -82,7 +82,7 @@ protected function formatTypeOf($value)
8282
* @param int $format A bitwise combination of the format
8383
* constants in this class
8484
*
85-
* @return string The string representation of the passed value
85+
* @return string
8686
*/
8787
protected function formatValue($value, int $format = 0)
8888
{
@@ -144,7 +144,7 @@ protected function formatValue($value, int $format = 0)
144144
* @param int $format A bitwise combination of the format
145145
* constants in this class
146146
*
147-
* @return string The string representation of the value list
147+
* @return string
148148
*
149149
* @see formatValue()
150150
*/

ConstraintViolation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function __construct($message, ?string $messageTemplate, array $parameter
7070
/**
7171
* Converts the violation into a string for debugging purposes.
7272
*
73-
* @return string The violation as string
73+
* @return string
7474
*/
7575
public function __toString()
7676
{
@@ -154,7 +154,7 @@ public function getInvalidValue()
154154
/**
155155
* Returns the constraint whose validation caused the violation.
156156
*
157-
* @return Constraint|null The constraint or null if it is not known
157+
* @return Constraint|null
158158
*/
159159
public function getConstraint()
160160
{

ConstraintViolationInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ interface ConstraintViolationInterface
3636
/**
3737
* Returns the violation message.
3838
*
39-
* @return string|\Stringable The violation message as a string or a stringable object
39+
* @return string|\Stringable
4040
*/
4141
public function getMessage();
4242

@@ -114,7 +114,7 @@ public function getInvalidValue();
114114
/**
115115
* Returns a machine-digestible error code for the violation.
116116
*
117-
* @return string|null The error code
117+
* @return string|null
118118
*/
119119
public function getCode();
120120
}

ConstraintViolationList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static function createFromMessage(string $message): self
4646
/**
4747
* Converts the violation into a string for debugging purposes.
4848
*
49-
* @return string The violation as string
49+
* @return string
5050
*/
5151
public function __toString()
5252
{

ConstraintViolationListInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function addAll(self $otherList);
3333
*
3434
* @param int $offset The offset of the violation
3535
*
36-
* @return ConstraintViolationInterface The violation
36+
* @return ConstraintViolationInterface
3737
*
3838
* @throws \OutOfBoundsException if the offset does not exist
3939
*/
@@ -44,7 +44,7 @@ public function get(int $offset);
4444
*
4545
* @param int $offset The violation offset
4646
*
47-
* @return bool Whether the offset exists
47+
* @return bool
4848
*/
4949
public function has(int $offset);
5050

Constraints/AbstractComparisonValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ private function getPropertyAccessor(): PropertyAccessorInterface
106106
* @param mixed $value1 The first value to compare
107107
* @param mixed $value2 The second value to compare
108108
*
109-
* @return bool true if the relationship is valid, false otherwise
109+
* @return bool
110110
*/
111111
abstract protected function compareValues($value1, $value2);
112112

113113
/**
114114
* Returns the error code used if the comparison fails.
115115
*
116-
* @return string|null The error code or `null` if no code should be set
116+
* @return string|null
117117
*/
118118
protected function getErrorCode()
119119
{

Constraints/Composite.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function addImplicitGroupName(string $group)
130130
/**
131131
* Returns the name of the property that contains the nested constraints.
132132
*
133-
* @return string The property name
133+
* @return string
134134
*/
135135
abstract protected function getCompositeOption();
136136

Context/ExecutionContextFactoryInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ interface ExecutionContextFactoryInterface
2929
* @param mixed $root The root value of the validated
3030
* object graph
3131
*
32-
* @return ExecutionContextInterface The new execution context
32+
* @return ExecutionContextInterface
3333
*/
3434
public function createContext(ValidatorInterface $validator, $root);
3535
}

Context/ExecutionContextInterface.php

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function addViolation(string $message, array $params = []);
8484
* @param string|\Stringable $message The error message as a string or a stringable object
8585
* @param array $parameters The parameters substituted in the error message
8686
*
87-
* @return ConstraintViolationBuilderInterface The violation builder
87+
* @return ConstraintViolationBuilderInterface
8888
*/
8989
public function buildViolation(string $message, array $parameters = []);
9090

@@ -118,7 +118,7 @@ public function getValidator();
118118
*
119119
* In other cases, null is returned.
120120
*
121-
* @return object|null The currently validated object or null
121+
* @return object|null
122122
*/
123123
public function getObject();
124124

@@ -171,8 +171,7 @@ public function markGroupAsValidated(string $cacheKey, string $groupHash);
171171
* @param string $groupHash The group's name or hash, if it is group
172172
* sequence
173173
*
174-
* @return bool Whether the object was already validated for that
175-
* group
174+
* @return bool
176175
*
177176
* @internal Used by the validator engine. Should not be called by user
178177
* code.
@@ -196,7 +195,7 @@ public function markConstraintAsValidated(string $cacheKey, string $constraintHa
196195
* @param string $cacheKey The hash of the object
197196
* @param string $constraintHash The hash of the constraint
198197
*
199-
* @return bool Whether the constraint was already validated
198+
* @return bool
200199
*
201200
* @internal Used by the validator engine. Should not be called by user
202201
* code.
@@ -220,7 +219,7 @@ public function markObjectAsInitialized(string $cacheKey);
220219
*
221220
* @param string $cacheKey The hash of the object
222221
*
223-
* @return bool Whether the object was already initialized
222+
* @return bool
224223
*
225224
* @internal Used by the validator engine. Should not be called by user
226225
* code.
@@ -232,7 +231,7 @@ public function isObjectInitialized(string $cacheKey);
232231
/**
233232
* Returns the violations generated by the validator so far.
234233
*
235-
* @return ConstraintViolationListInterface The constraint violation list
234+
* @return ConstraintViolationListInterface
236235
*/
237236
public function getViolations();
238237

@@ -245,7 +244,7 @@ public function getViolations();
245244
*
246245
* The current value is returned by {@link getValue}.
247246
*
248-
* @return mixed The root value of the validation
247+
* @return mixed
249248
*/
250249
public function getRoot();
251250

@@ -255,7 +254,7 @@ public function getRoot();
255254
* If you want to retrieve the object that was originally passed to the
256255
* validator, use {@link getRoot}.
257256
*
258-
* @return mixed The currently validated value
257+
* @return mixed
259258
*/
260259
public function getValue();
261260

@@ -272,15 +271,14 @@ public function getValue();
272271
* has been called with a plain value and constraint, this method returns
273272
* null.
274273
*
275-
* @return MetadataInterface|null the metadata of the currently validated
276-
* value
274+
* @return MetadataInterface|null
277275
*/
278276
public function getMetadata();
279277

280278
/**
281279
* Returns the validation group that is currently being validated.
282280
*
283-
* @return string|null The current validation group
281+
* @return string|null
284282
*/
285283
public function getGroup();
286284

@@ -291,7 +289,7 @@ public function getGroup();
291289
* {@link Mapping\ClassMetadataInterface} or if no metadata is available for the
292290
* current node, this method returns null.
293291
*
294-
* @return string|null The class name or null, if no class name could be found
292+
* @return string|null
295293
*/
296294
public function getClassName();
297295

@@ -302,7 +300,7 @@ public function getClassName();
302300
* {@link PropertyMetadataInterface} or if no metadata is available for the
303301
* current node, this method returns null.
304302
*
305-
* @return string|null The property name or null, if no property name could be found
303+
* @return string|null
306304
*/
307305
public function getPropertyName();
308306

GroupSequenceProviderInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ interface GroupSequenceProviderInterface
2222
* Returns which validation groups should be used for a certain state
2323
* of the object.
2424
*
25-
* @return string[]|string[][]|GroupSequence An array of validation groups
25+
* @return string[]|string[][]|GroupSequence
2626
*/
2727
public function getGroupSequence();
2828
}

Mapping/ClassMetadata.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public function getClassName()
164164
* will validate the group sequence. The constraints assigned to "Default"
165165
* can still be validated by validating the class in "<ClassName>".
166166
*
167-
* @return string The name of the default group
167+
* @return string
168168
*/
169169
public function getDefaultGroup()
170170
{

Mapping/ClassMetadataInterface.php

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

1212
namespace Symfony\Component\Validator\Mapping;
1313

14+
use Symfony\Component\Validator\Constraints\GroupSequence;
15+
use Symfony\Component\Validator\GroupSequenceProviderInterface;
16+
1417
/**
1518
* Stores all metadata needed for validating objects of specific class.
1619
*
@@ -24,16 +27,16 @@
2427
* @author Bernhard Schussek <[email protected]>
2528
*
2629
* @see MetadataInterface
27-
* @see \Symfony\Component\Validator\Constraints\GroupSequence
28-
* @see \Symfony\Component\Validator\GroupSequenceProviderInterface
30+
* @see GroupSequence
31+
* @see GroupSequenceProviderInterface
2932
* @see TraversalStrategy
3033
*/
3134
interface ClassMetadataInterface extends MetadataInterface
3235
{
3336
/**
3437
* Returns the names of all constrained properties.
3538
*
36-
* @return string[] A list of property names
39+
* @return string[]
3740
*/
3841
public function getConstrainedProperties();
3942

@@ -42,19 +45,15 @@ public function getConstrainedProperties();
4245
*
4346
* If it is, you can access the group sequence with {@link getGroupSequence()}.
4447
*
45-
* @return bool Returns true if the "Default" group is overridden
46-
*
47-
* @see \Symfony\Component\Validator\Constraints\GroupSequence
48+
* @return bool
4849
*/
4950
public function hasGroupSequence();
5051

5152
/**
5253
* Returns the group sequence that overrides the "Default" group for this
5354
* class.
5455
*
55-
* @return \Symfony\Component\Validator\Constraints\GroupSequence|null The group sequence or null
56-
*
57-
* @see \Symfony\Component\Validator\Constraints\GroupSequence
56+
* @return GroupSequence|null
5857
*/
5958
public function getGroupSequence();
6059

@@ -63,14 +62,11 @@ public function getGroupSequence();
6362
* sequence obtained by the validated objects.
6463
*
6564
* If this method returns true, the class must implement
66-
* {@link \Symfony\Component\Validator\GroupSequenceProviderInterface}.
65+
* {@link GroupSequenceProviderInterface}.
6766
* This interface will be used to obtain the group sequence when an object
6867
* of this class is validated.
6968
*
70-
* @return bool Returns true if the "Default" group is overridden by
71-
* a dynamic group sequence
72-
*
73-
* @see \Symfony\Component\Validator\GroupSequenceProviderInterface
69+
* @return bool
7470
*/
7571
public function isGroupSequenceProvider();
7672

@@ -98,7 +94,7 @@ public function getPropertyMetadata(string $property);
9894
/**
9995
* Returns the name of the backing PHP class.
10096
*
101-
* @return string The name of the backing class
97+
* @return string
10298
*/
10399
public function getClassName();
104100
}

Mapping/Factory/MetadataFactoryInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ interface MetadataFactoryInterface
2626
*
2727
* @param mixed $value Some value
2828
*
29-
* @return MetadataInterface The metadata for the value
29+
* @return MetadataInterface
3030
*
3131
* @throws NoSuchMetadataException If no metadata exists for the given value
3232
*/
@@ -37,7 +37,7 @@ public function getMetadataFor($value);
3737
*
3838
* @param mixed $value Some value
3939
*
40-
* @return bool Whether metadata can be returned for that value
40+
* @return bool
4141
*/
4242
public function hasMetadataFor($value);
4343
}

Mapping/Loader/FilesLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct(array $paths)
3535
/**
3636
* Returns an array of file loaders for the given file paths.
3737
*
38-
* @return LoaderInterface[] The metadata loaders
38+
* @return LoaderInterface[]
3939
*/
4040
protected function getFileLoaders(array $paths)
4141
{
@@ -51,7 +51,7 @@ protected function getFileLoaders(array $paths)
5151
/**
5252
* Creates a loader for the given file path.
5353
*
54-
* @return LoaderInterface The created loader
54+
* @return LoaderInterface
5555
*/
5656
abstract protected function getFileLoaderInstance(string $path);
5757
}

Mapping/Loader/LoaderInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ interface LoaderInterface
2323
/**
2424
* Loads validation metadata into a {@link ClassMetadata} instance.
2525
*
26-
* @return bool Whether the loader succeeded
26+
* @return bool
2727
*/
2828
public function loadClassMetadata(ClassMetadata $metadata);
2929
}

0 commit comments

Comments
 (0)