Skip to content

Commit 5228cf6

Browse files
Merge branch '5.4' into 6.0
* 5.4: [Serializer] cs fix Cleanup more `@return` annotations [Form] Fix phpdoc on FormBuilderInterface
2 parents af7a52b + b7c8db9 commit 5228cf6

15 files changed

+7
-155
lines changed

BinaryFileResponse.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ public function setFile(\SplFileInfo|string $file, string $contentDisposition =
9595

9696
/**
9797
* Gets the file.
98-
*
99-
* @return File The file to stream
10098
*/
10199
public function getFile(): File
102100
{

File/File.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ public function __construct(string $path, bool $checkPath = true)
4747
* This method uses the mime type as guessed by getMimeType()
4848
* to guess the file extension.
4949
*
50-
* @return string|null The guessed extension or null if it cannot be guessed
51-
*
5250
* @see MimeTypes
5351
* @see getMimeType()
5452
*/
@@ -68,8 +66,6 @@ public function guessExtension(): ?string
6866
* which uses finfo_file() then the "file" system binary,
6967
* depending on which of those are available.
7068
*
71-
* @return string|null The guessed mime type (e.g. "application/pdf")
72-
*
7369
* @see MimeTypes
7470
*/
7571
public function getMimeType(): ?string
@@ -84,8 +80,6 @@ public function getMimeType(): ?string
8480
/**
8581
* Moves the file to a new location.
8682
*
87-
* @return self A File object representing the new file
88-
*
8983
* @throws FileException if the target file could not be created
9084
*/
9185
public function move(string $directory, string $name = null): self

File/UploadedFile.php

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ public function __construct(string $path, string $originalName, string $mimeType
7575
*
7676
* It is extracted from the request from which the file has been uploaded.
7777
* Then it should not be considered as a safe value.
78-
*
79-
* @return string The original name
8078
*/
8179
public function getClientOriginalName(): string
8280
{
@@ -88,8 +86,6 @@ public function getClientOriginalName(): string
8886
*
8987
* It is extracted from the original file name that was uploaded.
9088
* Then it should not be considered as a safe value.
91-
*
92-
* @return string The extension
9389
*/
9490
public function getClientOriginalExtension(): string
9591
{
@@ -105,8 +101,6 @@ public function getClientOriginalExtension(): string
105101
* For a trusted mime type, use getMimeType() instead (which guesses the mime
106102
* type based on the file content).
107103
*
108-
* @return string The mime type
109-
*
110104
* @see getMimeType()
111105
*/
112106
public function getClientMimeType(): string
@@ -126,8 +120,6 @@ public function getClientMimeType(): string
126120
* For a trusted extension, use guessExtension() instead (which guesses
127121
* the extension based on the guessed mime type for the file).
128122
*
129-
* @return string|null The guessed extension or null if it cannot be guessed
130-
*
131123
* @see guessExtension()
132124
* @see getClientMimeType()
133125
*/
@@ -145,18 +137,14 @@ public function guessClientExtension(): ?string
145137
*
146138
* If the upload was successful, the constant UPLOAD_ERR_OK is returned.
147139
* Otherwise one of the other UPLOAD_ERR_XXX constants is returned.
148-
*
149-
* @return int The upload error
150140
*/
151141
public function getError(): int
152142
{
153143
return $this->error;
154144
}
155145

156146
/**
157-
* Returns whether the file was uploaded successfully.
158-
*
159-
* @return bool True if the file has been uploaded with HTTP and no error occurred
147+
* Returns whether the file has been uploaded with HTTP and no error occurred.
160148
*/
161149
public function isValid(): bool
162150
{
@@ -168,8 +156,6 @@ public function isValid(): bool
168156
/**
169157
* Moves the file to a new location.
170158
*
171-
* @return File A File object representing the new file
172-
*
173159
* @throws FileException if, for any reason, the file could not have been moved
174160
*/
175161
public function move(string $directory, string $name = null): File
@@ -258,8 +244,6 @@ private static function parseFilesize(string $size): int|float
258244

259245
/**
260246
* Returns an informative upload error message.
261-
*
262-
* @return string The error message regarding the specified error code
263247
*/
264248
public function getErrorMessage(): string
265249
{

HeaderBag.php

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ public function __toString(): string
5757
* Returns the headers.
5858
*
5959
* @param string|null $key The name of the headers to return or null to get them all
60-
*
61-
* @return array An array of headers
6260
*/
6361
public function all(string $key = null): array
6462
{
@@ -71,8 +69,6 @@ public function all(string $key = null): array
7169

7270
/**
7371
* Returns the parameter keys.
74-
*
75-
* @return array An array of parameter keys
7672
*/
7773
public function keys(): array
7874
{
@@ -99,9 +95,7 @@ public function add(array $headers)
9995
}
10096

10197
/**
102-
* Returns a header value by name.
103-
*
104-
* @return string|null The first header value or default value
98+
* Returns the first header by name or the default one.
10599
*/
106100
public function get(string $key, string $default = null): ?string
107101
{
@@ -151,8 +145,6 @@ public function set(string $key, string|array|null $values, bool $replace = true
151145

152146
/**
153147
* Returns true if the HTTP header is defined.
154-
*
155-
* @return bool true if the parameter exists, false otherwise
156148
*/
157149
public function has(string $key): bool
158150
{
@@ -161,8 +153,6 @@ public function has(string $key): bool
161153

162154
/**
163155
* Returns true if the given HTTP header contains the given value.
164-
*
165-
* @return bool true if the value is contained in the header, false otherwise
166156
*/
167157
public function contains(string $key, string $value): bool
168158
{
@@ -186,8 +176,6 @@ public function remove(string $key)
186176
/**
187177
* Returns the HTTP header value converted to a date.
188178
*
189-
* @return \DateTimeInterface|null The parsed DateTime or the default value if the header does not exist
190-
*
191179
* @throws \RuntimeException When the HTTP header is not parseable
192180
*/
193181
public function getDate(string $key, \DateTime $default = null): ?\DateTimeInterface
@@ -215,8 +203,6 @@ public function addCacheControlDirective(string $key, bool|string $value = true)
215203

216204
/**
217205
* Returns true if the Cache-Control directive is defined.
218-
*
219-
* @return bool true if the directive exists, false otherwise
220206
*/
221207
public function hasCacheControlDirective(string $key): bool
222208
{
@@ -225,8 +211,6 @@ public function hasCacheControlDirective(string $key): bool
225211

226212
/**
227213
* Returns a Cache-Control directive value by name.
228-
*
229-
* @return bool|string|null The directive value if defined, null otherwise
230214
*/
231215
public function getCacheControlDirective(string $key): bool|string|null
232216
{
@@ -268,8 +252,6 @@ protected function getCacheControlHeader()
268252

269253
/**
270254
* Parses a Cache-Control HTTP header.
271-
*
272-
* @return array An array representing the attribute values
273255
*/
274256
protected function parseCacheControl(string $header): array
275257
{

HeaderUtils.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,6 @@ public static function unquote(string $s): string
154154
* is semantically equivalent to $filename. If the filename is already ASCII,
155155
* it can be omitted, or just copied from $filename
156156
*
157-
* @return string A string suitable for use as a Content-Disposition field-value
158-
*
159157
* @throws \InvalidArgumentException
160158
*
161159
* @see RFC 6266

IpUtils.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ private function __construct()
3131
* Checks if an IPv4 or IPv6 address is contained in the list of given IPs or subnets.
3232
*
3333
* @param string|array $ips List of IPs or subnets (can be a string if only a single one)
34-
*
35-
* @return bool Whether the IP is valid
3634
*/
3735
public static function checkIp(?string $requestIp, string|array $ips): bool
3836
{
@@ -102,8 +100,6 @@ public static function checkIp4(?string $requestIp, string $ip): bool
102100
*
103101
* @param string $ip IPv6 address or subnet in CIDR notation
104102
*
105-
* @return bool Whether the IP is valid
106-
*
107103
* @throws \RuntimeException When IPV6 support is not enabled
108104
*/
109105
public static function checkIp6(?string $requestIp, string $ip): bool

ParameterBag.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ public function __construct(array $parameters = [])
3434
* Returns the parameters.
3535
*
3636
* @param string|null $key The name of the parameter to return or null to get them all
37-
*
38-
* @return array An array of parameters
3937
*/
4038
public function all(/*string $key = null*/): array
4139
{
@@ -54,8 +52,6 @@ public function all(/*string $key = null*/): array
5452

5553
/**
5654
* Returns the parameter keys.
57-
*
58-
* @return array An array of parameter keys
5955
*/
6056
public function keys(): array
6157
{
@@ -90,8 +86,6 @@ public function set(string $key, mixed $value)
9086

9187
/**
9288
* Returns true if the parameter is defined.
93-
*
94-
* @return bool true if the parameter exists, false otherwise
9589
*/
9690
public function has(string $key): bool
9791
{
@@ -108,8 +102,6 @@ public function remove(string $key)
108102

109103
/**
110104
* Returns the alphabetic characters of the parameter value.
111-
*
112-
* @return string The filtered value
113105
*/
114106
public function getAlpha(string $key, string $default = ''): string
115107
{
@@ -118,8 +110,6 @@ public function getAlpha(string $key, string $default = ''): string
118110

119111
/**
120112
* Returns the alphabetic characters and digits of the parameter value.
121-
*
122-
* @return string The filtered value
123113
*/
124114
public function getAlnum(string $key, string $default = ''): string
125115
{
@@ -128,8 +118,6 @@ public function getAlnum(string $key, string $default = ''): string
128118

129119
/**
130120
* Returns the digits of the parameter value.
131-
*
132-
* @return string The filtered value
133121
*/
134122
public function getDigits(string $key, string $default = ''): string
135123
{
@@ -139,8 +127,6 @@ public function getDigits(string $key, string $default = ''): string
139127

140128
/**
141129
* Returns the parameter value converted to integer.
142-
*
143-
* @return int The filtered value
144130
*/
145131
public function getInt(string $key, int $default = 0): int
146132
{
@@ -149,8 +135,6 @@ public function getInt(string $key, int $default = 0): int
149135

150136
/**
151137
* Returns the parameter value converted to boolean.
152-
*
153-
* @return bool The filtered value
154138
*/
155139
public function getBoolean(string $key, bool $default = false): bool
156140
{

RedirectResponse.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ public function __construct(string $url, int $status = 302, array $headers = [])
4949

5050
/**
5151
* Returns the target URL.
52-
*
53-
* @return string target URL
5452
*/
5553
public function getTargetUrl(): string
5654
{

0 commit comments

Comments
 (0)