Version: 3.4.0
Bug Description
IResponse::setCookie() declares only 7 parameters, but the concrete Response::setCookie() adds SameSite|string|null $sameSite = null as the 8th. At the same time, 3.4.0 deprecated IResponse::SameSiteLax/SameSiteStrict/SameSiteNone constants with the note "use Nette\Http\SameSite enum".
Following this migration advice while calling setCookie() through IResponse (which is what Presenter::getHttpResponse() returns) triggers a PHPStan error:
Method Nette\Http\IResponse::setCookie() invoked with 8 parameters, 3–7 required.
The only workaround is a @phpstan-ignore arguments.count suppression, which is unsatisfying given that 3.4.0 actively guides users toward the enum.
Steps To Reproduce
// $this->getHttpResponse() returns IResponse
$this->getHttpResponse()->setCookie('name', 'value', '+1 year', '/', null, true, true, SameSite::Strict);
// PHPStan level 6: Method Nette\Http\IResponse::setCookie() invoked with 8 parameters, 3-7 required.
Expected Behavior
Using Nette\Http\SameSite enum in setCookie() via the IResponse interface works without PHPStan suppression, consistent with the deprecation notice in 3.4.0.
Possible Solution
Add SameSite|string|null $sameSite = null (and optionally bool $partitioned = false) to IResponse::setCookie() to match the concrete Response class signature.
Version: 3.4.0
Bug Description
IResponse::setCookie()declares only 7 parameters, but the concreteResponse::setCookie()addsSameSite|string|null $sameSite = nullas the 8th. At the same time, 3.4.0 deprecatedIResponse::SameSiteLax/SameSiteStrict/SameSiteNoneconstants with the note "use Nette\Http\SameSite enum".Following this migration advice while calling
setCookie()throughIResponse(which is whatPresenter::getHttpResponse()returns) triggers a PHPStan error:The only workaround is a
@phpstan-ignore arguments.countsuppression, which is unsatisfying given that 3.4.0 actively guides users toward the enum.Steps To Reproduce
Expected Behavior
Using Nette\Http\SameSite enum in setCookie() via the IResponse interface works without PHPStan suppression, consistent with the deprecation notice in 3.4.0.
Possible Solution
Add SameSite|string|null $sameSite = null (and optionally bool $partitioned = false) to IResponse::setCookie() to match the concrete Response class signature.