File: InternalClient.php

package info (click to toggle)
homer-api 5.0.6%2Bdfsg2-3.1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,612 kB
  • sloc: php: 8,259; sql: 1,212; perl: 984; sh: 318; makefile: 69
file content (24 lines) | stat: -rw-r--r-- 537 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php

namespace RestService;

/**
 * This client does not send any HTTP data,
 * instead it just returns the value.
 *
 * Good for testing purposes.
 */
class InternalClient extends Client
{
    public function sendResponse($pHttpCode = '200', $pMessage)
    {
        $pMessage = array_reverse($pMessage, true);
        $pMessage['status'] = $pHttpCode+0;
        $pMessage = array_reverse($pMessage, true);

        $method = $this->getOutputFormatMethod($this->getOutputFormat());

        return $this->$method($pMessage);
    }

}