The documentation you linked to is correct, you need to change 'public static' to 'private static'. After you've done this, you'll need to visit http://mysite.com/dev/build?flush=1 - I suspect that this is why it wasn't working for you.
If that doesn't solve the issue, make sure that both the CMS and Framework have been updated to 3.1.2 (and any modules are compatible with 3.1).
I probably made a typo somewhere
I removed all the files except Page.php in my "Code" en replaced the code of Page.php with the original Code.
Did a Dev build en it worked. When i put my other files back in the "Code" folder, those worked as well.