Thread:Project:Support desk/Not deprecated way to get Title object of the current page

Hello everyone! What is the right way to get the Title object of the current page when I write an extesnion? I have used $wgTitle and $wgArticle for that but now they both are going to be deprecated. There is no information of alternatives neither on Manual:$wgArticle nor on Manual:$wgTitle.

The way I found seem like wrong and horrible workaround: