PHPUnit 10 requires data providers to be static methods, which breaks any provider that touched $this.
// 9.x, and common
public function validInputs(): array
{
return [[$this->makeOrder()], [$this->makeRefund()]];
}
// 10.x
public static function validInputs(): array
{
return [['order'], ['refund']]; // data, not objects
}
// the object is built inside the test, from the key
The restriction exists because providers run before the test case is set up, and the previous behaviour worked by accident in a way that made ordering unpredictable. Eleven of ours built objects; passing a key and constructing inside the test is the mechanical fix and is better anyway — a provider returning fully built objects hides how much setup each case needs.