title: Symfony3.4: Attempted to call an undefined method named "getParameter" of class "Symfony\Component\DependencyInjection\ServiceLocator"
body: <p>In Symfony3.4, the following error occurred while supporting automatic wiring.<br />
  The following error occurs even if the container is removed, just changing the class.<br />
  I changed the controller to an abstract controller due to another error, so I want to use the abstract controller as much as possible.<br />
  Is there anything I have forgotten?</p>
  <p><a href="https://symfony.com/doc/3.4/service_container/3.3-di-changes.html" rel="nofollow noreferrer">https://symfony.com/doc/3.4/service_container/3.3-di-changes.html</a></p>
  <p>Error</p>
  <pre><code>Attempted to call an undefined method named &quot;getParameter&quot; of class &quot;Symfony\Component\DependencyInjection\ServiceLocator&quot;.
  </code></pre>
  <p>Controller.php</p>
  <pre class="lang-php prettyprint-override"><code>use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  
  class DefaultController extends AbstractController
  {
      /**
       * @param KeepRequestService $keepRequestService
       * @return array
       */
      private function getKeepRequestSummary(KeepRequestService $keepRequestService): array
      {
          $summary = array();
          
          //Error line        
          foreach (array_keys($this-&gt;container-&gt;getParameter('keep_request_status')) as $status) {
  
              $params = array('status' =&gt; $status);
              $summary[$status] = $keepRequestService-&gt;countKeepRequestBySearchParams($params);
          }
          return $summary;
      }
  </code></pre>
  <p>services.yml</p>
  <pre class="lang-yaml prettyprint-override"><code>    _defaults:
          autowire: true
          autoconfigure: true
          public: false
  
      App\:
          resource: '../../src/*'
          exclude: '../../src/{Ahi/Sp/AdminBundle/Model/Entity, Ahi/Sp/AdminBundle/Model/Repository, Ahi/Sp/AdminBundle/Resources/public/uploadify, Ahi/Sp/AdminBundle/Ahi/Sp/PublicBundle/ }'
  
      App\Ahi\Sp\AdminBundle\Controller\:
          resource: '../../src/Ahi/Sp/AdminBundle/Controller'
          public: true
          tags: ['controller.service_arguments']
  </code></pre>