diff options
author | purplecode <niespammnie@gmail.com> | 2013-12-08 12:45:51 +0100 |
---|---|---|
committer | purplecode <niespammnie@gmail.com> | 2013-12-08 12:45:51 +0100 |
commit | b3dd84112bc841f071d4df0345cef5e8194fc148 (patch) | |
tree | e5222ffab662479aa025fc6e03ae3d1662395eb6 /src/PCurlException.php | |
parent | a55106c4782fc7b503e150d3a3a7cec1faaacf7b (diff) | |
download | php.curl-b3dd84112bc841f071d4df0345cef5e8194fc148.zip php.curl-b3dd84112bc841f071d4df0345cef5e8194fc148.tar.gz php.curl-b3dd84112bc841f071d4df0345cef5e8194fc148.tar.bz2 |
namespace fix
Diffstat (limited to 'src/PCurlException.php')
-rw-r--r-- | src/PCurlException.php | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/PCurlException.php b/src/PCurlException.php deleted file mode 100644 index abed40a..0000000 --- a/src/PCurlException.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php
-/**
- * PCurl is a REST client libary for PHP.
- *
- * See http://github.com/purplecode/php.curl for details.
- *
- * This code is licensed for use, modification, and distribution
- * under the terms of the MIT License (see http://en.wikipedia.org/wiki/MIT_License)
- */
-
-namespace PurpleCode\PCurl;
-
-class PCurlException extends \Exception {
-
- public static function getClassName() {
- return get_called_class();
- }
-
- public static function assert($condition, $message, $arguments = array(), $code = 400) {
- if (!$condition) {
- $arguments = array_map('json_encode', ArrayUtils::ensureArray($arguments));
- $arguments = array_merge(array($message), $arguments);
- $message = call_user_func_array('sprintf', $arguments);
- $class = self::getClassName();
- throw new $class($message, $code);
- }
- }
-
- public function __construct($message = "Exception", $code = 400, $previous = null) {
- parent::__construct($message, $code, $previous);
- }
-
- public function ensureArray($item) {
- if (is_null($item)) {
- return array();
- }
- return is_array($item) ? $item : array($item);
- }
-
-}
\ No newline at end of file |