original_string: public function hydrate($puppetModules, $group)
      {
          $availableClasses = [];
          if (!empty($puppetModules)) {
              foreach ($puppetModules as $puppetModule) {
                  if ($puppetModule->hasClasses()) {
                      foreach ($puppetModule->getClasses() as $puppetClass) {
                          $groupClass = $group->getClassByName($puppetClass->getName());
                          if ($groupClass != null) {
                              if ($puppetClass->hasParametersTemplates()) {
                                  $this->groupClassHydrator->hydrate($puppetClass->getParametersTemplates(), $groupClass);
                              }
                          } else {
                              $availableClasses[$puppetModule->getName()][] = $puppetClass->getName();
                          }
                      }
                  }
              }
          }
          return $group->setAvailableClasses($availableClasses);
      }
code: public function hydrate($puppetModules, $group)
      {
          $availableClasses = [];
          if (!empty($puppetModules)) {
              foreach ($puppetModules as $puppetModule) {
                  if ($puppetModule->hasClasses()) {
                      foreach ($puppetModule->getClasses() as $puppetClass) {
                          $groupClass = $group->getClassByName($puppetClass->getName());
                          if ($groupClass != null) {
                              if ($puppetClass->hasParametersTemplates()) {
                                  $this->groupClassHydrator->hydrate($puppetClass->getParametersTemplates(), $groupClass);
                              }
                          } else {
                              $availableClasses[$puppetModule->getName()][] = $puppetClass->getName();
                          }
                      }
                  }
              }
          }
          return $group->setAvailableClasses($availableClasses);
      }
code_tokens: public function hydrate ( $ puppetModules , $ group ) { $ availableClasses = [ ] ; if ( ! empty ( $ puppetModules ) ) { foreach ( $ puppetModules as $ puppetModule ) { if ( $ puppetModule -> hasClasses ( ) ) { foreach ( $ puppetModule -> getClasses ( ) as $ puppetClass ) { $ groupClass = $ group -> getClassByName ( $ puppetClass -> getName ( ) ) ; if ( $ groupClass != null ) { if ( $ puppetClass -> hasParametersTemplates ( ) ) { $ this -> groupClassHydrator -> hydrate ( $ puppetClass -> getParametersTemplates ( ) , $ groupClass ) ; } } else { $ availableClasses [ $ puppetModule -> getName ( ) ] [ ] = $ puppetClass -> getName ( ) ; } } } } } return $ group -> setAvailableClasses ( $ availableClasses ) ; }
docstring: Hydrate group with the provided puppet modules data.
  
  @param  PuppetModule[] $puppetModules
  @param  GroupInterface $group
  @return GroupInterface
docstring_tokens: Hydrate group with the provided puppet modules data .