original_string: public static function check(Identifiable $element)
      {
          $elementId = $element->getId();
  
          if (!$elementId) {
              $element->setId(new static());
              return $element->getId();
          }
  
          $dangerousCharacters = array(' ', '|', PHP_EOL);
          $danger              = false;
          foreach ($dangerousCharacters as $dangerousCharacter) {
              if (stripos($elementId, $dangerousCharacter) !== false) {
                  $danger = true;
                  break;
              }
          }
  
          if ($danger) {
              trigger_error("Don't use special characters in IDs, they might cause problems! Stripping them for you...");
              $elementId = str_ireplace($dangerousCharacters, '', $elementId);
              $element->setId($elementId);
          }
  
          return $element->getId();
      }
code: public static function check(Identifiable $element)
      {
          $elementId = $element->getId();
  
          if (!$elementId) {
              $element->setId(new static());
              return $element->getId();
          }
  
          $dangerousCharacters = array(' ', '|', PHP_EOL);
          $danger              = false;
          foreach ($dangerousCharacters as $dangerousCharacter) {
              if (stripos($elementId, $dangerousCharacter) !== false) {
                  $danger = true;
                  break;
              }
          }
  
          if ($danger) {
              trigger_error("Don't use special characters in IDs, they might cause problems! Stripping them for you...");
              $elementId = str_ireplace($dangerousCharacters, '', $elementId);
              $element->setId($elementId);
          }
  
          return $element->getId();
      }
code_tokens: public static function check ( Identifiable $ element ) { $ elementId = $ element -> getId ( ) ; if ( ! $ elementId ) { $ element -> setId ( new static ( ) ) ; return $ element -> getId ( ) ; } $ dangerousCharacters = array ( ' ' , '|' , PHP_EOL ) ; $ danger = false ; foreach ( $ dangerousCharacters as $ dangerousCharacter ) { if ( stripos ( $ elementId , $ dangerousCharacter ) !== false ) { $ danger = true ; break ; } } if ( $ danger ) { trigger_error ( "Don't use special characters in IDs, they might cause problems! Stripping them for you..." ) ; $ elementId = str_ireplace ( $ dangerousCharacters , '' , $ elementId ) ; $ element -> setId ( $ elementId ) ; } return $ element -> getId ( ) ; }
docstring: Check and return the Id of an Identifable Element
  
  @param Identifiable $element Identifable element
  @return string
docstring_tokens: Check and return the Id of an Identifable Element