original_string: private function analyzeConfiguration($configuration, $textOnly) {
          $validity = $configuration->isValid() ? "valid" : "invalid";
  
          $str = "";
          $selectedColor = "\033[1;32m";
          $deselectedColor = "\033[1;31m";
          
          if ($textOnly)
              $str .= "The given configuration has the following feature selection:\n\n";
          else {
              $str .= "<div style='font-family: monospace'>";
              $str .= "<p>The given configuration has the following feature selection:</p>";
              $str .= "<ul>";
          }
  
          foreach ($configuration->getModel()->getFeatures() as $feature) {
              $isSelected = Feature::has($configuration->getSelectedFeatures(), $feature);
              $mark = $isSelected ? "x" : "&nbsp;";
              $class = $isSelected ? "selected" : "deselected";
  
              if ($textOnly)
                  $str .= "[" . ($isSelected ? "x" : " ") . "] " .
                       ($isSelected ? $selectedColor : $deselectedColor) . $feature->getName() . "$this->defaultColor\n";
              else
                  $str .= "<li>[$mark] <span class='feature $class'>" . $feature->getName() . "</span></li>";
          }
  
          if ($textOnly)
              $str .= "\nThis configuration is $validity.\n";
          else {
              $str .= "</ul>";
              $str .= "<p>This configuration is $validity.</p>";
              $str .= "</div>";
          }
          return $str;
      }
code: private function analyzeConfiguration($configuration, $textOnly) {
          $validity = $configuration->isValid() ? "valid" : "invalid";
  
          $str = "";
          $selectedColor = "\033[1;32m";
          $deselectedColor = "\033[1;31m";
          
          if ($textOnly)
              $str .= "The given configuration has the following feature selection:\n\n";
          else {
              $str .= "<div style='font-family: monospace'>";
              $str .= "<p>The given configuration has the following feature selection:</p>";
              $str .= "<ul>";
          }
  
          foreach ($configuration->getModel()->getFeatures() as $feature) {
              $isSelected = Feature::has($configuration->getSelectedFeatures(), $feature);
              $mark = $isSelected ? "x" : "&nbsp;";
              $class = $isSelected ? "selected" : "deselected";
  
              if ($textOnly)
                  $str .= "[" . ($isSelected ? "x" : " ") . "] " .
                       ($isSelected ? $selectedColor : $deselectedColor) . $feature->getName() . "$this->defaultColor\n";
              else
                  $str .= "<li>[$mark] <span class='feature $class'>" . $feature->getName() . "</span></li>";
          }
  
          if ($textOnly)
              $str .= "\nThis configuration is $validity.\n";
          else {
              $str .= "</ul>";
              $str .= "<p>This configuration is $validity.</p>";
              $str .= "</div>";
          }
          return $str;
      }
code_tokens: private function analyzeConfiguration ( $ configuration , $ textOnly ) { $ validity = $ configuration -> isValid ( ) ? "valid" : "invalid" ; $ str = "" ; $ selectedColor = "\033[1;32m" ; $ deselectedColor = "\033[1;31m" ; if ( $ textOnly ) $ str .= "The given configuration has the following feature selection:\n\n" ; else { $ str .= "<div style='font-family: monospace'>" ; $ str .= "<p>The given configuration has the following feature selection:</p>" ; $ str .= "<ul>" ; } foreach ( $ configuration -> getModel ( ) -> getFeatures ( ) as $ feature ) { $ isSelected = Feature :: has ( $ configuration -> getSelectedFeatures ( ) , $ feature ) ; $ mark = $ isSelected ? "x" : "&nbsp;" ; $ class = $ isSelected ? "selected" : "deselected" ; if ( $ textOnly ) $ str .= "[" . ( $ isSelected ? "x" : " " ) . "] " . ( $ isSelected ? $ selectedColor : $ deselectedColor ) . $ feature -> getName ( ) . "$this->defaultColor\n" ; else $ str .= "<li>[$mark] <span class='feature $class'>" . $ feature -> getName ( ) . "</span></li>" ; } if ( $ textOnly ) $ str .= "\nThis configuration is $validity.\n" ; else { $ str .= "</ul>" ; $ str .= "<p>This configuration is $validity.</p>" ; $ str .= "</div>" ; } return $ str ; }
docstring: Returns a configuration analysis.
  @param Configuration $configuration
  @param bool $textOnly whether to render text or HTML
  @return string
docstring_tokens: Returns a configuration analysis .