original_string: public static function isStringCastable($value): bool
      {
          $result = false;
          $type = strtolower(gettype($value));
          switch ($type) {
              case 'string':
              case 'null':
              case 'boolean':
              case 'integer':
              case 'double':
                  $result = true;
                  break;
              case 'object':
                  if (method_exists($value, '__toString')) {
                      $result = true;
                  }
                  break;
              default:
                  break;
          }
  
          return $result;
      }
code: public static function isStringCastable($value): bool
      {
          $result = false;
          $type = strtolower(gettype($value));
          switch ($type) {
              case 'string':
              case 'null':
              case 'boolean':
              case 'integer':
              case 'double':
                  $result = true;
                  break;
              case 'object':
                  if (method_exists($value, '__toString')) {
                      $result = true;
                  }
                  break;
              default:
                  break;
          }
  
          return $result;
      }
code_tokens: public static function isStringCastable ( $ value ) : bool { $ result = false ; $ type = strtolower ( gettype ( $ value ) ) ; switch ( $ type ) { case 'string' : case 'null' : case 'boolean' : case 'integer' : case 'double' : $ result = true ; break ; case 'object' : if ( method_exists ( $ value , '__toString' ) ) { $ result = true ; } break ; default : break ; } return $ result ; }
docstring: Checks if value can be cast to a string
  
  @param mixed $value The value
  
  @return bool
docstring_tokens: Checks if value can be cast to a string