title: Symfony 4 - Class Symfony\Component\Form\AbstractType not found
body: <p>Trying to do file upload by documentation:</p>
  
  <p><a href="https://symfony.com/doc/current/controller/upload_file.html" rel="nofollow noreferrer">https://symfony.com/doc/current/controller/upload_file.html</a></p>
  
  <p>I have pasted the code:</p>
  
  <pre><code>// src/Form/ProductType.php
  namespace App\Form;
  
  use App\Entity\Product;
  use Symfony\Component\Form\AbstractType;
  use Symfony\Component\Form\FormBuilderInterface;
  use Symfony\Component\OptionsResolver\OptionsResolver;
  use Symfony\Component\Form\Extension\Core\Type\FileType;
  
  class ProductType extends AbstractType
  {
      public function buildForm(FormBuilderInterface $builder, array $options)
      {
          $builder
              // ...
              -&gt;add('brochure', FileType::class, array('label' =&gt; 'Brochure (PDF file)'))
              // ...
          ;
      }
  
      public function configureOptions(OptionsResolver $resolver)
      {
          $resolver-&gt;setDefaults(array(
              'data_class' =&gt; Product::class,
          ));
      }
  }
  </code></pre>
  
  <p>And getting error</p>
  
  <blockquote>
    <p>Class Symfony\Component\Form\AbstractType not found in
    E:\projektai\php
    projektai\htdocs\mokomieji\symfony_4_demo\config/services.yaml (which
    is loaded in resource "E:\projektai\php
    projektai\htdocs\mokomieji\symfony_4_demo\config/services.yaml").</p>
  </blockquote>
  
  <p>I see PhpStorm giving warning already that AbstractType is not found. What is wrong here, how to fix?</p>
  
  <p>composer.json:</p>
  
  <pre><code>{
      "type": "project",
      "license": "proprietary",
      "require": {
          "php": "^7.1.3",
          "ext-iconv": "*",
          "symfony/console": "^4.0",
          "symfony/flex": "^1.0",
          "symfony/framework-bundle": "^4.0",
          "symfony/lts": "^4@dev",
          "symfony/maker-bundle": "^1.0",
          "symfony/orm-pack": "^1.0",
          "symfony/twig-bundle": "^4.0",
          "symfony/validator": "^4.0",
          "symfony/yaml": "^4.0"
      },
      "require-dev": {
          "symfony/dotenv": "^4.0"
      },
      "config": {
          "preferred-install": {
              "*": "dist"
          },
          "sort-packages": true
      },
      "autoload": {
          "psr-4": {
              "App\\": "src/"
          }
      },
      "autoload-dev": {
          "psr-4": {
              "App\\Tests\\": "tests/"
          }
      },
      "replace": {
          "symfony/polyfill-apcu": "*",
          "symfony/polyfill-php70": "*",
          "symfony/polyfill-php56": "*"
      },
      "scripts": {
          "auto-scripts": {
              "cache:clear": "symfony-cmd",
              "assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
          },
          "post-install-cmd": [
              "@auto-scripts"
          ],
          "post-update-cmd": [
              "@auto-scripts"
          ]
      },
      "conflict": {
          "symfony/symfony": "*"
      },
      "extra": {
          "symfony": {
              "id": "01C1AMZG7RRHZQ87EJYRTRWDDA",
              "allow-contrib": false
          }
      }
  }
  </code></pre>