From: Michael Wallner Date: Wed, 20 Nov 2013 12:29:05 +0000 (+0100) Subject: big update's coming X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=95e046983749327a4f1271b99badaae7a838ec67;p=mdref%2Fmdref-http big update's coming --- 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