Skip to content

DateTime::createFromFormat(): Passing null to parameter #2 ($datetime) of type string is deprecated #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
igorbelikov opened this issue Jul 1, 2022 · 0 comments

Comments

@igorbelikov
Copy link

igorbelikov commented Jul 1, 2022

php 8.1.6 yii:2.0.45

Deprecated warning

DateTime::createFromFormat(): Passing null to parameter #2 ($datetime) of type string is deprecated
namespace zhuravljov\yii\queue\monitor\filters\JobFilter;

/**
 * @param string $value
 * @param bool $isEnd
 * @return int|null
 */
private function parseDatetime($value, $isEnd = false)
{
    $dt = DateTime::createFromFormat('Y-m-d\TH:i', $value);
    ...
}
...
$query->andFilterWhere(['>=', 'push.pushed_at', $this->parseDatetime($this->pushed_after)]);
$query->andFilterWhere(['<=', 'push.pushed_at', $this->parseDatetime($this->pushed_before, true)]);
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant