title: Symfony 4 Custom config yaml file for Bundle
body: <p>I'm trying to convert a bundle to symfony 4 and need to update my ancient parameters.yml to the modern symfony 4 way of life. Basicall the bundle itself - shared across multiple apps - should have a configurable file under /config/packages/.</p>
  
  <p>However I receive this error:  </p>
  
  <pre><code>(1/1) InvalidArgumentException
  
  There is no extension able to load the configuration for "ptmr" (in /var/www/html/ptmr/pws_ptmrio_dev/PtmrBundle/DependencyInjection/../../config/packages/ptmr.yaml). Looked for namespace "ptmr", found none
  </code></pre>
  
  <p>/PtmrBundle/DependencyInjection/<strong>PtmrExtension.php</strong></p>
  
  <pre><code>&lt;?php
  namespace PtmrBundle\DependencyInjection;
  
  use Symfony\Component\Config\FileLocator;
  use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
  use Symfony\Component\HttpKernel\DependencyInjection\Extension;
  use Symfony\Component\DependencyInjection\ContainerBuilder;
  
  class PtmrExtension extends Extension
  {
  
      public function load(array $configs, ContainerBuilder $container)
      {
  
          $configuration = new Configuration(true);
          $config = $this-&gt;processConfiguration($configuration, $configs);
  
          $loader = new YamlFileLoader(
              $container,
              new FileLocator(__DIR__ . '/../../config/packages')
          );
  
          $loader-&gt;load('ptmr.yaml');
  
      }
  
  
  }
  </code></pre>
  
  <p>/PtmrBundle/DependencyInjection/<strong>Configuration.php</strong></p>
  
  <pre><code>&lt;?php
  namespace PtmrBundle\DependencyInjection;
  
  use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  use Symfony\Component\Config\Definition\ConfigurationInterface;
  
  class Configuration implements ConfigurationInterface
  {
  
      private $debug;
  
      public function  __construct($debug = true)
      {
          $this-&gt;debug = (bool) $debug;
      }
  
      public function getConfigTreeBuilder()
      {
          $treeBuilder = new TreeBuilder('ptmr');
  
          $treeBuilder-&gt;getRootNode()
              -&gt;children()
              -&gt;arrayNode('twitter')
              -&gt;children()
              -&gt;integerNode('client_id')-&gt;end()
              -&gt;scalarNode('client_secret')-&gt;end()
              -&gt;end()
              -&gt;end() // twitter
              -&gt;end()
          ;
  
          return $treeBuilder;
      }
  }
  </code></pre>
  
  <p>/config/packages/<strong>ptmr.yaml</strong></p>
  
  <pre><code>ptmr:
    twitter:
      client_id: 123
      client_secret: your_secret
  </code></pre>
  
  <p>--
  Note:
  The Bundle itself works.</p>
  
  <p>I added this line to psr-4 in <strong>composer.json</strong>:</p>
  
  <pre><code>    "PtmrBundle\\": "PtmrBundle/"
  </code></pre>
  
  <p>This lines to config/routes/<strong>annotations.yml</strong></p>
  
  <pre><code>ptmr_bundle:
      resource: ../PtmrBundle/Controller/
      type: annotation
  </code></pre>
  
  <p>These lines to config/<strong>services.yaml</strong></p>
  
  <pre><code>services:
      ...
  
      PtmrBundle\:
          resource: '../PtmrBundle/*'
          exclude: '../PtmrBundle/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'
  
      ...
  
      PtmrBundle\Controller\:
          resource: '../PtmrBundle/Controller'
          tags: ['controller.service_arguments']
  </code></pre>
  
  <p>And of course PtmrBundle/PtmrBundle.php</p>
  
  <pre><code>&lt;?php
  
  namespace PtmrBundle;
  
  use Symfony\Component\HttpKernel\Bundle\Bundle;
  
  class PtmrBundle extends Bundle
  {
  
  }
  </code></pre>
  
  <p>I'm following these instructions and I reaaaly do not see any errors. What am I missing? Symfony 4.2.</p>