PSR-7 immutability, and the request I mutated by accident

A with method whose return value was discarded, which is the one mistake PSR-7 makes easy.

// the bug
$request->withHeader('X-Request-Id', $id);
$this->client->sendRequest($request);   // no header

// the fix
$request = $request->withHeader('X-Request-Id', $id);

// and the thing that catches it
// phpstan: Return value of method
// RequestInterface::withHeader() is not used.

An immutable interface with fluent setters produces exactly this, and the discarded return value is invisible in review because the line looks like a mutation. PHPStan’s checkAlwaysTrueStrictComparison family does not cover it; the rule that does is a custom one asserting that any method starting with with has its result used, which is twenty lines and has fired twice.