@@ -110,38 +110,38 @@ discard block |
||
| 110 | 110 | return $this; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - /** |
|
| 114 | - * Whether to enable sorting the URLs alphabetically (disabled by default). |
|
| 115 | - * |
|
| 116 | - * @param bool $enabled |
|
| 117 | - * @return $this |
|
| 118 | - */ |
|
| 113 | + /** |
|
| 114 | + * Whether to enable sorting the URLs alphabetically (disabled by default). |
|
| 115 | + * |
|
| 116 | + * @param bool $enabled |
|
| 117 | + * @return $this |
|
| 118 | + */ |
|
| 119 | 119 | public function enableSorting(bool $enabled=true) : ConvertHelper_URLFinder |
| 120 | 120 | { |
| 121 | 121 | $this->setOption('sorting', $enabled); |
| 122 | 122 | return $this; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - /** |
|
| 126 | - * Whether to include email addresses in the search. |
|
| 127 | - * This is only relevant when using the getURLs() |
|
| 128 | - * method. |
|
| 129 | - * |
|
| 130 | - * @param bool $include |
|
| 131 | - * @return ConvertHelper_URLFinder |
|
| 132 | - */ |
|
| 125 | + /** |
|
| 126 | + * Whether to include email addresses in the search. |
|
| 127 | + * This is only relevant when using the getURLs() |
|
| 128 | + * method. |
|
| 129 | + * |
|
| 130 | + * @param bool $include |
|
| 131 | + * @return ConvertHelper_URLFinder |
|
| 132 | + */ |
|
| 133 | 133 | public function includeEmails(bool $include=true) : ConvertHelper_URLFinder |
| 134 | 134 | { |
| 135 | 135 | $this->setOption('include-emails', $include); |
| 136 | 136 | return $this; |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | - /** |
|
| 140 | - * Whether to omit the mailto: that is automatically added to all email addresses. |
|
| 141 | - * |
|
| 142 | - * @param bool $omit |
|
| 143 | - * @return ConvertHelper_URLFinder |
|
| 144 | - */ |
|
| 139 | + /** |
|
| 140 | + * Whether to omit the mailto: that is automatically added to all email addresses. |
|
| 141 | + * |
|
| 142 | + * @param bool $omit |
|
| 143 | + * @return ConvertHelper_URLFinder |
|
| 144 | + */ |
|
| 145 | 145 | public function omitMailto(bool $omit=true) : ConvertHelper_URLFinder |
| 146 | 146 | { |
| 147 | 147 | $this->setOption('omit-mailto', $omit); |
@@ -267,11 +267,11 @@ discard block |
||
| 267 | 267 | ); |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | - /** |
|
| 271 | - * Fetches all URLs that can be found in the subject string. |
|
| 272 | - * |
|
| 273 | - * @return string[] |
|
| 274 | - */ |
|
| 270 | + /** |
|
| 271 | + * Fetches all URLs that can be found in the subject string. |
|
| 272 | + * |
|
| 273 | + * @return string[] |
|
| 274 | + */ |
|
| 275 | 275 | public function getURLs() : array |
| 276 | 276 | { |
| 277 | 277 | $this->parse(); |
@@ -474,13 +474,13 @@ discard block |
||
| 474 | 474 | return array_pop($parts); |
| 475 | 475 | } |
| 476 | 476 | |
| 477 | - /** |
|
| 478 | - * Retrieves all email addresses from the subject string. |
|
| 479 | - * |
|
| 480 | - * @return string[] |
|
| 481 | - * |
|
| 482 | - * @see omitMailto() |
|
| 483 | - */ |
|
| 477 | + /** |
|
| 478 | + * Retrieves all email addresses from the subject string. |
|
| 479 | + * |
|
| 480 | + * @return string[] |
|
| 481 | + * |
|
| 482 | + * @see omitMailto() |
|
| 483 | + */ |
|
| 484 | 484 | public function getEmails() : array |
| 485 | 485 | { |
| 486 | 486 | $this->parse(); |
@@ -506,11 +506,11 @@ discard block |
||
| 506 | 506 | return $result; |
| 507 | 507 | } |
| 508 | 508 | |
| 509 | - /** |
|
| 510 | - * Retrieves all URLs as URLInfo instances. |
|
| 511 | - * |
|
| 512 | - * @return URLInfo[] |
|
| 513 | - */ |
|
| 509 | + /** |
|
| 510 | + * Retrieves all URLs as URLInfo instances. |
|
| 511 | + * |
|
| 512 | + * @return URLInfo[] |
|
| 513 | + */ |
|
| 514 | 514 | public function getInfos() : array |
| 515 | 515 | { |
| 516 | 516 | $this->parse(); |
@@ -25,10 +25,10 @@ |
||
| 25 | 25 | * |
| 26 | 26 | * @return string |
| 27 | 27 | */ |
| 28 | - function render() : string; |
|
| 28 | + function render() : string; |
|
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * Renders the string and echos it. |
| 32 | 32 | */ |
| 33 | - function display() : void; |
|
| 33 | + function display() : void; |
|
| 34 | 34 | } |
@@ -20,43 +20,43 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | class ConvertHelper_TabsNormalizer |
| 22 | 22 | { |
| 23 | - /** |
|
| 24 | - * @var integer |
|
| 25 | - */ |
|
| 23 | + /** |
|
| 24 | + * @var integer |
|
| 25 | + */ |
|
| 26 | 26 | protected $max = 0; |
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * @var integer |
|
| 30 | - */ |
|
| 28 | + /** |
|
| 29 | + * @var integer |
|
| 30 | + */ |
|
| 31 | 31 | protected $min = PHP_INT_MAX; |
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * @var bool |
|
| 35 | - */ |
|
| 33 | + /** |
|
| 34 | + * @var bool |
|
| 35 | + */ |
|
| 36 | 36 | protected $tabs2spaces = false; |
| 37 | 37 | |
| 38 | - /** |
|
| 39 | - * @var string[] |
|
| 40 | - */ |
|
| 38 | + /** |
|
| 39 | + * @var string[] |
|
| 40 | + */ |
|
| 41 | 41 | protected $lines = array(); |
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * @var string |
|
| 45 | - */ |
|
| 43 | + /** |
|
| 44 | + * @var string |
|
| 45 | + */ |
|
| 46 | 46 | protected $eol = ''; |
| 47 | 47 | |
| 48 | - /** |
|
| 49 | - * @var integer |
|
| 50 | - */ |
|
| 48 | + /** |
|
| 49 | + * @var integer |
|
| 50 | + */ |
|
| 51 | 51 | protected $tabSize = 4; |
| 52 | 52 | |
| 53 | - /** |
|
| 54 | - * Whether to enable or disable the conversion |
|
| 55 | - * of tabs to spaces. |
|
| 56 | - * |
|
| 57 | - * @param bool $enable |
|
| 58 | - * @return ConvertHelper_TabsNormalizer |
|
| 59 | - */ |
|
| 53 | + /** |
|
| 54 | + * Whether to enable or disable the conversion |
|
| 55 | + * of tabs to spaces. |
|
| 56 | + * |
|
| 57 | + * @param bool $enable |
|
| 58 | + * @return ConvertHelper_TabsNormalizer |
|
| 59 | + */ |
|
| 60 | 60 | public function convertTabsToSpaces(bool $enable=true) : ConvertHelper_TabsNormalizer |
| 61 | 61 | { |
| 62 | 62 | $this->tabs2spaces = $enable; |
@@ -64,13 +64,13 @@ discard block |
||
| 64 | 64 | return $this; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - /** |
|
| 68 | - * Sets the size of a tab, in spaces. Used to convert tabs |
|
| 69 | - * from spaces and the other way around. Defaults to 4. |
|
| 70 | - * |
|
| 71 | - * @param int $amountSpaces |
|
| 72 | - * @return ConvertHelper_TabsNormalizer |
|
| 73 | - */ |
|
| 67 | + /** |
|
| 68 | + * Sets the size of a tab, in spaces. Used to convert tabs |
|
| 69 | + * from spaces and the other way around. Defaults to 4. |
|
| 70 | + * |
|
| 71 | + * @param int $amountSpaces |
|
| 72 | + * @return ConvertHelper_TabsNormalizer |
|
| 73 | + */ |
|
| 74 | 74 | public function setTabSize(int $amountSpaces) : ConvertHelper_TabsNormalizer |
| 75 | 75 | { |
| 76 | 76 | $this->tabSize = $amountSpaces; |
@@ -78,15 +78,15 @@ discard block |
||
| 78 | 78 | return $this; |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - /** |
|
| 82 | - * Normalizes tabs in the specified string by indenting everything |
|
| 83 | - * back to the minimum tab distance. With the second parameter, |
|
| 84 | - * tabs can optionally be converted to spaces as well (recommended |
|
| 85 | - * for HTML output). |
|
| 86 | - * |
|
| 87 | - * @param string $string |
|
| 88 | - * @return string |
|
| 89 | - */ |
|
| 81 | + /** |
|
| 82 | + * Normalizes tabs in the specified string by indenting everything |
|
| 83 | + * back to the minimum tab distance. With the second parameter, |
|
| 84 | + * tabs can optionally be converted to spaces as well (recommended |
|
| 85 | + * for HTML output). |
|
| 86 | + * |
|
| 87 | + * @param string $string |
|
| 88 | + * @return string |
|
| 89 | + */ |
|
| 90 | 90 | public function normalize(string $string) : string |
| 91 | 91 | { |
| 92 | 92 | $this->splitLines($string); |
@@ -143,10 +143,10 @@ discard block |
||
| 143 | 143 | return implode($this->eol, $converted); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - /** |
|
| 147 | - * Finds out the minimum and maximum amount of |
|
| 148 | - * tabs in the string. |
|
| 149 | - */ |
|
| 146 | + /** |
|
| 147 | + * Finds out the minimum and maximum amount of |
|
| 148 | + * tabs in the string. |
|
| 149 | + */ |
|
| 150 | 150 | protected function countOccurrences() : void |
| 151 | 151 | { |
| 152 | 152 | foreach($this->lines as $line) |
@@ -71,9 +71,9 @@ discard block |
||
| 71 | 71 | ) |
| 72 | 72 | ); |
| 73 | 73 | |
| 74 | - /** |
|
| 75 | - * @var string[] |
|
| 76 | - */ |
|
| 74 | + /** |
|
| 75 | + * @var string[] |
|
| 76 | + */ |
|
| 77 | 77 | protected $selected = array(); |
| 78 | 78 | |
| 79 | 79 | public function convert(string $string) : string |
@@ -83,16 +83,16 @@ discard block |
||
| 83 | 83 | return str_replace(array_keys($chars), array_values($chars), $string); |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - /** |
|
| 87 | - * Selects a character set to replace. Can be called |
|
| 88 | - * several times to add additional sets to the collection. |
|
| 89 | - * |
|
| 90 | - * @param string $type See the <code>CHAR_XXX</code> constants. |
|
| 91 | - * @return ConvertHelper_HiddenConverter |
|
| 92 | - * |
|
| 93 | - * @see ConvertHelper_HiddenConverter::CHARS_CONTROL |
|
| 94 | - * @see ConvertHelper_HiddenConverter::CHARS_WHITESPACE |
|
| 95 | - */ |
|
| 86 | + /** |
|
| 87 | + * Selects a character set to replace. Can be called |
|
| 88 | + * several times to add additional sets to the collection. |
|
| 89 | + * |
|
| 90 | + * @param string $type See the <code>CHAR_XXX</code> constants. |
|
| 91 | + * @return ConvertHelper_HiddenConverter |
|
| 92 | + * |
|
| 93 | + * @see ConvertHelper_HiddenConverter::CHARS_CONTROL |
|
| 94 | + * @see ConvertHelper_HiddenConverter::CHARS_WHITESPACE |
|
| 95 | + */ |
|
| 96 | 96 | public function selectCharacters(string $type) : ConvertHelper_HiddenConverter |
| 97 | 97 | { |
| 98 | 98 | if(!in_array($type, $this->selected)) { |
@@ -102,11 +102,11 @@ discard block |
||
| 102 | 102 | return $this; |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | - /** |
|
| 106 | - * Resolves the list of characters to make visible. |
|
| 107 | - * |
|
| 108 | - * @return string[] |
|
| 109 | - */ |
|
| 105 | + /** |
|
| 106 | + * Resolves the list of characters to make visible. |
|
| 107 | + * |
|
| 108 | + * @return string[] |
|
| 109 | + */ |
|
| 110 | 110 | protected function resolveSelection() : array |
| 111 | 111 | { |
| 112 | 112 | $selected = $this->selected; |
@@ -27,16 +27,16 @@ |
||
| 27 | 27 | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * We parse the query string ourselves, because the PHP implementation |
|
| 32 | - * of parse_str has limitations that do not apply to query strings. This |
|
| 33 | - * is due to the fact that parse_str has to create PHP-compatible variable |
|
| 34 | - * names from the parameters. URL parameters simply allow way more things |
|
| 35 | - * than PHP variable names. |
|
| 36 | - * |
|
| 37 | - * @param string $queryString |
|
| 38 | - * @return array<string,string> |
|
| 39 | - */ |
|
| 30 | + /** |
|
| 31 | + * We parse the query string ourselves, because the PHP implementation |
|
| 32 | + * of parse_str has limitations that do not apply to query strings. This |
|
| 33 | + * is due to the fact that parse_str has to create PHP-compatible variable |
|
| 34 | + * names from the parameters. URL parameters simply allow way more things |
|
| 35 | + * than PHP variable names. |
|
| 36 | + * |
|
| 37 | + * @param string $queryString |
|
| 38 | + * @return array<string,string> |
|
| 39 | + */ |
|
| 40 | 40 | public function parse(string $queryString) : array |
| 41 | 41 | { |
| 42 | 42 | // allow HTML entities notation |
@@ -22,9 +22,9 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | class RequestHelper_Exception extends BaseException |
| 24 | 24 | { |
| 25 | - /** |
|
| 26 | - * @var RequestHelper_Response|NULL |
|
| 27 | - */ |
|
| 25 | + /** |
|
| 26 | + * @var RequestHelper_Response|NULL |
|
| 27 | + */ |
|
| 28 | 28 | protected $response = null; |
| 29 | 29 | |
| 30 | 30 | /** |
@@ -37,11 +37,11 @@ discard block |
||
| 37 | 37 | return $this; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * Retrieves the related response instance, if available. |
|
| 42 | - * |
|
| 43 | - * @return RequestHelper_Response|NULL |
|
| 44 | - */ |
|
| 40 | + /** |
|
| 41 | + * Retrieves the related response instance, if available. |
|
| 42 | + * |
|
| 43 | + * @return RequestHelper_Response|NULL |
|
| 44 | + */ |
|
| 45 | 45 | public function getResponse() : ?RequestHelper_Response |
| 46 | 46 | { |
| 47 | 47 | return $this->response; |
@@ -41,71 +41,71 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | class Highlighter |
| 43 | 43 | { |
| 44 | - /** |
|
| 45 | - * Creates a new GeSHi instance from a source code string. |
|
| 46 | - * |
|
| 47 | - * @param string $sourceCode |
|
| 48 | - * @param string $format |
|
| 49 | - * @return GeSHi |
|
| 50 | - */ |
|
| 44 | + /** |
|
| 45 | + * Creates a new GeSHi instance from a source code string. |
|
| 46 | + * |
|
| 47 | + * @param string $sourceCode |
|
| 48 | + * @param string $format |
|
| 49 | + * @return GeSHi |
|
| 50 | + */ |
|
| 51 | 51 | public static function fromString(string $sourceCode, string $format) : GeSHi |
| 52 | 52 | { |
| 53 | 53 | return new GeSHi($sourceCode, $format); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - /** |
|
| 57 | - * Creates a new GeSHi instance from the contents of a file. |
|
| 58 | - * |
|
| 59 | - * @param string $path |
|
| 60 | - * @param string $format |
|
| 61 | - * @return GeSHi |
|
| 62 | - */ |
|
| 56 | + /** |
|
| 57 | + * Creates a new GeSHi instance from the contents of a file. |
|
| 58 | + * |
|
| 59 | + * @param string $path |
|
| 60 | + * @param string $format |
|
| 61 | + * @return GeSHi |
|
| 62 | + */ |
|
| 63 | 63 | public static function fromFile(string $path, string $format) : GeSHi |
| 64 | 64 | { |
| 65 | 65 | return self::fromString(FileHelper::readContents($path), $format); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - /** |
|
| 69 | - * Parses and highlights the target string. |
|
| 70 | - * |
|
| 71 | - * @param string $sourceCode |
|
| 72 | - * @param string $format |
|
| 73 | - * @return string |
|
| 74 | - */ |
|
| 68 | + /** |
|
| 69 | + * Parses and highlights the target string. |
|
| 70 | + * |
|
| 71 | + * @param string $sourceCode |
|
| 72 | + * @param string $format |
|
| 73 | + * @return string |
|
| 74 | + */ |
|
| 75 | 75 | public static function parseString(string $sourceCode, string $format) : string |
| 76 | 76 | { |
| 77 | 77 | return self::fromString($sourceCode, $format)->parse_code(); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - /** |
|
| 81 | - * Parses and highlights the contents of the target file. |
|
| 82 | - * |
|
| 83 | - * @param string $path |
|
| 84 | - * @param string $format |
|
| 85 | - * @return string |
|
| 86 | - */ |
|
| 80 | + /** |
|
| 81 | + * Parses and highlights the contents of the target file. |
|
| 82 | + * |
|
| 83 | + * @param string $path |
|
| 84 | + * @param string $format |
|
| 85 | + * @return string |
|
| 86 | + */ |
|
| 87 | 87 | public static function parseFile(string $path, string $format) : string |
| 88 | 88 | { |
| 89 | 89 | return self::fromFile($path, $format)->parse_code(); |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - /** |
|
| 93 | - * Adds HTML syntax highlighting to the specified SQL string. |
|
| 94 | - * |
|
| 95 | - * @param string $sql |
|
| 96 | - * @return string |
|
| 97 | - */ |
|
| 92 | + /** |
|
| 93 | + * Adds HTML syntax highlighting to the specified SQL string. |
|
| 94 | + * |
|
| 95 | + * @param string $sql |
|
| 96 | + * @return string |
|
| 97 | + */ |
|
| 98 | 98 | public static function sql(string $sql) : string |
| 99 | 99 | { |
| 100 | 100 | return self::parseString($sql, 'sql'); |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - /** |
|
| 104 | - * Adds HTML syntax highlighting to a JSON string, or a data array/object. |
|
| 105 | - * |
|
| 106 | - * @param array<int|string,mixed>|object|string $subject A JSON string, or data array/object to convert to JSON to highlight. |
|
| 107 | - * @return string |
|
| 108 | - */ |
|
| 103 | + /** |
|
| 104 | + * Adds HTML syntax highlighting to a JSON string, or a data array/object. |
|
| 105 | + * |
|
| 106 | + * @param array<int|string,mixed>|object|string $subject A JSON string, or data array/object to convert to JSON to highlight. |
|
| 107 | + * @return string |
|
| 108 | + */ |
|
| 109 | 109 | public static function json($subject) : string |
| 110 | 110 | { |
| 111 | 111 | if(!is_string($subject)) |
@@ -118,13 +118,13 @@ discard block |
||
| 118 | 118 | return self::parseString($subject, 'javascript'); |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - /** |
|
| 122 | - * Adds HTML syntax highlighting to the specified XML code. |
|
| 123 | - * |
|
| 124 | - * @param string $xml The XML to highlight. |
|
| 125 | - * @param bool $formatSource Whether to format the source with indentation to make it readable. |
|
| 126 | - * @return string |
|
| 127 | - */ |
|
| 121 | + /** |
|
| 122 | + * Adds HTML syntax highlighting to the specified XML code. |
|
| 123 | + * |
|
| 124 | + * @param string $xml The XML to highlight. |
|
| 125 | + * @param bool $formatSource Whether to format the source with indentation to make it readable. |
|
| 126 | + * @return string |
|
| 127 | + */ |
|
| 128 | 128 | public static function xml(string $xml, bool $formatSource=false) : string |
| 129 | 129 | { |
| 130 | 130 | if($formatSource) |
@@ -141,13 +141,13 @@ discard block |
||
| 141 | 141 | return self::parseString($xml, 'xml'); |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - /** |
|
| 145 | - * Adds HTML syntax highlighting to the specified HTML code. |
|
| 146 | - * |
|
| 147 | - * @param string $html |
|
| 148 | - * @param bool $formatSource |
|
| 149 | - * @return string |
|
| 150 | - */ |
|
| 144 | + /** |
|
| 145 | + * Adds HTML syntax highlighting to the specified HTML code. |
|
| 146 | + * |
|
| 147 | + * @param string $html |
|
| 148 | + * @param bool $formatSource |
|
| 149 | + * @return string |
|
| 150 | + */ |
|
| 151 | 151 | public static function html(string $html, bool $formatSource=false) : string |
| 152 | 152 | { |
| 153 | 153 | if($formatSource) |
@@ -164,27 +164,27 @@ discard block |
||
| 164 | 164 | return self::parseString($html, 'xml'); |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - /** |
|
| 168 | - * Adds HTML syntax highlighting to a bit of PHP code. |
|
| 169 | - * |
|
| 170 | - * @param string $phpCode |
|
| 171 | - * @return string |
|
| 172 | - */ |
|
| 167 | + /** |
|
| 168 | + * Adds HTML syntax highlighting to a bit of PHP code. |
|
| 169 | + * |
|
| 170 | + * @param string $phpCode |
|
| 171 | + * @return string |
|
| 172 | + */ |
|
| 173 | 173 | public static function php(string $phpCode) : string |
| 174 | 174 | { |
| 175 | 175 | return self::parseString($phpCode, 'php'); |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | - /** |
|
| 179 | - * Adds HTML syntax highlighting to an URL. |
|
| 180 | - * |
|
| 181 | - * NOTE: Includes the necessary CSS styles. When |
|
| 182 | - * highlighting several URLs in the same page, |
|
| 183 | - * prefer using the `parseURL` function instead. |
|
| 184 | - * |
|
| 185 | - * @param string $url |
|
| 186 | - * @return string |
|
| 187 | - */ |
|
| 178 | + /** |
|
| 179 | + * Adds HTML syntax highlighting to an URL. |
|
| 180 | + * |
|
| 181 | + * NOTE: Includes the necessary CSS styles. When |
|
| 182 | + * highlighting several URLs in the same page, |
|
| 183 | + * prefer using the `parseURL` function instead. |
|
| 184 | + * |
|
| 185 | + * @param string $url |
|
| 186 | + * @return string |
|
| 187 | + */ |
|
| 188 | 188 | public static function url(string $url) : string |
| 189 | 189 | { |
| 190 | 190 | $info = parseURL($url); |
@@ -26,9 +26,9 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | class OperationResult_Collection extends OperationResult |
| 28 | 28 | { |
| 29 | - /** |
|
| 30 | - * @var OperationResult[] |
|
| 31 | - */ |
|
| 29 | + /** |
|
| 30 | + * @var OperationResult[] |
|
| 31 | + */ |
|
| 32 | 32 | protected $results = array(); |
| 33 | 33 | |
| 34 | 34 | /** |
@@ -123,9 +123,9 @@ discard block |
||
| 123 | 123 | return $this; |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | - /** |
|
| 127 | - * @return OperationResult[] |
|
| 128 | - */ |
|
| 126 | + /** |
|
| 127 | + * @return OperationResult[] |
|
| 128 | + */ |
|
| 129 | 129 | public function getResults() : array |
| 130 | 130 | { |
| 131 | 131 | return $this->results; |
@@ -22,19 +22,19 @@ discard block |
||
| 22 | 22 | { |
| 23 | 23 | public const ERROR_NO_BOUNDARIES_SPECIFIED = 44401; |
| 24 | 24 | |
| 25 | - /** |
|
| 26 | - * @var RequestHelper |
|
| 27 | - */ |
|
| 25 | + /** |
|
| 26 | + * @var RequestHelper |
|
| 27 | + */ |
|
| 28 | 28 | protected $helper; |
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * @var RequestHelper_Boundaries_Boundary[] |
|
| 32 | - */ |
|
| 30 | + /** |
|
| 31 | + * @var RequestHelper_Boundaries_Boundary[] |
|
| 32 | + */ |
|
| 33 | 33 | protected $boundaries = array(); |
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * @var integer |
|
| 37 | - */ |
|
| 35 | + /** |
|
| 36 | + * @var integer |
|
| 37 | + */ |
|
| 38 | 38 | protected $contentLength = 0; |
| 39 | 39 | |
| 40 | 40 | public function __construct(RequestHelper $helper) |
@@ -42,31 +42,31 @@ discard block |
||
| 42 | 42 | $this->helper = $helper; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - /** |
|
| 46 | - * Retrieves the string that is used to separate mime boundaries in the body. |
|
| 47 | - * |
|
| 48 | - * @return string |
|
| 49 | - */ |
|
| 45 | + /** |
|
| 46 | + * Retrieves the string that is used to separate mime boundaries in the body. |
|
| 47 | + * |
|
| 48 | + * @return string |
|
| 49 | + */ |
|
| 50 | 50 | public function getMimeBoundary() : string |
| 51 | 51 | { |
| 52 | 52 | return $this->helper->getMimeBoundary(); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - /** |
|
| 56 | - * Retrieves the end of line character(s) used in the body. |
|
| 57 | - * |
|
| 58 | - * @return string |
|
| 59 | - */ |
|
| 55 | + /** |
|
| 56 | + * Retrieves the end of line character(s) used in the body. |
|
| 57 | + * |
|
| 58 | + * @return string |
|
| 59 | + */ |
|
| 60 | 60 | public function getEOL() : string |
| 61 | 61 | { |
| 62 | 62 | return $this->helper->getEOL(); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - /** |
|
| 66 | - * Retrieves the total content length of all boundary contents. |
|
| 67 | - * |
|
| 68 | - * @return int |
|
| 69 | - */ |
|
| 65 | + /** |
|
| 66 | + * Retrieves the total content length of all boundary contents. |
|
| 67 | + * |
|
| 68 | + * @return int |
|
| 69 | + */ |
|
| 70 | 70 | public function getContentLength() : int |
| 71 | 71 | { |
| 72 | 72 | // this must use strlen, and not mb_strlen: the content length |
@@ -75,15 +75,15 @@ discard block |
||
| 75 | 75 | return strlen($this->render()); |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - /** |
|
| 79 | - * Adds a file to be sent with the request. |
|
| 80 | - * |
|
| 81 | - * @param string $varName The variable name to send the file in |
|
| 82 | - * @param string $fileName The name of the file as it should be received at the destination |
|
| 83 | - * @param string $content The raw content of the file |
|
| 84 | - * @param string $contentType The content type, use the constants to specify this |
|
| 85 | - * @param string $encoding The encoding of the file, use the constants to specify this |
|
| 86 | - */ |
|
| 78 | + /** |
|
| 79 | + * Adds a file to be sent with the request. |
|
| 80 | + * |
|
| 81 | + * @param string $varName The variable name to send the file in |
|
| 82 | + * @param string $fileName The name of the file as it should be received at the destination |
|
| 83 | + * @param string $content The raw content of the file |
|
| 84 | + * @param string $contentType The content type, use the constants to specify this |
|
| 85 | + * @param string $encoding The encoding of the file, use the constants to specify this |
|
| 86 | + */ |
|
| 87 | 87 | public function addFile(string $varName, string $fileName, string $content, string $contentType = '', string $encoding = '') : RequestHelper_Boundaries |
| 88 | 88 | { |
| 89 | 89 | if(empty($contentType)) |
@@ -107,13 +107,13 @@ discard block |
||
| 107 | 107 | return $this->addBoundary($boundary); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - /** |
|
| 111 | - * Adds arbitrary content. |
|
| 112 | - * |
|
| 113 | - * @param string $varName |
|
| 114 | - * @param string $content |
|
| 115 | - * @param string $contentType |
|
| 116 | - */ |
|
| 110 | + /** |
|
| 111 | + * Adds arbitrary content. |
|
| 112 | + * |
|
| 113 | + * @param string $varName |
|
| 114 | + * @param string $content |
|
| 115 | + * @param string $contentType |
|
| 116 | + */ |
|
| 117 | 117 | public function addContent(string $varName, string $content, string $contentType) : RequestHelper_Boundaries |
| 118 | 118 | { |
| 119 | 119 | $content = ConvertHelper::string2utf8($content); |
@@ -127,13 +127,13 @@ discard block |
||
| 127 | 127 | return $this->addBoundary($boundary); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - /** |
|
| 131 | - * Adds a variable to be sent with the request. If it |
|
| 132 | - * already exists, its value is overwritten. |
|
| 133 | - * |
|
| 134 | - * @param string $name |
|
| 135 | - * @param string $value |
|
| 136 | - */ |
|
| 130 | + /** |
|
| 131 | + * Adds a variable to be sent with the request. If it |
|
| 132 | + * already exists, its value is overwritten. |
|
| 133 | + * |
|
| 134 | + * @param string $name |
|
| 135 | + * @param string $value |
|
| 136 | + */ |
|
| 137 | 137 | public function addVariable(string $name, string $value) : RequestHelper_Boundaries |
| 138 | 138 | { |
| 139 | 139 | $boundary = $this->createBoundary($value) |
@@ -149,11 +149,11 @@ discard block |
||
| 149 | 149 | return $this; |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - /** |
|
| 153 | - * Renders the response body with all mime boundaries. |
|
| 154 | - * |
|
| 155 | - * @return string |
|
| 156 | - */ |
|
| 152 | + /** |
|
| 153 | + * Renders the response body with all mime boundaries. |
|
| 154 | + * |
|
| 155 | + * @return string |
|
| 156 | + */ |
|
| 157 | 157 | public function render() : string |
| 158 | 158 | { |
| 159 | 159 | if(empty($this->boundaries)) |