Overview

Namespaces

  • TwitterOAuth
    • Auth
    • Common
    • Exception
    • Serializer

Classes

  • ArraySerializer
  • JsonSerializer
  • ObjectSerializer
  • TextSerializer

Interfaces

  • SerializerInterface
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: 
 3: /**
 4:  * TwitterOAuth - https://github.com/ricardoper/TwitterOAuth
 5:  * PHP library to communicate with Twitter OAuth API version 1.1
 6:  *
 7:  * @author Ricardo Pereira <github@ricardopereira.es>
 8:  * @copyright 2014
 9:  */
10: 
11: namespace TwitterOAuth\Serializer;
12: 
13: class TextSerializer implements SerializerInterface
14: {
15:     /**
16:      * Format Output To Text
17:      *
18:      * @param  string $response
19:      * @return mixed
20:      */
21:     public function format($response)
22:     {
23:         if (!headers_sent()) {
24:             header('Cache-Control: no-cache, must-revalidate');
25:             header('Expires: Tue, 19 May 1981 18:00:00 GMT');
26:             header('Content-type: text/plain; charset=utf-8');
27:         }
28: 
29:         return $response;
30:     }
31: }
32: 
TwitterOAuth (for v1.1 API) API documentation generated by ApiGen