Use the shortcut:

````rst
The ``Post`` document would then need to implement the methods named above as follows::

    <?php

    class Post
    // ...
````

The double colon gets replaced with a single one and the next block is seen as PHP code.