original_string: public static function getObjectFieldValue($object, $field)
      {
          $op = $value = null;
  
          $pos = strpos($field, '(');
          if (false !== $pos) {
              list ($op, $field) = explode('(', $field, 2);
              $field = rtrim($field, ')');
          }
  
          if (isset($object[$field])) {
              $value = $object[$field];
          } else {
              $accessors = array('', 'get', 'is');
  
              foreach ($accessors as $accessor) {
                  $accessor .= $field;
  
                  if (!method_exists($object, $accessor)) {
                      continue;
                  }
  
                  $value = $object->{$accessor}();
                  break;
              }
          }
  
          if ($op) {
              $function = 'filter' . ucfirst(strtolower($op));
              if (method_exists(static::class, $function)) {
                  $value = static::$function($value);
              }
          }
  
          return $value;
      }
code: public static function getObjectFieldValue($object, $field)
      {
          $op = $value = null;
  
          $pos = strpos($field, '(');
          if (false !== $pos) {
              list ($op, $field) = explode('(', $field, 2);
              $field = rtrim($field, ')');
          }
  
          if (isset($object[$field])) {
              $value = $object[$field];
          } else {
              $accessors = array('', 'get', 'is');
  
              foreach ($accessors as $accessor) {
                  $accessor .= $field;
  
                  if (!method_exists($object, $accessor)) {
                      continue;
                  }
  
                  $value = $object->{$accessor}();
                  break;
              }
          }
  
          if ($op) {
              $function = 'filter' . ucfirst(strtolower($op));
              if (method_exists(static::class, $function)) {
                  $value = static::$function($value);
              }
          }
  
          return $value;
      }
code_tokens: public static function getObjectFieldValue ( $ object , $ field ) { $ op = $ value = null ; $ pos = strpos ( $ field , '(' ) ; if ( false !== $ pos ) { list ( $ op , $ field ) = explode ( '(' , $ field , 2 ) ; $ field = rtrim ( $ field , ')' ) ; } if ( isset ( $ object [ $ field ] ) ) { $ value = $ object [ $ field ] ; } else { $ accessors = array ( '' , 'get' , 'is' ) ; foreach ( $ accessors as $ accessor ) { $ accessor .= $ field ; if ( ! method_exists ( $ object , $ accessor ) ) { continue ; } $ value = $ object -> { $ accessor } ( ) ; break ; } } if ( $ op ) { $ function = 'filter' . ucfirst ( strtolower ( $ op ) ) ; if ( method_exists ( static :: class , $ function ) ) { $ value = static :: $ function ( $ value ) ; } } return $ value ; }
docstring: Accesses the field of a given object.
  
  @param object $object
  @param string $field
  
  @return mixed
docstring_tokens: Accesses the field of a given object .