Replaced depreciated hookAddTwigExtension() with addTwigExtension()