[ 'code' => 'modify(getString()); $b = $dateTimeImmutable->modify(getString()); ', 'assertions' => [ '$a' => 'DateTime|false', '$b' => 'DateTimeImmutable|false', ], ], 'modifyWithValidConstant' => [ 'code' => 'modify(getString()); $b = $dateTimeImmutable->modify(getString()); ', 'assertions' => [ '$a' => 'DateTime', '$b' => 'DateTimeImmutable', ], ], 'modifyWithInvalidConstant' => [ 'code' => 'modify(getString()); $b = $dateTimeImmutable->modify(getString()); ', 'assertions' => [ '$a' => 'false', '$b' => 'false', ], ], 'modifyWithBothConstant' => [ 'code' => 'modify(getString()); $b = $dateTimeImmutable->modify(getString()); ', 'assertions' => [ '$a' => 'DateTime|false', '$b' => 'DateTimeImmutable|false', ], ], 'otherMethodAfterModify' => [ 'code' => 'modify("+1 day")->setTime(0, 0); $b = $dateTimeImmutable->modify("+1 day")->setTime(0, 0); ', 'assertions' => [ '$a' => 'DateTime', '$b' => 'DateTimeImmutable', ], ], 'modifyStaticReturn' => [ 'code' => 'modify("+7 days"); ', 'assertions' => [ '$mod' => 'Subclass', ], ], 'otherMethodAfterModifyStaticReturn' => [ 'code' => 'modify("+1 day")->setTime(0, 0); ', 'assertions' => [ '$mod' => 'Subclass', ], ], 'formatAfterModify' => [ 'code' => 'modify("+1 day")->format("Y-m-d"); $b = $dateTimeImmutable->modify("+1 day")->format("Y-m-d"); ', 'assertions' => [ '$a' => 'false|string', '$b' => 'string', ], ], 'formatAfterModifyStaticReturn' => [ 'code' => 'modify("+1 day")->format("Y-m-d"); ', 'assertions' => [ '$format' => 'string', ], ], ]; } }