updated code based on https://github.com/symfony-cmf/BlockBundle/pull/125

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

does it really make sense to have the code here?

see https://github.com/symfony-cmf/BlockBundle/pull/125