original_string: private function addService($path, $bundleName, $name, $formTypeName)
      {
          $ref = '<services>';
          $replaceBefore = true;
          $group = $bundleName . '_' . $name;
  
          $declaration = <<<EOF
          <service id="$bundleName.form.type.$name" class="%$bundleName.form.type.$name.class%">
              <argument>%$bundleName.model.$name.class%</argument>
              <argument type="collection">
                  <argument>$group</argument>
              </argument>
              <tag name="form.type" alias="$formTypeName" />
          </service>
  EOF;
  
          if ($this->refExist($path, $declaration)) {
              return;
          }
  
          if (!$this->refExist($path, $ref)) {
              $ref = '</container>';
              $replaceBefore = false;
              $declaration = <<<EOF
      <services>
  $declaration
      </services>
  EOF;
          }
  
          $this->dumpFile($path, "\n" . $declaration . "\n", $ref, $replaceBefore);
      }
code: private function addService($path, $bundleName, $name, $formTypeName)
      {
          $ref = '<services>';
          $replaceBefore = true;
          $group = $bundleName . '_' . $name;
  
          $declaration = <<<EOF
          <service id="$bundleName.form.type.$name" class="%$bundleName.form.type.$name.class%">
              <argument>%$bundleName.model.$name.class%</argument>
              <argument type="collection">
                  <argument>$group</argument>
              </argument>
              <tag name="form.type" alias="$formTypeName" />
          </service>
  EOF;
  
          if ($this->refExist($path, $declaration)) {
              return;
          }
  
          if (!$this->refExist($path, $ref)) {
              $ref = '</container>';
              $replaceBefore = false;
              $declaration = <<<EOF
      <services>
  $declaration
      </services>
  EOF;
          }
  
          $this->dumpFile($path, "\n" . $declaration . "\n", $ref, $replaceBefore);
      }
code_tokens: private function addService ( $ path , $ bundleName , $ name , $ formTypeName ) { $ ref = '<services>' ; $ replaceBefore = true ; $ group = $ bundleName . '_' . $ name ; $ declaration =  <<<EOF
          <service id="$bundleName.form.type.$name" class="%$bundleName.form.type.$name.class%">
              <argument>%$bundleName.model.$name.class%</argument>
              <argument type="collection">
                  <argument>$group</argument>
              </argument>
              <tag name="form.type" alias="$formTypeName" />
          </service>
  EOF ; if ( $ this -> refExist ( $ path , $ declaration ) ) { return ; } if ( ! $ this -> refExist ( $ path , $ ref ) ) { $ ref = '</container>' ; $ replaceBefore = false ; $ declaration =  <<<EOF
      <services>
  $declaration
      </services>
  EOF ; } $ this -> dumpFile ( $ path , "\n" . $ declaration . "\n" , $ ref , $ replaceBefore ) ; }
docstring: Add service node
  
  @param string $path
  @param string $bundleName
  @param string $name
  @param string $formTypeName
docstring_tokens: Add service node