[OptionsResolver] fix counting of options

and make sure the tests are compatible with phpunit strict mode
[OptionsResolver] fix invalid value exception formatting
[OptionsResolver] fix calling resolve from within closure
[OptionsResolver] add missing exception based on OutOfBoundsException and clarify message
bug #12294 [OptionsResolver] fix count() and exceptions (Tobion)

This PR was merged into the 2.6-dev branch.

Discussion
----------

[OptionsResolver] fix count() and exceptions

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Please see commits.

Commits
-------

b93c4c0 [OptionsResolver] add missing exception based on OutOfBoundsException and clarify message
8bcbcc3 [OptionsResolver] fix calling resolve from within closure
dc1250c [OptionsResolver] fix invalid value exception formatting
6c2130f [OptionsResolver] fix counting of options