title: Catchable Fatal Error - __construct() must be an instance of Symfony\Component\Security\Core\SecurityContext, none given
body: <p>I want to pass the current user into AbstractType. I followed the help from this page here: <a href="https://stackoverflow.com/questions/11709246/access-currently-logged-in-user-in-entityrepository">Access currently logged in user in EntityRepository</a></p>
  
  <p>Unfortunately - It is not working by me. I'm using Symfony 2.6.</p>
  
  <pre><code>Catchable Fatal Error: Argument 1 passed to Checkout\Bundle\ItemBundle\Form\ItemType::__construct() must be an instance of Symfony\Component\Security\Core\SecurityContext, none given, called in /vagrant/src/Checkout/Bundle/ItemBundle/Controller/ItemController.php on line 231 and defined
  </code></pre>
  
  <p>That is my Type:</p>
  
  <pre><code>&lt;?php
  
  namespace Checkout\Bundle\ItemBundle\Form;
  
  use Symfony\Component\Form\AbstractType;
  use Symfony\Component\Form\FormBuilderInterface;
  use Symfony\Component\OptionsResolver\OptionsResolverInterface;
  use Symfony\Component\Security\Core\SecurityContext;
  use Doctrine\ORM\EntityRepository;
  
  class ItemType extends AbstractType
  {
      protected $securityContext;
  
      public function __construct(SecurityContext $securityContext)
      {
          $this-&gt;securityContext = $securityContext;
      }
  
      /**
       * @param FormBuilderInterface $builder
       * @param array $options
       */
      public function buildForm(FormBuilderInterface $builder, array $options)
      {
          $currentUser = $this-&gt;securityContext-&gt;getToken()-&gt;getUser();
  
          $builder (...)
  </code></pre>
  
  <p>Service:</p>
  
  <pre><code>&lt;?xml version="1.0" ?&gt;
  
  &lt;container xmlns="http://symfony.com/schema/dic/services"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"&gt;
      &lt;services&gt;
          &lt;service id="form.type.item" class="Checkout\Bundle\ItemBundle\Form\ItemType"&gt;
              &lt;argument type="service" id="security.context" /&gt;
              &lt;tag name="form.type" alias="item" /&gt;
          &lt;/service&gt;
      &lt;/services&gt;
  &lt;/container&gt;
  </code></pre>
  
  <p>I tried to figure out, but I don't really understand the error message. Can someone help? :-)</p>