From e359e7e44da8a67342f66de9345bca9b7037cf3f Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 20 Nov 2013 13:29:05 +0100 Subject: [PATCH] big update's coming --- http/Client/Request.md | 4 +-- http/Client/Request/__construct.md | 3 +- http/Client/Request/addQuery.md | 5 +++ http/Client/Request/addSslOptions.md | 4 +++ http/Client/Request/setContentType.md | 5 +-- http/Client/Request/setOptions.md | 3 ++ http/Client/Request/setQuery.md | 5 +++ http/Client/Request/setSslOptions.md | 4 +++ http/Client/Response/getCookies.md | 1 - http/Client/Response/getTransferInfo.md | 9 +++-- http/Client/__construct.md | 4 ++- http/Client/addCookies.md | 4 +++ http/Client/addSslOptions.md | 4 +++ http/Client/attach.md | 5 +++ http/Client/dequeue.md | 4 ++- http/Client/detach.md | 5 +++ http/Client/enableEvents.md | 4 +++ http/Client/enablePipelining.md | 5 +++ http/Client/enqueue.md | 4 ++- http/Client/getHistory.md | 4 +++ http/Client/getObservers.md | 3 +- http/Client/getProgressInfo.md | 3 +- http/Client/getResponse.md | 7 +++- http/Client/getTransferInfo.md | 3 +- http/Client/notify.md | 5 +++ http/Client/requeue.md | 5 +++ http/Client/send.md | 3 +- http/Client/setCookies.md | 4 +++ http/Client/setOptions.md | 3 ++ http/Client/setSslOptions.md | 4 +++ http/Cookie.md | 4 +-- http/Cookie/.md | 0 http/Cookie/__construct.md | 3 +- http/Cookie/addCookie.md | 4 +++ http/Cookie/addCookies.md | 4 +++ http/Cookie/addExtra.md | 4 +++ http/Cookie/addExtras.md | 4 +++ http/Cookie/setCookie.md | 4 +++ http/Cookie/setCookies.md | 4 +++ http/Cookie/setDomain.md | 4 +++ http/Cookie/setExpires.md | 4 +++ http/Cookie/setExtra.md | 4 +++ http/Cookie/setExtras.md | 4 +++ http/Cookie/setFlags.md | 4 +++ http/Cookie/setMaxAge.md | 4 +++ http/Cookie/setPath.md | 4 +++ http/Encoding/Stream.md | 2 +- http/Encoding/Stream/Dechunk/decode.md | 16 ++++++++- http/Encoding/Stream/Deflate/encode.md | 3 ++ http/Encoding/Stream/Inflate/decode.md | 4 +++ http/Encoding/Stream/__construct.md | 3 +- http/Encoding/Stream/finish.md | 4 +++ http/Encoding/Stream/flush.md | 4 +++ http/Encoding/Stream/update.md | 4 +++ http/Env.md | 2 +- http/Env/Request/__construct.md | 4 +++ http/Env/Response/__construct.md | 3 +- http/Env/Response/setCacheControl.md | 4 +++ http/Env/Response/setContentDisposition.md | 4 +++ http/Env/Response/setContentEncoding.md | 4 +++ http/Env/Response/setContentType.md | 4 +++ http/Env/Response/setEnvRequest.md | 4 +++ http/Env/Response/setEtag.md | 4 +++ http/Env/Response/setLastModified.md | 4 +++ http/Env/getRequestBody.md | 3 +- http/Exception.md | 42 +++++++++++----------- http/Exception/BadConversionException.md | 3 ++ http/Exception/BadHeaderException.md | 3 ++ http/Exception/BadMessageException.md | 3 ++ http/Exception/BadMethodCallException.md | 3 ++ http/Exception/BadQueryStringException.md | 3 ++ http/Exception/BadUrlException.md | 3 ++ http/Exception/InvalidArgumentException.md | 3 ++ http/Exception/RuntimeException.md | 4 +++ http/Exception/UnexpectedValueException.md | 3 ++ http/Header.md | 2 +- http/Header/parse.md | 5 +++ http/Header/unserialize.md | 3 ++ http/Message.md | 2 +- http/Message/Body.md | 2 +- http/Message/Body/__construct.md | 3 +- http/Message/Body/addForm.md | 5 +++ http/Message/Body/addPart.md | 5 +++ http/Message/Body/append.md | 5 +-- http/Message/__construct.md | 3 +- http/Message/detach.md | 2 +- http/Message/getBody.md | 3 +- http/Message/getHeader.md | 2 +- http/Message/getParentMessage.md | 3 +- http/Message/getRequestMethod.md | 4 +-- http/Message/getRequestUrl.md | 4 +-- http/Message/getResponseCode.md | 4 +-- http/Message/getResponseStatus.md | 4 +-- http/Message/prepend.md | 3 +- http/Message/reverse.md | 4 +++ http/Message/setBody.md | 5 +++ http/Message/setHttpVersion.md | 7 ++-- http/Message/setInfo.md | 5 +-- http/Message/setRequestMethod.md | 10 ++---- http/Message/setRequestUrl.md | 10 ++---- http/Message/setResponseCode.md | 11 ++++-- http/Message/setResponseStatus.md | 7 ++-- http/Message/splitMultipartBody.md | 6 ++++ http/Message/unserialize.md | 3 ++ http/Object.md | 19 ---------- http/Object/getDefaultErrorHandling.md | 8 ----- http/Object/getErrorHandling.md | 12 ------- http/Object/setDefaultErrorHandling.md | 17 --------- http/Object/setErrorHandling.md | 21 ----------- http/Object/triggerError.md | 13 ------- http/Params.md | 4 +-- http/Params/__construct.md | 3 +- http/QueryString.md | 2 +- http/QueryString/__construct.md | 2 +- http/QueryString/getGlobalInstance.md | 2 +- http/QueryString/getIterator.md | 3 +- http/QueryString/mod.md | 7 ++-- http/QueryString/xlate.md | 3 +- http/Url.md | 2 +- http/Url/__construct.md | 3 +- http/Url/mod.md | 6 ++++ index.js | 5 +++ 122 files changed, 407 insertions(+), 192 deletions(-) delete mode 100644 http/Cookie/.md create mode 100644 http/Exception/BadConversionException.md create mode 100644 http/Exception/BadHeaderException.md create mode 100644 http/Exception/BadMessageException.md create mode 100644 http/Exception/BadMethodCallException.md create mode 100644 http/Exception/BadQueryStringException.md create mode 100644 http/Exception/BadUrlException.md create mode 100644 http/Exception/InvalidArgumentException.md create mode 100644 http/Exception/RuntimeException.md create mode 100644 http/Exception/UnexpectedValueException.md delete mode 100644 http/Object.md delete mode 100644 http/Object/getDefaultErrorHandling.md delete mode 100644 http/Object/getErrorHandling.md delete mode 100644 http/Object/setDefaultErrorHandling.md delete mode 100644 http/Object/setErrorHandling.md delete mode 100644 http/Object/triggerError.md diff --git a/http/Client/Request.md b/http/Client/Request.md index a384550..16019ce 100644 --- a/http/Client/Request.md +++ b/http/Client/Request.md @@ -10,6 +10,6 @@ None. ## Properties: -* array $options = NULL - Options for this request, which override client options. +* protected $options = NULL + Array of options for this request, which override client options. diff --git a/http/Client/Request/__construct.md b/http/Client/Request/__construct.md index e14a7ad..d576bf6 100644 --- a/http/Client/Request/__construct.md +++ b/http/Client/Request/__construct.md @@ -15,7 +15,8 @@ Create a new client request message to be enqueued and sent by http\Client. ## Throws: -* http\Exception. +* http\Exception\InvalidArgumentException +* http\Exception\UnexpectedValueException ## Example: diff --git a/http/Client/Request/addQuery.md b/http/Client/Request/addQuery.md index 5ecd5ab..b34de24 100644 --- a/http/Client/Request/addQuery.md +++ b/http/Client/Request/addQuery.md @@ -11,3 +11,8 @@ See http\Client\Request::setQuery() and http\Message::setRequestUrl(). ## Returns: * http\Client\Request, self. + +## Throws: + +* http\Exception\InvalidArgumentException +* http\Exception\BadQueryStringException diff --git a/http/Client/Request/addSslOptions.md b/http/Client/Request/addSslOptions.md index 40b4bd3..f11e35c 100644 --- a/http/Client/Request/addSslOptions.md +++ b/http/Client/Request/addSslOptions.md @@ -11,3 +11,7 @@ See http\Client\Request::setSslOptions(), http\Client\Request::setOptions() and ## Returns: * http\Client\Request, self. + +## Throws: + +* http\Client\InvalidArgumentException diff --git a/http/Client/Request/setContentType.md b/http/Client/Request/setContentType.md index 2ec6451..68636c7 100644 --- a/http/Client/Request/setContentType.md +++ b/http/Client/Request/setContentType.md @@ -11,6 +11,7 @@ Set the MIME content type of the request message. * http\Client\Request, self. -## Warnings: +## Throws: -* HTTP_E_INVALID_PARAM, if $content_type does not follow the general "primary/secondary" notation. +* http\Exception\InvalidArgumentException +* http\Exception\UnexpectedValueException diff --git a/http/Client/Request/setOptions.md b/http/Client/Request/setOptions.md index 4742d44..577095e 100644 --- a/http/Client/Request/setOptions.md +++ b/http/Client/Request/setOptions.md @@ -14,3 +14,6 @@ See http\Client::setOptions() and http\Client\Curl. * http\Client\Request, self. +## Throws: + +* http\Client\InvalidArgumentException diff --git a/http/Client/Request/setQuery.md b/http/Client/Request/setQuery.md index 009acbd..68deb3d 100644 --- a/http/Client/Request/setQuery.md +++ b/http/Client/Request/setQuery.md @@ -11,6 +11,11 @@ See http\Client\Request::addQuery() and http\Message::setRequestUrl(). * http\Client\Request, self. +## Throws: + +* http\Exception\InvalidArgumentException +* http\Exception\BadQueryStringException + ## Example: splitMultipartBody(); + } catch (http\Exception\BadMethodCallException $e) { + // doh, no multipart message + } catch (http\Exception\BadMessageException $e) { + // failure while parsing + } catch (http\Exception $e) { + // here we used the interface to catch any http\Exception + } catch (Exception $e) { + // catch any other exception (unlikely, though) + } + ?> diff --git a/http/Exception/BadConversionException.md b/http/Exception/BadConversionException.md new file mode 100644 index 0000000..506f62e --- /dev/null +++ b/http/Exception/BadConversionException.md @@ -0,0 +1,3 @@ +# class http\Exception\BadConversionException extends DomainException implements http\Exception + +A bad conversion (e.g. character conversion) was encountered. diff --git a/http/Exception/BadHeaderException.md b/http/Exception/BadHeaderException.md new file mode 100644 index 0000000..a8faafc --- /dev/null +++ b/http/Exception/BadHeaderException.md @@ -0,0 +1,3 @@ +# class http\Exception\BadHeaderException extends DomainException implements http\Exception + +A bad HTTP header was encountered. diff --git a/http/Exception/BadMessageException.md b/http/Exception/BadMessageException.md new file mode 100644 index 0000000..8397c4d --- /dev/null +++ b/http/Exception/BadMessageException.md @@ -0,0 +1,3 @@ +# class http\Exception\BadMessageException extends DomainException implements http\Exception + +A bad HTTP message was encountered. diff --git a/http/Exception/BadMethodCallException.md b/http/Exception/BadMethodCallException.md new file mode 100644 index 0000000..fcd7b90 --- /dev/null +++ b/http/Exception/BadMethodCallException.md @@ -0,0 +1,3 @@ +# class http\Exception\BadMethodCallException extends BadMethodCallException implements http\Exception + +A method was called on an object, which was in an invalid or unexpected state. diff --git a/http/Exception/BadQueryStringException.md b/http/Exception/BadQueryStringException.md new file mode 100644 index 0000000..359b4fd --- /dev/null +++ b/http/Exception/BadQueryStringException.md @@ -0,0 +1,3 @@ +# class http\Exception\BadQueryStringException extends DomainException implements http\Exception + +A bad querystring was encountered. diff --git a/http/Exception/BadUrlException.md b/http/Exception/BadUrlException.md new file mode 100644 index 0000000..2305e68 --- /dev/null +++ b/http/Exception/BadUrlException.md @@ -0,0 +1,3 @@ +# class http\Exception\BadUrlException extends DomainException implements http\Exception + +A bad HTTP URL was encountered. diff --git a/http/Exception/InvalidArgumentException.md b/http/Exception/InvalidArgumentException.md new file mode 100644 index 0000000..9276c81 --- /dev/null +++ b/http/Exception/InvalidArgumentException.md @@ -0,0 +1,3 @@ +# class http\Exception\InvalidArgumentException extends InvalidArgumentException implements http\Exception + +One or more invalid arguments were passed to a method. diff --git a/http/Exception/RuntimeException.md b/http/Exception/RuntimeException.md new file mode 100644 index 0000000..b41a4d5 --- /dev/null +++ b/http/Exception/RuntimeException.md @@ -0,0 +1,4 @@ +# class http\Exception\RuntimeException extends RuntimeException implements http\Exception + +A generic runtime exception. + diff --git a/http/Exception/UnexpectedValueException.md b/http/Exception/UnexpectedValueException.md new file mode 100644 index 0000000..0da97fa --- /dev/null +++ b/http/Exception/UnexpectedValueException.md @@ -0,0 +1,3 @@ +# class http\Exception\UnexpectedValueException extends UnexpectedValueException implements http\Exception + +An unexpected value was encountered. diff --git a/http/Header.md b/http/Header.md index 6261bae..59ad426 100644 --- a/http/Header.md +++ b/http/Header.md @@ -1,4 +1,4 @@ -# class http\Header extends http\Object implements Serializable +# class http\Header implements Serializable The http\Header class provides methods to manipulate, match, negotiate and serialize HTTP headers. diff --git a/http/Header/parse.md b/http/Header/parse.md index 4e2c5a1..84c7d82 100644 --- a/http/Header/parse.md +++ b/http/Header/parse.md @@ -12,3 +12,8 @@ Parse HTTP headers. ## Returns: * array of parsed headers, where the elements are instances of $header_class if specified. +* false, if parsing fails. + +## Warnings: + +* If the header parser fails. diff --git a/http/Header/unserialize.md b/http/Header/unserialize.md index 3a40de6..91e3566 100644 --- a/http/Header/unserialize.md +++ b/http/Header/unserialize.md @@ -7,3 +7,6 @@ Implements Serializable. * string $serialized The serialized HTTP header (i.e. "Name: value") +## Warnings: + +* If the header parser fails. diff --git a/http/Message.md b/http/Message.md index cdb4c30..ca48ff2 100644 --- a/http/Message.md +++ b/http/Message.md @@ -1,4 +1,4 @@ -# class http\Message extends http\Object implements Countable, Serializable, Iterator +# class http\Message implements Countable, Serializable, Iterator The message class builds the foundation for any request and response message. See http\Client\Request and http\Client\Response, as well as http\Env\Request and http\Env\Response. diff --git a/http/Message/Body.md b/http/Message/Body.md index 01c3479..ef684ad 100644 --- a/http/Message/Body.md +++ b/http/Message/Body.md @@ -1,4 +1,4 @@ -# class http\Message\Body extends http\Object implements Serializable +# class http\Message\Body implements Serializable The message body, represented as a PHP (temporary) stream. diff --git a/http/Message/Body/__construct.md b/http/Message/Body/__construct.md index 2ef43e0..0a144c6 100644 --- a/http/Message/Body/__construct.md +++ b/http/Message/Body/__construct.md @@ -9,7 +9,8 @@ Create a new message body, optionally referencing $stream. ## Throws: -* http\Exception. +* http\Exception\InvalidArgumentException +* http\Exception\UnexpectedValueException ## Example: diff --git a/http/Message/Body/addForm.md b/http/Message/Body/addForm.md index d71fda9..19e3b6c 100644 --- a/http/Message/Body/addForm.md +++ b/http/Message/Body/addForm.md @@ -47,6 +47,11 @@ As you can see, a file structure must contain a "file" entry, which holds a file * http\Message\Body, self. +## Throws: + +* http\Exception\InvalidArgumentException +* http\Exception\RuntimeException + ## Example: **Note:** This method also resets the response status phrase to the default for that code. + ## Params: * int $response_code The response code. +* Optional bool $strict = true + Whether to check that the response code is between 100 and 599 inclusive. ## Returns: * http\Message, self. -* false, if the message is not of type response. +## Throws: + +* http\Exception\InvalidArgumentException +* http\Exception\BadMethodCallException diff --git a/http/Message/setResponseStatus.md b/http/Message/setResponseStatus.md index b1ba286..c67fa26 100644 --- a/http/Message/setResponseStatus.md +++ b/http/Message/setResponseStatus.md @@ -11,12 +11,11 @@ See http\Message::getResponseStatus() and http\Message::setResponseCode(). ## Returns: * http\Message, self. -* false, if the message is not of type response. -## Notice: - -* E_MESSAGE_TYPE, if the message is not of type response. +## Throws: +* http\Exception\InvalidArgumentException +* http\Exception\BadMethodCallException ## Example: diff --git a/http/Message/splitMultipartBody.md b/http/Message/splitMultipartBody.md index 10f2ac6..8e59e48 100644 --- a/http/Message/splitMultipartBody.md +++ b/http/Message/splitMultipartBody.md @@ -11,6 +11,12 @@ None. * http\Message, a message chain of all messages of the multipart body. +## Throws: + +* http\Exception\InvalidArgumentException +* http\Exception\BadMethodCallException +* http\Exception\BadMessageException + ## Example: **Note:** This method returns a clone (copy) of this instance +> **Note:** This method returns a clone (copy) of this instance. ## Params: * mixed $params = NULL Additional params as object, array or string to parse. - ## Returns: * http\QueryString, clone. + +## Throws: + +* http\Exception\BadQueryStringException diff --git a/http/QueryString/xlate.md b/http/QueryString/xlate.md index baeb2f6..4087b40 100644 --- a/http/QueryString/xlate.md +++ b/http/QueryString/xlate.md @@ -17,4 +17,5 @@ Translate character encodings of the querystring with ext/iconv. ## Throws: -* http\Exception +* http\Exception\InvalidArgumentException +* http\Exception\BadConversionException diff --git a/http/Url.md b/http/Url.md index 8069c34..b9ef47f 100644 --- a/http/Url.md +++ b/http/Url.md @@ -1,4 +1,4 @@ -# class http\Url extends http\Object +# class http\Url The http\Url class provides versatile means to parse, construct and manipulate URLs. diff --git a/http/Url/__construct.md b/http/Url/__construct.md index 6d67306..bf66296 100644 --- a/http/Url/__construct.md +++ b/http/Url/__construct.md @@ -13,5 +13,6 @@ Create an instance of an http\URL. ## Throws: -* http\Exception +* http\Exception\InvalidArgumentException +* http\Exception\BadUrlException diff --git a/http/Url/mod.md b/http/Url/mod.md index 52b1f53..9fab9a8 100644 --- a/http/Url/mod.md +++ b/http/Url/mod.md @@ -14,3 +14,9 @@ Clone this URL and apply $parts to the cloned URL. ## Returns: * http\Url, clone. + +## Throws: + + +* http\Exception\InvalidArgumentException +* http\Exception\BadUrlException diff --git a/index.js b/index.js index 41d9e85..e0f3ccf 100644 --- a/index.js +++ b/index.js @@ -40,6 +40,11 @@ function type(s, nn) { case "stdClass": case "Exception": case "ErrorException": + case "RuntimeException": + case "UnexpectedValueException": + case "DomainException": + case "InvalidArgumentException": + case "BadMethodCallException": case "Closure": case "Generator": case "Countable": -- 2.30.2