upgrade zend (#1559)
[openemr.git] / vendor / zendframework / zend-console / src / Response.php
blob70a4c7d7913db6c69121e12369350eed37a46262
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Console;
12 use Zend\Stdlib\Message;
13 use Zend\Stdlib\ResponseInterface;
15 class Response extends Message implements ResponseInterface
17 /**
18 * @var bool
20 protected $contentSent = false;
22 /**
23 * Check if content was sent
25 * @return bool
26 * @deprecated
28 public function contentSent()
30 return $this->contentSent;
33 /**
34 * Set the error level that will be returned to shell.
36 * @param int $errorLevel
37 * @return Response
39 public function setErrorLevel($errorLevel)
41 if (is_string($errorLevel) && ! ctype_digit($errorLevel)) {
42 return $this;
45 $this->setMetadata('errorLevel', $errorLevel);
46 return $this;
49 /**
50 * Get response error level that will be returned to shell.
52 * @return int|0
54 public function getErrorLevel()
56 return $this->getMetadata('errorLevel', 0);
59 /**
60 * Send content
62 * @return Response
63 * @deprecated
65 public function sendContent()
67 if ($this->contentSent()) {
68 return $this;
70 echo $this->getContent();
71 $this->contentSent = true;
72 return $this;
75 /**
76 * @deprecated
78 public function send()
80 $this->sendContent();
81 $errorLevel = (int) $this->getMetadata('errorLevel', 0);
82 exit($errorLevel);