@@ -25,34 +25,34 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | class ConvertHelper_StorageSizeEnum_Size |
| 27 | 27 | { |
| 28 | - /** |
|
| 29 | - * @var string |
|
| 30 | - */ |
|
| 28 | + /** |
|
| 29 | + * @var string |
|
| 30 | + */ |
|
| 31 | 31 | protected $name; |
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * @var int |
|
| 35 | - */ |
|
| 33 | + /** |
|
| 34 | + * @var int |
|
| 35 | + */ |
|
| 36 | 36 | protected $base; |
| 37 | 37 | |
| 38 | - /** |
|
| 39 | - * @var int |
|
| 40 | - */ |
|
| 38 | + /** |
|
| 39 | + * @var int |
|
| 40 | + */ |
|
| 41 | 41 | protected $exponent; |
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * @var string |
|
| 45 | - */ |
|
| 43 | + /** |
|
| 44 | + * @var string |
|
| 45 | + */ |
|
| 46 | 46 | protected $singular; |
| 47 | 47 | |
| 48 | - /** |
|
| 49 | - * @var string |
|
| 50 | - */ |
|
| 48 | + /** |
|
| 49 | + * @var string |
|
| 50 | + */ |
|
| 51 | 51 | protected $plural; |
| 52 | 52 | |
| 53 | - /** |
|
| 54 | - * @var string |
|
| 55 | - */ |
|
| 53 | + /** |
|
| 54 | + * @var string |
|
| 55 | + */ |
|
| 56 | 56 | protected $suffix; |
| 57 | 57 | |
| 58 | 58 | public function __construct(string $name, int $base, int $exponent, string $suffix, string $singular, string $plural) |
@@ -28,20 +28,20 @@ discard block |
||
| 28 | 28 | $this->parse(); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * Retrieves an indexed array with accept mime types |
|
| 33 | - * that the client sent, in the order of preference |
|
| 34 | - * the client specified. |
|
| 35 | - * |
|
| 36 | - * Example: |
|
| 37 | - * |
|
| 38 | - * array( |
|
| 39 | - * 'text/html', |
|
| 40 | - * 'application/xhtml+xml', |
|
| 41 | - * 'image/webp' |
|
| 42 | - * ... |
|
| 43 | - * ) |
|
| 44 | - */ |
|
| 31 | + /** |
|
| 32 | + * Retrieves an indexed array with accept mime types |
|
| 33 | + * that the client sent, in the order of preference |
|
| 34 | + * the client specified. |
|
| 35 | + * |
|
| 36 | + * Example: |
|
| 37 | + * |
|
| 38 | + * array( |
|
| 39 | + * 'text/html', |
|
| 40 | + * 'application/xhtml+xml', |
|
| 41 | + * 'image/webp' |
|
| 42 | + * ... |
|
| 43 | + * ) |
|
| 44 | + */ |
|
| 45 | 45 | public function getMimeStrings() : array |
| 46 | 46 | { |
| 47 | 47 | $result = array(); |
@@ -54,9 +54,9 @@ discard block |
||
| 54 | 54 | return $result; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * Checks that an accept header string exists, and tries to parse it. |
|
| 59 | - */ |
|
| 57 | + /** |
|
| 58 | + * Checks that an accept header string exists, and tries to parse it. |
|
| 59 | + */ |
|
| 60 | 60 | protected function parse() : void |
| 61 | 61 | { |
| 62 | 62 | // we may be in a CLI environment where the headers |
@@ -68,11 +68,11 @@ discard block |
||
| 68 | 68 | $this->headers = $this->parseHeader($_SERVER['HTTP_ACCEPT']); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - /** |
|
| 72 | - * Splits the accept header string and parses the mime types. |
|
| 73 | - * |
|
| 74 | - * @param string $acceptHeader |
|
| 75 | - */ |
|
| 71 | + /** |
|
| 72 | + * Splits the accept header string and parses the mime types. |
|
| 73 | + * |
|
| 74 | + * @param string $acceptHeader |
|
| 75 | + */ |
|
| 76 | 76 | protected function parseHeader(string $acceptHeader) : array |
| 77 | 77 | { |
| 78 | 78 | $tokens = preg_split('/\s*,\s*/', $acceptHeader); |
@@ -89,13 +89,13 @@ discard block |
||
| 89 | 89 | return $accept; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - /** |
|
| 93 | - * Parses a single mime type entry. |
|
| 94 | - * |
|
| 95 | - * @param int $i The position in the accept string |
|
| 96 | - * @param string $mime The mime type |
|
| 97 | - * @return array |
|
| 98 | - */ |
|
| 92 | + /** |
|
| 93 | + * Parses a single mime type entry. |
|
| 94 | + * |
|
| 95 | + * @param int $i The position in the accept string |
|
| 96 | + * @param string $mime The mime type |
|
| 97 | + * @return array |
|
| 98 | + */ |
|
| 99 | 99 | protected function parseEntry(int $i, string $mime) : array |
| 100 | 100 | { |
| 101 | 101 | $entry = array( |
@@ -125,14 +125,14 @@ discard block |
||
| 125 | 125 | return $entry; |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | - /** |
|
| 129 | - * Sorts the mime types collection, first by quality |
|
| 130 | - * and then by position in the list. |
|
| 131 | - * |
|
| 132 | - * @param array $a |
|
| 133 | - * @param array $b |
|
| 134 | - * @return number |
|
| 135 | - */ |
|
| 128 | + /** |
|
| 129 | + * Sorts the mime types collection, first by quality |
|
| 130 | + * and then by position in the list. |
|
| 131 | + * |
|
| 132 | + * @param array $a |
|
| 133 | + * @param array $b |
|
| 134 | + * @return number |
|
| 135 | + */ |
|
| 136 | 136 | protected function sortMimeTypes(array $a, array $b) |
| 137 | 137 | { |
| 138 | 138 | /* first tier: highest q factor wins */ |
@@ -22,9 +22,9 @@ |
||
| 22 | 22 | { |
| 23 | 23 | use Traits_Optionable; |
| 24 | 24 | |
| 25 | - /** |
|
| 26 | - * @var Request_Param |
|
| 27 | - */ |
|
| 25 | + /** |
|
| 26 | + * @var Request_Param |
|
| 27 | + */ |
|
| 28 | 28 | protected $param; |
| 29 | 29 | |
| 30 | 30 | protected $value; |
@@ -6,9 +6,9 @@ |
||
| 6 | 6 | |
| 7 | 7 | abstract class VariableInfo_Renderer_String extends VariableInfo_Renderer |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * @var mixed |
|
| 11 | - */ |
|
| 9 | + /** |
|
| 10 | + * @var mixed |
|
| 11 | + */ |
|
| 12 | 12 | protected $value; |
| 13 | 13 | |
| 14 | 14 | protected function init() |
@@ -6,19 +6,19 @@ discard block |
||
| 6 | 6 | |
| 7 | 7 | abstract class VariableInfo_Renderer |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * @var mixed |
|
| 11 | - */ |
|
| 9 | + /** |
|
| 10 | + * @var mixed |
|
| 11 | + */ |
|
| 12 | 12 | protected $value; |
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * @var VariableInfo |
|
| 16 | - */ |
|
| 14 | + /** |
|
| 15 | + * @var VariableInfo |
|
| 16 | + */ |
|
| 17 | 17 | protected $info; |
| 18 | 18 | |
| 19 | - /** |
|
| 20 | - * @var string |
|
| 21 | - */ |
|
| 19 | + /** |
|
| 20 | + * @var string |
|
| 21 | + */ |
|
| 22 | 22 | protected $type; |
| 23 | 23 | |
| 24 | 24 | public function __construct(VariableInfo $info) |
@@ -31,11 +31,11 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | abstract protected function init(); |
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * Renders the value to the target format. |
|
| 36 | - * |
|
| 37 | - * @return mixed |
|
| 38 | - */ |
|
| 34 | + /** |
|
| 35 | + * Renders the value to the target format. |
|
| 36 | + * |
|
| 37 | + * @return mixed |
|
| 38 | + */ |
|
| 39 | 39 | public function render() |
| 40 | 40 | { |
| 41 | 41 | return $this->_render(); |
@@ -21,25 +21,25 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | class XMLHelper_Converter_Decorator implements \JsonSerializable |
| 23 | 23 | { |
| 24 | - /** |
|
| 25 | - * @var \SimpleXMLElement |
|
| 26 | - */ |
|
| 24 | + /** |
|
| 25 | + * @var \SimpleXMLElement |
|
| 26 | + */ |
|
| 27 | 27 | private $subject; |
| 28 | 28 | |
| 29 | 29 | const DEF_DEPTH = 512; |
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * @var array |
|
| 33 | - */ |
|
| 31 | + /** |
|
| 32 | + * @var array |
|
| 33 | + */ |
|
| 34 | 34 | private $options = array( |
| 35 | 35 | '@attributes' => true, |
| 36 | 36 | '@text' => true, |
| 37 | 37 | 'depth' => self::DEF_DEPTH |
| 38 | 38 | ); |
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * @var array|string|null |
|
| 42 | - */ |
|
| 40 | + /** |
|
| 41 | + * @var array|string|null |
|
| 42 | + */ |
|
| 43 | 43 | protected $result = array(); |
| 44 | 44 | |
| 45 | 45 | public function __construct(\SimpleXMLElement $element) |
@@ -47,36 +47,36 @@ discard block |
||
| 47 | 47 | $this->subject = $element; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - /** |
|
| 51 | - * Whether to use the `@attributes` key to store element attributes. |
|
| 52 | - * |
|
| 53 | - * @param bool $bool |
|
| 54 | - * @return XMLHelper_Converter_Decorator |
|
| 55 | - */ |
|
| 50 | + /** |
|
| 51 | + * Whether to use the `@attributes` key to store element attributes. |
|
| 52 | + * |
|
| 53 | + * @param bool $bool |
|
| 54 | + * @return XMLHelper_Converter_Decorator |
|
| 55 | + */ |
|
| 56 | 56 | public function useAttributes(bool $bool) : XMLHelper_Converter_Decorator |
| 57 | 57 | { |
| 58 | 58 | $this->options['@attributes'] = (bool)$bool; |
| 59 | 59 | return $this; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - /** |
|
| 63 | - * Whether to use the `@text` key to store the node text. |
|
| 64 | - * |
|
| 65 | - * @param bool $bool |
|
| 66 | - * @return XMLHelper_Converter_Decorator |
|
| 67 | - */ |
|
| 62 | + /** |
|
| 63 | + * Whether to use the `@text` key to store the node text. |
|
| 64 | + * |
|
| 65 | + * @param bool $bool |
|
| 66 | + * @return XMLHelper_Converter_Decorator |
|
| 67 | + */ |
|
| 68 | 68 | public function useText(bool $bool) : XMLHelper_Converter_Decorator |
| 69 | 69 | { |
| 70 | 70 | $this->options['@text'] = (bool)$bool; |
| 71 | 71 | return $this; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - /** |
|
| 75 | - * Set the maximum depth to parse in the document. |
|
| 76 | - * |
|
| 77 | - * @param int $depth |
|
| 78 | - * @return XMLHelper_Converter_Decorator |
|
| 79 | - */ |
|
| 74 | + /** |
|
| 75 | + * Set the maximum depth to parse in the document. |
|
| 76 | + * |
|
| 77 | + * @param int $depth |
|
| 78 | + * @return XMLHelper_Converter_Decorator |
|
| 79 | + */ |
|
| 80 | 80 | public function setDepth(int $depth) : XMLHelper_Converter_Decorator |
| 81 | 81 | { |
| 82 | 82 | $this->options['depth'] = (int)max(0, $depth); |
@@ -23,44 +23,44 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | class Request_URLComparer |
| 25 | 25 | { |
| 26 | - /** |
|
| 27 | - * @var Request |
|
| 28 | - */ |
|
| 26 | + /** |
|
| 27 | + * @var Request |
|
| 28 | + */ |
|
| 29 | 29 | protected $request; |
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * @var string |
|
| 33 | - */ |
|
| 31 | + /** |
|
| 32 | + * @var string |
|
| 33 | + */ |
|
| 34 | 34 | protected $sourceURL; |
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * @var string |
|
| 38 | - */ |
|
| 36 | + /** |
|
| 37 | + * @var string |
|
| 38 | + */ |
|
| 39 | 39 | protected $targetURL; |
| 40 | 40 | |
| 41 | - /** |
|
| 42 | - * @var array |
|
| 43 | - */ |
|
| 41 | + /** |
|
| 42 | + * @var array |
|
| 43 | + */ |
|
| 44 | 44 | protected $limitParams = array(); |
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * @var bool |
|
| 48 | - */ |
|
| 46 | + /** |
|
| 47 | + * @var bool |
|
| 48 | + */ |
|
| 49 | 49 | protected $isMatch = false; |
| 50 | 50 | |
| 51 | - /** |
|
| 52 | - * @var bool |
|
| 53 | - */ |
|
| 51 | + /** |
|
| 52 | + * @var bool |
|
| 53 | + */ |
|
| 54 | 54 | protected $ignoreFragment = true; |
| 55 | 55 | |
| 56 | - /** |
|
| 57 | - * @var URLInfo |
|
| 58 | - */ |
|
| 56 | + /** |
|
| 57 | + * @var URLInfo |
|
| 58 | + */ |
|
| 59 | 59 | protected $sourceInfo; |
| 60 | 60 | |
| 61 | - /** |
|
| 62 | - * @var URLInfo |
|
| 63 | - */ |
|
| 61 | + /** |
|
| 62 | + * @var URLInfo |
|
| 63 | + */ |
|
| 64 | 64 | protected $targetInfo; |
| 65 | 65 | |
| 66 | 66 | public function __construct(Request $request, string $sourceURL, string $targetURL) |
@@ -32,23 +32,23 @@ |
||
| 32 | 32 | $this->info = $info; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * Enables the authentication information in the URL, |
|
| 37 | - * if a username and password are present. |
|
| 38 | - * |
|
| 39 | - * @param bool $enable Whether to turn it on or off. |
|
| 40 | - * @return URLInfo_Normalizer |
|
| 41 | - */ |
|
| 35 | + /** |
|
| 36 | + * Enables the authentication information in the URL, |
|
| 37 | + * if a username and password are present. |
|
| 38 | + * |
|
| 39 | + * @param bool $enable Whether to turn it on or off. |
|
| 40 | + * @return URLInfo_Normalizer |
|
| 41 | + */ |
|
| 42 | 42 | public function enableAuth(bool $enable=true) : URLInfo_Normalizer |
| 43 | 43 | { |
| 44 | 44 | $this->auth = $enable; |
| 45 | 45 | return $this; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - /** |
|
| 49 | - * Retrieves the normalized URL. |
|
| 50 | - * @return string |
|
| 51 | - */ |
|
| 48 | + /** |
|
| 49 | + * Retrieves the normalized URL. |
|
| 50 | + * @return string |
|
| 51 | + */ |
|
| 52 | 52 | public function normalize() : string |
| 53 | 53 | { |
| 54 | 54 | $method = 'normalize_'.$this->info->getType(); |
@@ -27,14 +27,14 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | protected $param; |
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * @var mixed |
|
| 32 | - */ |
|
| 30 | + /** |
|
| 31 | + * @var mixed |
|
| 32 | + */ |
|
| 33 | 33 | protected $value; |
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * @var bool |
|
| 37 | - */ |
|
| 35 | + /** |
|
| 36 | + * @var bool |
|
| 37 | + */ |
|
| 38 | 38 | protected $isSubvalue = false; |
| 39 | 39 | |
| 40 | 40 | public function __construct(Request_Param $param, bool $subval) |