Why not just:
```php
$setAllValues = $form || !$form->isAnchored() || !$form->isSubmitted();
```