Not deprecated way to get Title object of the current page
Fragment of a discussion from Project:Support desk
Oh, that's clear now, thanks! I'll figure out the details and added the description to the Manual:$wgArticle and Manual:$wgTitle pages.