Skip to content

Commit

Permalink
[PHP 8.2] Fix ${var} string interpolation deprecation (#142)
Browse files Browse the repository at this point in the history
PHP 8.2 deprecates `"${var}"` string interpolation pattern.
This fixes all three of such occurrences in `dragonmantank/cron-expression` package.

 - [PHP 8.2: `${var}` string interpolation deprecated](https://php.watch/versions/8.2/${var}-string-interpolation-deprecated)
 - [RFC](https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation)
  • Loading branch information
Ayesh authored Sep 6, 2022
1 parent be85b3f commit 75916a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Cron/DayOfMonthField.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class DayOfMonthField extends AbstractField
private static function getNearestWeekday(int $currentYear, int $currentMonth, int $targetDay): ?DateTime
{
$tday = str_pad((string) $targetDay, 2, '0', STR_PAD_LEFT);
$target = DateTime::createFromFormat('Y-m-d', "${currentYear}-${currentMonth}-${tday}");
$target = DateTime::createFromFormat('Y-m-d', "{$currentYear}-{$currentMonth}-{$tday}");

if ($target === false) {
return null;
Expand Down

0 comments on commit 75916a4

Please sign in to comment.