Skip to content

Commit f39feec

Browse files
ohmyfelixf3l1x
authored andcommitted
Fix phpstan compatibility for untrusted form values
1 parent 359c74c commit f39feec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/UI/Home/HomePresenter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ protected function createComponentUserForm(): Form
5252

5353
$form->onValidate[] = function (Form $form): void {
5454
$values = $form->getUntrustedValues();
55-
$email = is_object($values) ? ($values->email ?? null) : ($values['email'] ?? null);
55+
$email = ((array) $values)['email'] ?? null;
5656

5757
// Validate e-mail duplicities (against DB?)
5858
if (is_string($email) && str_ends_with($email, '@nette.org')) {

0 commit comments

Comments
 (0)