Skip to content

Commit 82832fd

Browse files
committed
Merge pull request #2948 from unkind/improving-templating-type-hinting
Add type hinting for a directly injected service
2 parents e5beaad + 9158649 commit 82832fd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cookbook/controller/service.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,14 @@ service and use it directly::
180180
// src/Acme/HelloBundle/Controller/HelloController.php
181181
namespace Acme\HelloBundle\Controller;
182182

183+
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;
183184
use Symfony\Component\HttpFoundation\Response;
184185

185186
class HelloController
186187
{
187188
private $templating;
188189

189-
public function __construct($templating)
190+
public function __construct(EngineInterface $templating)
190191
{
191192
$this->templating = $templating;
192193
}

0 commit comments

Comments
 (0)