Skip to content

Commit 192c22f

Browse files
authored
chore: enable RemoveDuplicatedReturnSelfDocblockRector (#10389)
1 parent d43762f commit 192c22f

13 files changed

Lines changed: 9 additions & 46 deletions

rector.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector;
2424
use Rector\CodingStyle\Rector\FuncCall\VersionCompareFuncCallToConstantRector;
2525
use Rector\Config\RectorConfig;
26-
use Rector\DeadCode\Rector\ClassMethod\RemoveDuplicatedReturnSelfDocblockRector;
2726
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedConstructorParamRector;
2827
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodRector;
2928
use Rector\DeadCode\Rector\MethodCall\RemoveNullArgOnNullDefaultParamRector;
@@ -178,7 +177,6 @@
178177

179178
// to be applied in separate PRs to ease review
180179
NegatedAndsToPositiveOrsRector::class,
181-
RemoveDuplicatedReturnSelfDocblockRector::class,
182180
])
183181
// auto import fully qualified class names
184182
->withImportNames()

system/DataCaster/DataCaster.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@ public function __construct(
105105
*
106106
* @param array<string, string> $types [field => type]
107107
*
108-
* @return $this
109-
*
110108
* @internal
111109
*/
112110
public function setTypes(array $types): static

system/Database/BaseBuilder.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -577,8 +577,6 @@ public function distinct(bool $val = true)
577577
* Generates the FROM portion of the query
578578
*
579579
* @param array|string $from
580-
*
581-
* @return $this
582580
*/
583581
public function from($from, bool $overwrite = false): self
584582
{
@@ -608,8 +606,6 @@ public function from($from, bool $overwrite = false): self
608606
/**
609607
* @param BaseBuilder $from Expected subquery
610608
* @param string $alias Subquery alias
611-
*
612-
* @return $this
613609
*/
614610
public function fromSubquery(BaseBuilder $from, string $alias): self
615611
{

system/HTTP/MessageTrait.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,10 @@ trait MessageTrait
4848
// --------------------------------------------------------------------
4949
// Body
5050
// --------------------------------------------------------------------
51-
5251
/**
5352
* Sets the body of the current message.
5453
*
5554
* @param string $data
56-
*
57-
* @return $this
5855
*/
5956
public function setBody($data): self
6057
{
@@ -67,8 +64,6 @@ public function setBody($data): self
6764
* Appends data to the body of the current message.
6865
*
6966
* @param string $data
70-
*
71-
* @return $this
7267
*/
7368
public function appendBody($data): self
7469
{
@@ -144,8 +139,6 @@ public function header($name)
144139
* Sets a header and it's value.
145140
*
146141
* @param array|string|null $value
147-
*
148-
* @return $this
149142
*/
150143
public function setHeader(string $name, $value): self
151144
{
@@ -191,8 +184,6 @@ private function checkMultipleHeaders(string $name): void
191184

192185
/**
193186
* Removes a header from the list of headers we track.
194-
*
195-
* @return $this
196187
*/
197188
public function removeHeader(string $name): self
198189
{
@@ -205,8 +196,6 @@ public function removeHeader(string $name): self
205196
/**
206197
* Adds an additional header value to any headers that accept
207198
* multiple values (i.e. are an array or implement ArrayAccess)
208-
*
209-
* @return $this
210199
*/
211200
public function appendHeader(string $name, ?string $value): self
212201
{
@@ -225,8 +214,6 @@ public function appendHeader(string $name, ?string $value): self
225214
* Adds a header (not a header value) with the same name.
226215
* Use this only when you set multiple headers with the same name,
227216
* typically, for `Set-Cookie`.
228-
*
229-
* @return $this
230217
*/
231218
public function addHeader(string $name, string $value): static
232219
{
@@ -251,8 +238,6 @@ public function addHeader(string $name, string $value): static
251238
/**
252239
* Adds an additional header value to any headers that accept
253240
* multiple values (i.e. are an array or implement ArrayAccess)
254-
*
255-
* @return $this
256241
*/
257242
public function prependHeader(string $name, string $value): self
258243
{
@@ -277,8 +262,6 @@ protected function getHeaderName(string $name): string
277262
/**
278263
* Sets the HTTP protocol version.
279264
*
280-
* @return $this
281-
*
282265
* @throws HTTPException For invalid protocols
283266
*/
284267
public function setProtocolVersion(string $version): self

system/HTTP/RedirectResponse.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ public function withInput()
108108
* If the validation has any errors, transmit those back
109109
* so they can be displayed when the validation is handled
110110
* within a method different than displaying the form.
111-
*
112-
* @return $this
113111
*/
114112
private function withErrors(): self
115113
{

system/Images/Handlers/ImageMagickHandler.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,8 +537,6 @@ public function reorient(bool $silent = false)
537537
/**
538538
* Clears metadata from the image.
539539
*
540-
* @return $this
541-
*
542540
* @throws ImagickException
543541
*/
544542
public function clearMetadata(): static

system/Images/ImageHandlerInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,6 @@ public function save(?string $target = null, int $quality = 90);
152152

153153
/**
154154
* Clear metadata before saving image as a new file.
155-
*
156-
* @return $this
157155
*/
158156
public function clearMetadata(): static;
159157
}

system/Traits/ConditionalTrait.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ trait ConditionalTrait
2323
* @param TWhen $condition
2424
* @param callable(self, TWhen): mixed $callback
2525
* @param (callable(self): mixed)|null $defaultCallback
26-
*
27-
* @return $this
2826
*/
2927
public function when($condition, callable $callback, ?callable $defaultCallback = null): self
3028
{
@@ -45,8 +43,6 @@ public function when($condition, callable $callback, ?callable $defaultCallback
4543
* @param TWhenNot $condition
4644
* @param callable(self, TWhenNot): mixed $callback
4745
* @param (callable(self): mixed)|null $defaultCallback
48-
*
49-
* @return $this
5046
*/
5147
public function whenNot($condition, callable $callback, ?callable $defaultCallback = null): self
5248
{

system/Traits/PropertiesTrait.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ trait PropertiesTrait
2727
{
2828
/**
2929
* Attempts to set the values of public class properties.
30-
*
31-
* @return $this
3230
*/
3331
final public function fill(array $params): self
3432
{
@@ -43,10 +41,15 @@ final public function fill(array $params): self
4341

4442
/**
4543
* Get the public properties of the class and return as an array.
44+
*
45+
* @return array<string, mixed>
4646
*/
4747
final public function getPublicProperties(): array
4848
{
4949
$worker = new class () {
50+
/**
51+
* @return array<string, mixed>
52+
*/
5053
public function getProperties(object $obj): array
5154
{
5255
return get_object_vars($obj);

utils/phpstan-baseline/empty.notAllowed.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# total 213 errors
1+
# total 212 errors
22

33
parameters:
44
ignoreErrors:

0 commit comments

Comments
 (0)