diff --git a/rector.php b/rector.php index c3a1b22ad716..ba14babedae0 100644 --- a/rector.php +++ b/rector.php @@ -23,7 +23,6 @@ use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector; use Rector\CodingStyle\Rector\FuncCall\VersionCompareFuncCallToConstantRector; use Rector\Config\RectorConfig; -use Rector\DeadCode\Rector\ClassMethod\RemoveDuplicatedReturnSelfDocblockRector; use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedConstructorParamRector; use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodRector; use Rector\DeadCode\Rector\MethodCall\RemoveNullArgOnNullDefaultParamRector; @@ -178,7 +177,6 @@ // to be applied in separate PRs to ease review NegatedAndsToPositiveOrsRector::class, - RemoveDuplicatedReturnSelfDocblockRector::class, ]) // auto import fully qualified class names ->withImportNames() diff --git a/system/DataCaster/DataCaster.php b/system/DataCaster/DataCaster.php index e19e42bb7f0c..9d9d3c77e268 100644 --- a/system/DataCaster/DataCaster.php +++ b/system/DataCaster/DataCaster.php @@ -105,8 +105,6 @@ public function __construct( * * @param array $types [field => type] * - * @return $this - * * @internal */ public function setTypes(array $types): static diff --git a/system/Database/BaseBuilder.php b/system/Database/BaseBuilder.php index f1a9428c13eb..3989b9a2d011 100644 --- a/system/Database/BaseBuilder.php +++ b/system/Database/BaseBuilder.php @@ -577,8 +577,6 @@ public function distinct(bool $val = true) * Generates the FROM portion of the query * * @param array|string $from - * - * @return $this */ public function from($from, bool $overwrite = false): self { @@ -608,8 +606,6 @@ public function from($from, bool $overwrite = false): self /** * @param BaseBuilder $from Expected subquery * @param string $alias Subquery alias - * - * @return $this */ public function fromSubquery(BaseBuilder $from, string $alias): self { diff --git a/system/HTTP/MessageTrait.php b/system/HTTP/MessageTrait.php index aed6987f34d7..044594bcfcdd 100644 --- a/system/HTTP/MessageTrait.php +++ b/system/HTTP/MessageTrait.php @@ -48,13 +48,10 @@ trait MessageTrait // -------------------------------------------------------------------- // Body // -------------------------------------------------------------------- - /** * Sets the body of the current message. * * @param string $data - * - * @return $this */ public function setBody($data): self { @@ -67,8 +64,6 @@ public function setBody($data): self * Appends data to the body of the current message. * * @param string $data - * - * @return $this */ public function appendBody($data): self { @@ -144,8 +139,6 @@ public function header($name) * Sets a header and it's value. * * @param array|string|null $value - * - * @return $this */ public function setHeader(string $name, $value): self { @@ -191,8 +184,6 @@ private function checkMultipleHeaders(string $name): void /** * Removes a header from the list of headers we track. - * - * @return $this */ public function removeHeader(string $name): self { @@ -205,8 +196,6 @@ public function removeHeader(string $name): self /** * Adds an additional header value to any headers that accept * multiple values (i.e. are an array or implement ArrayAccess) - * - * @return $this */ public function appendHeader(string $name, ?string $value): self { @@ -225,8 +214,6 @@ public function appendHeader(string $name, ?string $value): self * Adds a header (not a header value) with the same name. * Use this only when you set multiple headers with the same name, * typically, for `Set-Cookie`. - * - * @return $this */ public function addHeader(string $name, string $value): static { @@ -251,8 +238,6 @@ public function addHeader(string $name, string $value): static /** * Adds an additional header value to any headers that accept * multiple values (i.e. are an array or implement ArrayAccess) - * - * @return $this */ public function prependHeader(string $name, string $value): self { @@ -277,8 +262,6 @@ protected function getHeaderName(string $name): string /** * Sets the HTTP protocol version. * - * @return $this - * * @throws HTTPException For invalid protocols */ public function setProtocolVersion(string $version): self diff --git a/system/HTTP/RedirectResponse.php b/system/HTTP/RedirectResponse.php index 50c6b649373e..d8c8f00e868d 100644 --- a/system/HTTP/RedirectResponse.php +++ b/system/HTTP/RedirectResponse.php @@ -108,8 +108,6 @@ public function withInput() * If the validation has any errors, transmit those back * so they can be displayed when the validation is handled * within a method different than displaying the form. - * - * @return $this */ private function withErrors(): self { diff --git a/system/Images/Handlers/ImageMagickHandler.php b/system/Images/Handlers/ImageMagickHandler.php index 1472936d071b..c2b24c81f272 100644 --- a/system/Images/Handlers/ImageMagickHandler.php +++ b/system/Images/Handlers/ImageMagickHandler.php @@ -537,8 +537,6 @@ public function reorient(bool $silent = false) /** * Clears metadata from the image. * - * @return $this - * * @throws ImagickException */ public function clearMetadata(): static diff --git a/system/Images/ImageHandlerInterface.php b/system/Images/ImageHandlerInterface.php index a96977214ec8..1bb1e2b20ee0 100644 --- a/system/Images/ImageHandlerInterface.php +++ b/system/Images/ImageHandlerInterface.php @@ -152,8 +152,6 @@ public function save(?string $target = null, int $quality = 90); /** * Clear metadata before saving image as a new file. - * - * @return $this */ public function clearMetadata(): static; } diff --git a/system/Traits/ConditionalTrait.php b/system/Traits/ConditionalTrait.php index b24fbdcd1b0c..37703189615d 100644 --- a/system/Traits/ConditionalTrait.php +++ b/system/Traits/ConditionalTrait.php @@ -23,8 +23,6 @@ trait ConditionalTrait * @param TWhen $condition * @param callable(self, TWhen): mixed $callback * @param (callable(self): mixed)|null $defaultCallback - * - * @return $this */ public function when($condition, callable $callback, ?callable $defaultCallback = null): self { @@ -45,8 +43,6 @@ public function when($condition, callable $callback, ?callable $defaultCallback * @param TWhenNot $condition * @param callable(self, TWhenNot): mixed $callback * @param (callable(self): mixed)|null $defaultCallback - * - * @return $this */ public function whenNot($condition, callable $callback, ?callable $defaultCallback = null): self { diff --git a/system/Traits/PropertiesTrait.php b/system/Traits/PropertiesTrait.php index 30b3f86690c0..bf0571b2f05b 100644 --- a/system/Traits/PropertiesTrait.php +++ b/system/Traits/PropertiesTrait.php @@ -27,8 +27,6 @@ trait PropertiesTrait { /** * Attempts to set the values of public class properties. - * - * @return $this */ final public function fill(array $params): self { @@ -43,10 +41,15 @@ final public function fill(array $params): self /** * Get the public properties of the class and return as an array. + * + * @return array */ final public function getPublicProperties(): array { $worker = new class () { + /** + * @return array + */ public function getProperties(object $obj): array { return get_object_vars($obj); diff --git a/utils/phpstan-baseline/empty.notAllowed.neon b/utils/phpstan-baseline/empty.notAllowed.neon index 1d8d1796b5c2..3172047e0c1e 100644 --- a/utils/phpstan-baseline/empty.notAllowed.neon +++ b/utils/phpstan-baseline/empty.notAllowed.neon @@ -1,4 +1,4 @@ -# total 213 errors +# total 212 errors parameters: ignoreErrors: diff --git a/utils/phpstan-baseline/loader.neon b/utils/phpstan-baseline/loader.neon index bf2719972413..2e67047327fc 100644 --- a/utils/phpstan-baseline/loader.neon +++ b/utils/phpstan-baseline/loader.neon @@ -1,4 +1,4 @@ -# total 1827 errors +# total 1825 errors includes: - argument.type.neon diff --git a/utils/phpstan-baseline/missingType.iterableValue.neon b/utils/phpstan-baseline/missingType.iterableValue.neon index 1627bbb4a52a..677e7101b2c3 100644 --- a/utils/phpstan-baseline/missingType.iterableValue.neon +++ b/utils/phpstan-baseline/missingType.iterableValue.neon @@ -1,4 +1,4 @@ -# total 1141 errors +# total 1140 errors parameters: ignoreErrors: @@ -4132,11 +4132,6 @@ parameters: count: 1 path: ../../system/View/Cells/Cell.php - - - message: '#^Method CodeIgniter\\View\\Cells\\Cell\:\:getPublicProperties\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/View/Cells/Cell.php - - message: '#^Method CodeIgniter\\View\\Cells\\Cell\:\:includeComputedProperties\(\) has parameter \$properties with no value type specified in iterable type array\.$#' count: 1 diff --git a/utils/phpstan-baseline/return.type.neon b/utils/phpstan-baseline/return.type.neon index cd3da83ccce5..258159a982c6 100644 --- a/utils/phpstan-baseline/return.type.neon +++ b/utils/phpstan-baseline/return.type.neon @@ -3,7 +3,7 @@ parameters: ignoreErrors: - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:cleanClone\(\) should return \$this\(CodeIgniter\\Database\\BaseBuilder\) but returns static\(CodeIgniter\\Database\\BaseBuilder\)\.$#' + message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:cleanClone\(\) should return \$this\(CodeIgniter\\Database\\BaseBuilder\) but returns CodeIgniter\\Database\\BaseBuilder\.$#' count: 1 path: ../../system/Database/BaseBuilder.php