Fixed #11675 ValueToDuplicatesTransformer accept "0" value

Fixed wrong return null syntax

Added transformation to null on empty arrays

Removed useless statement in condition and switched to yoda condition
bug #11676 [Form] Fixed #11675 ValueToDuplicatesTransformer accept "0" value (Nek-)

This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #11676).

Discussion
----------

[Form] Fixed #11675 ValueToDuplicatesTransformer accept "0" value

| Q             | A
| ------------- | ---
| Bug fix?      | [yes]
| New feature?  | [no]
| BC breaks?    | [no]
| Deprecations? | [no]
| Tests pass?   | [yes]
| Fixed tickets | #11675
| License       | MIT

Commits
-------

31d48ab Fixed #11675 ValueToDuplicatesTransformer accept "0" value