original_string: protected static function toCanonicalForm($config, $key = 'operand')
      {
          if (!is_array($config)) {
              return array($key => $config);
  
          } elseif (array_key_exists('operator', $config)
                    || array_key_exists('operand', $config)
          ) {
              return $config;
  
          } elseif (1 == count($config)) {
              return array($key => end($config));
  
          } else {
              return array('operator' => reset($config), 'operand' => end($config));
          }
      }
code: protected static function toCanonicalForm($config, $key = 'operand')
      {
          if (!is_array($config)) {
              return array($key => $config);
  
          } elseif (array_key_exists('operator', $config)
                    || array_key_exists('operand', $config)
          ) {
              return $config;
  
          } elseif (1 == count($config)) {
              return array($key => end($config));
  
          } else {
              return array('operator' => reset($config), 'operand' => end($config));
          }
      }
code_tokens: protected static function toCanonicalForm ( $ config , $ key = 'operand' ) { if ( ! is_array ( $ config ) ) { return array ( $ key => $ config ) ; } elseif ( array_key_exists ( 'operator' , $ config ) || array_key_exists ( 'operand' , $ config ) ) { return $ config ; } elseif ( 1 == count ( $ config ) ) { return array ( $ key => end ( $ config ) ) ; } else { return array ( 'operator' => reset ( $ config ) , 'operand' => end ( $ config ) ) ; } }
docstring: Converts configuration data to a canonical associative array form
  
  @param    mixed   Configuration data
  @param    string  Array key to assign $config to if it is scalar
  @return   array   Associative array that may contain 'operand' and 'operator' keys
docstring_tokens: Converts configuration data to a canonical associative array form