original_string: public static function checkBIC($bic, array $options = null)
      {
          $bic = preg_replace('/\s+/u', '' , $bic );   // remove whitespaces
  
          if(!empty($options['forceLongBic']) && strlen($bic) === 8)
              $bic .= empty($options['forceLongBicStr']) ? 'XXX' : $options['forceLongBicStr'];
  
          if(empty($bic) && !empty($options['allowEmptyBic']))
              return '';
  
          $bic = strtoupper($bic);                    // use only capital letters
  
          if(preg_match('/^' . self::PATTERN_BIC . '$/', $bic))
              return $bic;
          else
              return false;
      }
code: public static function checkBIC($bic, array $options = null)
      {
          $bic = preg_replace('/\s+/u', '' , $bic );   // remove whitespaces
  
          if(!empty($options['forceLongBic']) && strlen($bic) === 8)
              $bic .= empty($options['forceLongBicStr']) ? 'XXX' : $options['forceLongBicStr'];
  
          if(empty($bic) && !empty($options['allowEmptyBic']))
              return '';
  
          $bic = strtoupper($bic);                    // use only capital letters
  
          if(preg_match('/^' . self::PATTERN_BIC . '$/', $bic))
              return $bic;
          else
              return false;
      }
code_tokens: public static function checkBIC ( $ bic , array $ options = null ) { $ bic = preg_replace ( '/\s+/u' , '' , $ bic ) ; // remove whitespaces if ( ! empty ( $ options [ 'forceLongBic' ] ) && strlen ( $ bic ) === 8 ) $ bic .= empty ( $ options [ 'forceLongBicStr' ] ) ? 'XXX' : $ options [ 'forceLongBicStr' ] ; if ( empty ( $ bic ) && ! empty ( $ options [ 'allowEmptyBic' ] ) ) return '' ; $ bic = strtoupper ( $ bic ) ; // use only capital letters if ( preg_match ( '/^' . self :: PATTERN_BIC . '$/' , $ bic ) ) return $ bic ; else return false ; }
docstring: Checks if a bic is valid. Note that also if the bic is valid it does not have to exist
  
  @param string $bic
  @param array  $options Takes the following keys:
  - `allowEmptyBic`: (bool) The BIC can be empty.
  - `forceLongBic`: (bool) If the BIC has exact 8 characters, `forceLongBicStr`
  is added. (default false)
  - `forceLongBicStr`: string (default 'XXX')
  @return string|false the valid bic or false if it is not valid
docstring_tokens: Checks if a bic is valid . Note that also if the bic is valid it does not have to exist