If your date is already a DateTime
or DateTimeImmutable
you can use the format
method.
$day_of_week = intval($date_time->format('w'));
The format string is identical to the one used by the date function.
To answer the intended question:
$date_time->modify($target_day_of_week - $day_of_week . ' days');