You should put the code blocks in a configuration block:

````rst
.. configuration-block::

    .. code-block:: yml

        # ...

     .. code-block:: xml

        <!-- ... -->

    .. code-block:: php

        // ...
````