@@ -34,41 +34,41 @@ discard block |
||
34 | 34 | return new XMLHelper($dom); |
35 | 35 | } |
36 | 36 | |
37 | - /** |
|
38 | - * Creates a converter instance from an XML file. |
|
39 | - * @param string $xmlFile |
|
40 | - * @return \AppUtils\XMLHelper_Converter |
|
41 | - */ |
|
37 | + /** |
|
38 | + * Creates a converter instance from an XML file. |
|
39 | + * @param string $xmlFile |
|
40 | + * @return \AppUtils\XMLHelper_Converter |
|
41 | + */ |
|
42 | 42 | public static function convertFile(string $xmlFile) |
43 | 43 | { |
44 | 44 | return XMLHelper_Converter::fromFile($xmlFile); |
45 | 45 | } |
46 | 46 | |
47 | - /** |
|
48 | - * Creates a converter from an XML string. |
|
49 | - * @param string $xmlString |
|
50 | - * @return \AppUtils\XMLHelper_Converter |
|
51 | - */ |
|
47 | + /** |
|
48 | + * Creates a converter from an XML string. |
|
49 | + * @param string $xmlString |
|
50 | + * @return \AppUtils\XMLHelper_Converter |
|
51 | + */ |
|
52 | 52 | public static function convertString(string $xmlString) |
53 | 53 | { |
54 | 54 | return XMLHelper_Converter::fromString($xmlString); |
55 | 55 | } |
56 | 56 | |
57 | - /** |
|
58 | - * Creates a converter from a SimpleXMLElement instance. |
|
59 | - * @param \SimpleXMLElement $element |
|
60 | - * @return \AppUtils\XMLHelper_Converter |
|
61 | - */ |
|
57 | + /** |
|
58 | + * Creates a converter from a SimpleXMLElement instance. |
|
59 | + * @param \SimpleXMLElement $element |
|
60 | + * @return \AppUtils\XMLHelper_Converter |
|
61 | + */ |
|
62 | 62 | public static function convertElement(\SimpleXMLElement $element) |
63 | 63 | { |
64 | 64 | return XMLHelper_Converter::fromElement($element); |
65 | 65 | } |
66 | 66 | |
67 | - /** |
|
68 | - * Creates a converter from a DOMElement instance. |
|
69 | - * @param \DOMElement $element |
|
70 | - * @return \AppUtils\XMLHelper_Converter |
|
71 | - */ |
|
67 | + /** |
|
68 | + * Creates a converter from a DOMElement instance. |
|
69 | + * @param \DOMElement $element |
|
70 | + * @return \AppUtils\XMLHelper_Converter |
|
71 | + */ |
|
72 | 72 | public static function convertDOMElement(\DOMElement $element) |
73 | 73 | { |
74 | 74 | return XMLHelper_Converter::fromDOMElement($element); |
@@ -436,31 +436,31 @@ discard block |
||
436 | 436 | return $this->dom->saveXML(); |
437 | 437 | } |
438 | 438 | |
439 | - /** |
|
440 | - * Creates a new SimpleXML helper instance: this |
|
441 | - * object is useful to work with loading XML strings |
|
442 | - * and files with easy access to any errors that |
|
443 | - * may occurr, since the simplexml functions can be |
|
444 | - * somewhat cryptic. |
|
445 | - * |
|
446 | - * @return XMLHelper_SimpleXML |
|
447 | - */ |
|
439 | + /** |
|
440 | + * Creates a new SimpleXML helper instance: this |
|
441 | + * object is useful to work with loading XML strings |
|
442 | + * and files with easy access to any errors that |
|
443 | + * may occurr, since the simplexml functions can be |
|
444 | + * somewhat cryptic. |
|
445 | + * |
|
446 | + * @return XMLHelper_SimpleXML |
|
447 | + */ |
|
448 | 448 | public static function createSimplexml() |
449 | 449 | { |
450 | 450 | return new XMLHelper_SimpleXML(); |
451 | 451 | } |
452 | 452 | |
453 | - /** |
|
454 | - * Converts a string to valid XML: can be a text only string |
|
455 | - * or an HTML string. Returns valid XML code. |
|
456 | - * |
|
457 | - * NOTE: The string may contain custom tags, which are |
|
458 | - * preserved. |
|
459 | - * |
|
460 | - * @param string $string |
|
461 | - * @throws XMLHelper_Exception |
|
462 | - * @return string |
|
463 | - */ |
|
453 | + /** |
|
454 | + * Converts a string to valid XML: can be a text only string |
|
455 | + * or an HTML string. Returns valid XML code. |
|
456 | + * |
|
457 | + * NOTE: The string may contain custom tags, which are |
|
458 | + * preserved. |
|
459 | + * |
|
460 | + * @param string $string |
|
461 | + * @throws XMLHelper_Exception |
|
462 | + * @return string |
|
463 | + */ |
|
464 | 464 | public static function string2xml(string $string) : string |
465 | 465 | { |
466 | 466 | if(stristr($string, '<body')) |
@@ -26,48 +26,48 @@ discard block |
||
26 | 26 | */ |
27 | 27 | class JSHelper |
28 | 28 | { |
29 | - /** |
|
30 | - * Quote style using single quotes. |
|
31 | - * @var integer |
|
32 | - */ |
|
29 | + /** |
|
30 | + * Quote style using single quotes. |
|
31 | + * @var integer |
|
32 | + */ |
|
33 | 33 | const QUOTE_STYLE_SINGLE = 1; |
34 | 34 | |
35 | - /** |
|
36 | - * Quote style using double quotes. |
|
37 | - * @var integer |
|
38 | - */ |
|
35 | + /** |
|
36 | + * Quote style using double quotes. |
|
37 | + * @var integer |
|
38 | + */ |
|
39 | 39 | const QUOTE_STYLE_DOUBLE = 2; |
40 | 40 | |
41 | - /** |
|
42 | - * @var array |
|
43 | - */ |
|
41 | + /** |
|
42 | + * @var array |
|
43 | + */ |
|
44 | 44 | protected static $variableCache = array(); |
45 | 45 | |
46 | - /** |
|
47 | - * @var integer |
|
48 | - */ |
|
46 | + /** |
|
47 | + * @var integer |
|
48 | + */ |
|
49 | 49 | protected static $elementCounter = 0; |
50 | 50 | |
51 | - /** |
|
52 | - * @var string |
|
53 | - */ |
|
51 | + /** |
|
52 | + * @var string |
|
53 | + */ |
|
54 | 54 | protected static $idPrefix = 'E'; |
55 | 55 | |
56 | - /** |
|
57 | - * Builds a javascript statement. The first parameter is the |
|
58 | - * javascript function to call, any additional parameters are |
|
59 | - * used as arguments for the javascript function call. Variable |
|
60 | - * types are automagically converted to the javascript equivalents. |
|
61 | - * |
|
62 | - * Examples: |
|
63 | - * |
|
64 | - * // add an alert(); statement: |
|
65 | - * JSHelper::buildStatement('alert'); |
|
66 | - * |
|
67 | - * // add an alert('Alert text'); statement |
|
68 | - * JSHelper::buildStatement('alert', 'Alert text'); |
|
69 | - * |
|
70 | - */ |
|
56 | + /** |
|
57 | + * Builds a javascript statement. The first parameter is the |
|
58 | + * javascript function to call, any additional parameters are |
|
59 | + * used as arguments for the javascript function call. Variable |
|
60 | + * types are automagically converted to the javascript equivalents. |
|
61 | + * |
|
62 | + * Examples: |
|
63 | + * |
|
64 | + * // add an alert(); statement: |
|
65 | + * JSHelper::buildStatement('alert'); |
|
66 | + * |
|
67 | + * // add an alert('Alert text'); statement |
|
68 | + * JSHelper::buildStatement('alert', 'Alert text'); |
|
69 | + * |
|
70 | + */ |
|
71 | 71 | public static function buildStatement() : string |
72 | 72 | { |
73 | 73 | $args = func_get_args(); |
@@ -75,13 +75,13 @@ discard block |
||
75 | 75 | return call_user_func_array(array(self::class, 'buildStatementQuoteStyle'), $args); |
76 | 76 | } |
77 | 77 | |
78 | - /** |
|
79 | - * Like {@link JSHelper::buildStatement()}, but using single quotes |
|
80 | - * to make it possible to use the statement in an HTML tag attribute. |
|
81 | - * |
|
82 | - * @return string |
|
83 | - * @see JSHelper::buildStatement() |
|
84 | - */ |
|
78 | + /** |
|
79 | + * Like {@link JSHelper::buildStatement()}, but using single quotes |
|
80 | + * to make it possible to use the statement in an HTML tag attribute. |
|
81 | + * |
|
82 | + * @return string |
|
83 | + * @see JSHelper::buildStatement() |
|
84 | + */ |
|
85 | 85 | public static function buildStatementAttribute() : string |
86 | 86 | { |
87 | 87 | $args = func_get_args(); |
@@ -111,39 +111,39 @@ discard block |
||
111 | 111 | return $call . ');'; |
112 | 112 | } |
113 | 113 | |
114 | - /** |
|
115 | - * Builds a set variable statement. The variable value is |
|
116 | - * automatically converted to the javascript equivalent. |
|
117 | - * |
|
118 | - * Examples: |
|
119 | - * |
|
120 | - * // foo = 'bar'; |
|
121 | - * JSHelper::buildVariable('foo', 'bar'); |
|
122 | - * |
|
123 | - * // foo = 42; |
|
124 | - * JSHelper::buildVariable('foo', 42); |
|
125 | - * |
|
126 | - * // foo = true; |
|
127 | - * JSHelper::buildVariable('foo', true); |
|
128 | - * |
|
129 | - * @param string $varName |
|
130 | - * @param mixed $varValue |
|
131 | - * @return string |
|
132 | - */ |
|
114 | + /** |
|
115 | + * Builds a set variable statement. The variable value is |
|
116 | + * automatically converted to the javascript equivalent. |
|
117 | + * |
|
118 | + * Examples: |
|
119 | + * |
|
120 | + * // foo = 'bar'; |
|
121 | + * JSHelper::buildVariable('foo', 'bar'); |
|
122 | + * |
|
123 | + * // foo = 42; |
|
124 | + * JSHelper::buildVariable('foo', 42); |
|
125 | + * |
|
126 | + * // foo = true; |
|
127 | + * JSHelper::buildVariable('foo', true); |
|
128 | + * |
|
129 | + * @param string $varName |
|
130 | + * @param mixed $varValue |
|
131 | + * @return string |
|
132 | + */ |
|
133 | 133 | public static function buildVariable(string $varName, $varValue) : string |
134 | 134 | { |
135 | 135 | return $varName . "=" . self::phpVariable2JS($varValue) . ';'; |
136 | 136 | } |
137 | 137 | |
138 | - /** |
|
139 | - * Converts a PHP variable to its javascript equivalent. Note that |
|
140 | - * if a variable cannot be converted (like a PHP resource), this will |
|
141 | - * return a javascript "null". |
|
142 | - * |
|
143 | - * @param mixed $variable |
|
144 | - * @param int $quoteStyle The quote style to use for strings |
|
145 | - * @return string |
|
146 | - */ |
|
138 | + /** |
|
139 | + * Converts a PHP variable to its javascript equivalent. Note that |
|
140 | + * if a variable cannot be converted (like a PHP resource), this will |
|
141 | + * return a javascript "null". |
|
142 | + * |
|
143 | + * @param mixed $variable |
|
144 | + * @param int $quoteStyle The quote style to use for strings |
|
145 | + * @return string |
|
146 | + */ |
|
147 | 147 | public static function phpVariable2JS($variable, int $quoteStyle=self::QUOTE_STYLE_DOUBLE) : string |
148 | 148 | { |
149 | 149 | // after much profiling, this variant of the method offers |
@@ -221,26 +221,26 @@ discard block |
||
221 | 221 | return $result; |
222 | 222 | } |
223 | 223 | |
224 | - /** |
|
225 | - * Converts a variable to a JS string that can be |
|
226 | - * used in an HTML attribute: it uses single quotes |
|
227 | - * instead of the default double quotes. |
|
228 | - * |
|
229 | - * @param mixed $variable |
|
230 | - * @return string |
|
231 | - */ |
|
224 | + /** |
|
225 | + * Converts a variable to a JS string that can be |
|
226 | + * used in an HTML attribute: it uses single quotes |
|
227 | + * instead of the default double quotes. |
|
228 | + * |
|
229 | + * @param mixed $variable |
|
230 | + * @return string |
|
231 | + */ |
|
232 | 232 | public static function phpVariable2AttributeJS($variable) : string |
233 | 233 | { |
234 | 234 | return self::phpVariable2JS($variable, self::QUOTE_STYLE_SINGLE); |
235 | 235 | } |
236 | 236 | |
237 | - /** |
|
238 | - * Generates a dynamic element ID to be used with dynamically generated |
|
239 | - * HTML code to tie in with clientside javascript when compact but unique |
|
240 | - * IDs are needed in a request. |
|
241 | - * |
|
242 | - * @return string |
|
243 | - */ |
|
237 | + /** |
|
238 | + * Generates a dynamic element ID to be used with dynamically generated |
|
239 | + * HTML code to tie in with clientside javascript when compact but unique |
|
240 | + * IDs are needed in a request. |
|
241 | + * |
|
242 | + * @return string |
|
243 | + */ |
|
244 | 244 | public static function nextElementID() : string |
245 | 245 | { |
246 | 246 | self::$elementCounter++; |
@@ -248,33 +248,33 @@ discard block |
||
248 | 248 | return self::$idPrefix . self::$elementCounter; |
249 | 249 | } |
250 | 250 | |
251 | - /** |
|
252 | - * Retrieves the ID prefix currently used. |
|
253 | - * |
|
254 | - * @return string |
|
255 | - */ |
|
251 | + /** |
|
252 | + * Retrieves the ID prefix currently used. |
|
253 | + * |
|
254 | + * @return string |
|
255 | + */ |
|
256 | 256 | public static function getIDPrefix() : string |
257 | 257 | { |
258 | 258 | return self::$idPrefix; |
259 | 259 | } |
260 | 260 | |
261 | - /** |
|
262 | - * Retrieves the value of the internal elements counter. |
|
263 | - * |
|
264 | - * @return integer |
|
265 | - */ |
|
261 | + /** |
|
262 | + * Retrieves the value of the internal elements counter. |
|
263 | + * |
|
264 | + * @return integer |
|
265 | + */ |
|
266 | 266 | public static function getElementCounter() : int |
267 | 267 | { |
268 | 268 | return self::$elementCounter; |
269 | 269 | } |
270 | 270 | |
271 | - /** |
|
272 | - * Sets the prefix that is added in front of all IDs |
|
273 | - * retrieved using the {@link nextElementID()} method. |
|
274 | - * |
|
275 | - * @param string $prefix |
|
276 | - * @see JSHelper::nextElementID() |
|
277 | - */ |
|
271 | + /** |
|
272 | + * Sets the prefix that is added in front of all IDs |
|
273 | + * retrieved using the {@link nextElementID()} method. |
|
274 | + * |
|
275 | + * @param string $prefix |
|
276 | + * @see JSHelper::nextElementID() |
|
277 | + */ |
|
278 | 278 | public static function setIDPrefix(string $prefix) |
279 | 279 | { |
280 | 280 | self::$idPrefix = $prefix; |
@@ -24,56 +24,56 @@ discard block |
||
24 | 24 | */ |
25 | 25 | class PaginationHelper |
26 | 26 | { |
27 | - /** |
|
28 | - * @var int |
|
29 | - */ |
|
27 | + /** |
|
28 | + * @var int |
|
29 | + */ |
|
30 | 30 | protected $total; |
31 | 31 | |
32 | - /** |
|
33 | - * @var int |
|
34 | - */ |
|
32 | + /** |
|
33 | + * @var int |
|
34 | + */ |
|
35 | 35 | protected $perPage; |
36 | 36 | |
37 | - /** |
|
38 | - * @var int |
|
39 | - */ |
|
37 | + /** |
|
38 | + * @var int |
|
39 | + */ |
|
40 | 40 | protected $current; |
41 | 41 | |
42 | - /** |
|
43 | - * @var int |
|
44 | - */ |
|
42 | + /** |
|
43 | + * @var int |
|
44 | + */ |
|
45 | 45 | protected $next = 0; |
46 | 46 | |
47 | - /** |
|
48 | - * @var int |
|
49 | - */ |
|
47 | + /** |
|
48 | + * @var int |
|
49 | + */ |
|
50 | 50 | protected $prev = 0; |
51 | 51 | |
52 | - /** |
|
53 | - * @var int |
|
54 | - */ |
|
52 | + /** |
|
53 | + * @var int |
|
54 | + */ |
|
55 | 55 | protected $last = 0; |
56 | 56 | |
57 | - /** |
|
58 | - * @var int |
|
59 | - */ |
|
57 | + /** |
|
58 | + * @var int |
|
59 | + */ |
|
60 | 60 | protected $adjacentPages = 3; |
61 | 61 | |
62 | - /** |
|
63 | - * @var int |
|
64 | - */ |
|
62 | + /** |
|
63 | + * @var int |
|
64 | + */ |
|
65 | 65 | protected $offsetEnd = 0; |
66 | 66 | |
67 | - /** |
|
68 | - * @var int |
|
69 | - */ |
|
67 | + /** |
|
68 | + * @var int |
|
69 | + */ |
|
70 | 70 | protected $offsetStart = 0; |
71 | 71 | |
72 | - /** |
|
73 | - * @param int $totalItems The total amount of items available. |
|
74 | - * @param int $itemsPerPage How many items to display per page. |
|
75 | - * @param int $currentPage The current page number (1-based) |
|
76 | - */ |
|
72 | + /** |
|
73 | + * @param int $totalItems The total amount of items available. |
|
74 | + * @param int $itemsPerPage How many items to display per page. |
|
75 | + * @param int $currentPage The current page number (1-based) |
|
76 | + */ |
|
77 | 77 | public function __construct(int $totalItems, int $itemsPerPage, int $currentPage) |
78 | 78 | { |
79 | 79 | $this->total = $totalItems; |
@@ -83,34 +83,34 @@ discard block |
||
83 | 83 | $this->calculate(); |
84 | 84 | } |
85 | 85 | |
86 | - /** |
|
87 | - * Sets the amount of adjacent pages to display next to the |
|
88 | - * current one when using the pages list. |
|
89 | - * |
|
90 | - * @param int $amount |
|
91 | - * @return PaginationHelper |
|
92 | - */ |
|
86 | + /** |
|
87 | + * Sets the amount of adjacent pages to display next to the |
|
88 | + * current one when using the pages list. |
|
89 | + * |
|
90 | + * @param int $amount |
|
91 | + * @return PaginationHelper |
|
92 | + */ |
|
93 | 93 | public function setAdjacentPages(int $amount) : PaginationHelper |
94 | 94 | { |
95 | 95 | $this->adjacentPages = $amount; |
96 | 96 | return $this; |
97 | 97 | } |
98 | 98 | |
99 | - /** |
|
100 | - * Whether there is a next page after the current page. |
|
101 | - * @return bool |
|
102 | - */ |
|
99 | + /** |
|
100 | + * Whether there is a next page after the current page. |
|
101 | + * @return bool |
|
102 | + */ |
|
103 | 103 | public function hasNextPage() : bool |
104 | 104 | { |
105 | 105 | return $this->next > 0; |
106 | 106 | } |
107 | 107 | |
108 | - /** |
|
109 | - * The next page number. Returns the last page |
|
110 | - * number if there is no next page. |
|
111 | - * |
|
112 | - * @return int |
|
113 | - */ |
|
108 | + /** |
|
109 | + * The next page number. Returns the last page |
|
110 | + * number if there is no next page. |
|
111 | + * |
|
112 | + * @return int |
|
113 | + */ |
|
114 | 114 | public function getNextPage() : int |
115 | 115 | { |
116 | 116 | if($this->next === 0) { |
@@ -120,21 +120,21 @@ discard block |
||
120 | 120 | return $this->next; |
121 | 121 | } |
122 | 122 | |
123 | - /** |
|
124 | - * Whether there is a previous page before the current page. |
|
125 | - * @return bool |
|
126 | - */ |
|
123 | + /** |
|
124 | + * Whether there is a previous page before the current page. |
|
125 | + * @return bool |
|
126 | + */ |
|
127 | 127 | public function hasPreviousPage() : bool |
128 | 128 | { |
129 | 129 | return $this->prev > 0; |
130 | 130 | } |
131 | 131 | |
132 | - /** |
|
133 | - * The previous page number. Returns the first page |
|
134 | - * number if there is no previous page. |
|
135 | - * |
|
136 | - * @return int |
|
137 | - */ |
|
132 | + /** |
|
133 | + * The previous page number. Returns the first page |
|
134 | + * number if there is no previous page. |
|
135 | + * |
|
136 | + * @return int |
|
137 | + */ |
|
138 | 138 | public function getPreviousPage() : int |
139 | 139 | { |
140 | 140 | if($this->prev === 0) { |
@@ -144,21 +144,21 @@ discard block |
||
144 | 144 | return $this->prev; |
145 | 145 | } |
146 | 146 | |
147 | - /** |
|
148 | - * Retrieves the last page number. |
|
149 | - * @return int |
|
150 | - */ |
|
147 | + /** |
|
148 | + * Retrieves the last page number. |
|
149 | + * @return int |
|
150 | + */ |
|
151 | 151 | public function getLastPage() : int |
152 | 152 | { |
153 | 153 | return $this->last; |
154 | 154 | } |
155 | 155 | |
156 | - /** |
|
157 | - * Whether there is more than one page, i.e. whether |
|
158 | - * pagination is required at all. |
|
159 | - * |
|
160 | - * @return bool |
|
161 | - */ |
|
156 | + /** |
|
157 | + * Whether there is more than one page, i.e. whether |
|
158 | + * pagination is required at all. |
|
159 | + * |
|
160 | + * @return bool |
|
161 | + */ |
|
162 | 162 | public function hasPages() : bool |
163 | 163 | { |
164 | 164 | return $this->last > 1; |
@@ -169,12 +169,12 @@ discard block |
||
169 | 169 | return $this->current; |
170 | 170 | } |
171 | 171 | |
172 | - /** |
|
173 | - * Retrieves a list of page numbers for a page |
|
174 | - * navigator, to quickly jump between pages. |
|
175 | - * |
|
176 | - * @return int[] |
|
177 | - */ |
|
172 | + /** |
|
173 | + * Retrieves a list of page numbers for a page |
|
174 | + * navigator, to quickly jump between pages. |
|
175 | + * |
|
176 | + * @return int[] |
|
177 | + */ |
|
178 | 178 | public function getPageNumbers() : array |
179 | 179 | { |
180 | 180 | $adjacent = $this->adjacentPages; |
@@ -250,66 +250,66 @@ discard block |
||
250 | 250 | return $numbers; |
251 | 251 | } |
252 | 252 | |
253 | - /** |
|
254 | - * Whether the specified page number is the current page. |
|
255 | - * |
|
256 | - * @param int $pageNumber |
|
257 | - * @return bool |
|
258 | - */ |
|
253 | + /** |
|
254 | + * Whether the specified page number is the current page. |
|
255 | + * |
|
256 | + * @param int $pageNumber |
|
257 | + * @return bool |
|
258 | + */ |
|
259 | 259 | public function isCurrentPage(int $pageNumber) : bool |
260 | 260 | { |
261 | 261 | return $pageNumber === $this->current; |
262 | 262 | } |
263 | 263 | |
264 | - /** |
|
265 | - * Retrieves the 1-based starting offset of |
|
266 | - * items currently displayed in the page. |
|
267 | - * |
|
268 | - * Note: Use this to create a text like |
|
269 | - * "showing entries x to y". |
|
270 | - * |
|
271 | - * @return int |
|
272 | - * @see PaginationHelper::getOffsetEnd() |
|
273 | - */ |
|
264 | + /** |
|
265 | + * Retrieves the 1-based starting offset of |
|
266 | + * items currently displayed in the page. |
|
267 | + * |
|
268 | + * Note: Use this to create a text like |
|
269 | + * "showing entries x to y". |
|
270 | + * |
|
271 | + * @return int |
|
272 | + * @see PaginationHelper::getOffsetEnd() |
|
273 | + */ |
|
274 | 274 | public function getItemsStart() : int |
275 | 275 | { |
276 | 276 | return $this->getOffsetStart() + 1; |
277 | 277 | } |
278 | 278 | |
279 | - /** |
|
280 | - * Retrieves the 1-based ending offset of |
|
281 | - * items currently displayed in the page. |
|
282 | - * |
|
283 | - * Note: Use this to create a text like |
|
284 | - * "showing entries x to y". |
|
285 | - * |
|
286 | - * @return int |
|
287 | - * @see PaginationHelper::getOffsetStart() |
|
288 | - */ |
|
279 | + /** |
|
280 | + * Retrieves the 1-based ending offset of |
|
281 | + * items currently displayed in the page. |
|
282 | + * |
|
283 | + * Note: Use this to create a text like |
|
284 | + * "showing entries x to y". |
|
285 | + * |
|
286 | + * @return int |
|
287 | + * @see PaginationHelper::getOffsetStart() |
|
288 | + */ |
|
289 | 289 | public function getItemsEnd() : int |
290 | 290 | { |
291 | 291 | return $this->getOffsetEnd() + 1; |
292 | 292 | } |
293 | 293 | |
294 | - /** |
|
295 | - * Retrieves the 0-based starting offset of |
|
296 | - * items currently displayed in the page. |
|
297 | - * |
|
298 | - * @return int |
|
299 | - * @see PaginationHelper::getItemsStart() |
|
300 | - */ |
|
294 | + /** |
|
295 | + * Retrieves the 0-based starting offset of |
|
296 | + * items currently displayed in the page. |
|
297 | + * |
|
298 | + * @return int |
|
299 | + * @see PaginationHelper::getItemsStart() |
|
300 | + */ |
|
301 | 301 | public function getOffsetStart() : int |
302 | 302 | { |
303 | 303 | return $this->offsetStart; |
304 | 304 | } |
305 | 305 | |
306 | - /** |
|
307 | - * Retrieves the 0-based ending offset of |
|
308 | - * items currently displayed in the page. |
|
309 | - * |
|
310 | - * @return int |
|
311 | - * @see PaginationHelper::getItemsEnd() |
|
312 | - */ |
|
306 | + /** |
|
307 | + * Retrieves the 0-based ending offset of |
|
308 | + * items currently displayed in the page. |
|
309 | + * |
|
310 | + * @return int |
|
311 | + * @see PaginationHelper::getItemsEnd() |
|
312 | + */ |
|
313 | 313 | public function getOffsetEnd() : int |
314 | 314 | { |
315 | 315 | return $this->offsetEnd; |
@@ -76,10 +76,10 @@ discard block |
||
76 | 76 | return $this instanceof SVNHelper_Target_Folder; |
77 | 77 | } |
78 | 78 | |
79 | - /** |
|
80 | - * Runs an update of the file or folder. |
|
81 | - * @return SVNHelper_Command_Update |
|
82 | - */ |
|
79 | + /** |
|
80 | + * Runs an update of the file or folder. |
|
81 | + * @return SVNHelper_Command_Update |
|
82 | + */ |
|
83 | 83 | public function runUpdate() |
84 | 84 | { |
85 | 85 | $cmd = $this->createUpdate(); |
@@ -88,55 +88,55 @@ discard block |
||
88 | 88 | return $cmd; |
89 | 89 | } |
90 | 90 | |
91 | - /** |
|
92 | - * Creates an update command instance for the target file or folder. |
|
93 | - * @return SVNHelper_Command_Update |
|
94 | - */ |
|
91 | + /** |
|
92 | + * Creates an update command instance for the target file or folder. |
|
93 | + * @return SVNHelper_Command_Update |
|
94 | + */ |
|
95 | 95 | public function createUpdate() |
96 | 96 | { |
97 | 97 | return $this->helper->createUpdate($this); |
98 | 98 | } |
99 | 99 | |
100 | - /** |
|
101 | - * Creates a status command instance for the target file or folder. |
|
102 | - * @return SVNHelper_Command_Status |
|
103 | - */ |
|
100 | + /** |
|
101 | + * Creates a status command instance for the target file or folder. |
|
102 | + * @return SVNHelper_Command_Status |
|
103 | + */ |
|
104 | 104 | public function createStatus() |
105 | 105 | { |
106 | 106 | return $this->helper->createStatus($this); |
107 | 107 | } |
108 | 108 | |
109 | - /** |
|
110 | - * Creates an info command instance for the target file or folder. |
|
111 | - * @return SVNHelper_Command_Info |
|
112 | - */ |
|
109 | + /** |
|
110 | + * Creates an info command instance for the target file or folder. |
|
111 | + * @return SVNHelper_Command_Info |
|
112 | + */ |
|
113 | 113 | public function createInfo() |
114 | 114 | { |
115 | 115 | return $this->helper->createInfo($this); |
116 | 116 | } |
117 | 117 | |
118 | - /** |
|
119 | - * Creates a commit command instance for the target file or folder. |
|
120 | - * @param string $message |
|
121 | - * @return SVNHelper_Command_Commit |
|
122 | - */ |
|
118 | + /** |
|
119 | + * Creates a commit command instance for the target file or folder. |
|
120 | + * @param string $message |
|
121 | + * @return SVNHelper_Command_Commit |
|
122 | + */ |
|
123 | 123 | public function createCommit($message) |
124 | 124 | { |
125 | 125 | return $this->helper->createCommit($this, $message); |
126 | 126 | } |
127 | 127 | |
128 | - /** |
|
129 | - * Creates an add command instance for the target file or folder. |
|
130 | - * @return SVNHelper_Command_Add |
|
131 | - */ |
|
128 | + /** |
|
129 | + * Creates an add command instance for the target file or folder. |
|
130 | + * @return SVNHelper_Command_Add |
|
131 | + */ |
|
132 | 132 | public function createAdd() |
133 | 133 | { |
134 | 134 | return $this->helper->createAdd($this); |
135 | 135 | } |
136 | 136 | |
137 | - /** |
|
138 | - * @return SVNHelper_Command_Status |
|
139 | - */ |
|
137 | + /** |
|
138 | + * @return SVNHelper_Command_Status |
|
139 | + */ |
|
140 | 140 | public function getStatus() |
141 | 141 | { |
142 | 142 | $cmd = $this->createStatus(); |
@@ -154,10 +154,10 @@ discard block |
||
154 | 154 | return $this; |
155 | 155 | } |
156 | 156 | |
157 | - /** |
|
158 | - * Whether the target is versioned or needs to be added. |
|
159 | - * @return boolean |
|
160 | - */ |
|
157 | + /** |
|
158 | + * Whether the target is versioned or needs to be added. |
|
159 | + * @return boolean |
|
160 | + */ |
|
161 | 161 | public function isVersioned() |
162 | 162 | { |
163 | 163 | return $this->getInfo()->isVersioned(); |
@@ -170,10 +170,10 @@ discard block |
||
170 | 170 | $this->cache = array(); |
171 | 171 | } |
172 | 172 | |
173 | - /** |
|
174 | - * Retrieves information on the target. |
|
175 | - * @return SVNHelper_Command_Info |
|
176 | - */ |
|
173 | + /** |
|
174 | + * Retrieves information on the target. |
|
175 | + * @return SVNHelper_Command_Info |
|
176 | + */ |
|
177 | 177 | public function getInfo() |
178 | 178 | { |
179 | 179 | if(!isset($this->cache['info'])) { |
@@ -183,15 +183,15 @@ discard block |
||
183 | 183 | return $this->cache['info']; |
184 | 184 | } |
185 | 185 | |
186 | - /** |
|
187 | - * Commits the target file or folder. If it has |
|
188 | - * not been added to the repository yet, it is |
|
189 | - * added automatically beforehand. If it does |
|
190 | - * not need to be committed, no changes are made. |
|
191 | - * |
|
192 | - * @param string $message |
|
193 | - * @return SVNHelper_Target |
|
194 | - */ |
|
186 | + /** |
|
187 | + * Commits the target file or folder. If it has |
|
188 | + * not been added to the repository yet, it is |
|
189 | + * added automatically beforehand. If it does |
|
190 | + * not need to be committed, no changes are made. |
|
191 | + * |
|
192 | + * @param string $message |
|
193 | + * @return SVNHelper_Target |
|
194 | + */ |
|
195 | 195 | public function runCommit($message) |
196 | 196 | { |
197 | 197 | if(!$this->isVersioned()) { |
@@ -21,18 +21,18 @@ discard block |
||
21 | 21 | const SVN_ERROR_TYPE_WARNING = 'warning'; |
22 | 22 | |
23 | 23 | /** |
24 | - * @var SVNHelper |
|
25 | - */ |
|
24 | + * @var SVNHelper |
|
25 | + */ |
|
26 | 26 | protected $helper; |
27 | 27 | |
28 | - /** |
|
29 | - * @var SVNHelper_Target |
|
30 | - */ |
|
28 | + /** |
|
29 | + * @var SVNHelper_Target |
|
30 | + */ |
|
31 | 31 | protected $target; |
32 | 32 | |
33 | - /** |
|
34 | - * @var SVNHelper_CommandResult |
|
35 | - */ |
|
33 | + /** |
|
34 | + * @var SVNHelper_CommandResult |
|
35 | + */ |
|
36 | 36 | protected $result; |
37 | 37 | |
38 | 38 | public function __construct(SVNHelper $helper, SVNHelper_Target $target) |
@@ -41,9 +41,9 @@ discard block |
||
41 | 41 | $this->target = $target; |
42 | 42 | } |
43 | 43 | |
44 | - /** |
|
45 | - * @return SVNHelper |
|
46 | - */ |
|
44 | + /** |
|
45 | + * @return SVNHelper |
|
46 | + */ |
|
47 | 47 | public function getSVN() |
48 | 48 | { |
49 | 49 | return $this->helper; |
@@ -99,15 +99,15 @@ discard block |
||
99 | 99 | return $cmd; |
100 | 100 | } |
101 | 101 | |
102 | - /** |
|
103 | - * Executes the specified command, and returns a result |
|
104 | - * instance to read the results. |
|
105 | - * |
|
106 | - * @param string $mode The command mode, e.g. commit / update... |
|
107 | - * @param string $path The path to apply the command to |
|
108 | - * @param array $params |
|
109 | - * @return SVNHelper_CommandResult |
|
110 | - */ |
|
102 | + /** |
|
103 | + * Executes the specified command, and returns a result |
|
104 | + * instance to read the results. |
|
105 | + * |
|
106 | + * @param string $mode The command mode, e.g. commit / update... |
|
107 | + * @param string $path The path to apply the command to |
|
108 | + * @param array $params |
|
109 | + * @return SVNHelper_CommandResult |
|
110 | + */ |
|
111 | 111 | protected function execCommand($mode, $path=null, $params=array()) |
112 | 112 | { |
113 | 113 | $relative = $this->helper->relativizePath($path); |
@@ -194,10 +194,10 @@ discard block |
||
194 | 194 | return $this->result; |
195 | 195 | } |
196 | 196 | |
197 | - /** |
|
198 | - * Retrieves the type of command, e.g. "Commit" |
|
199 | - * @return string |
|
200 | - */ |
|
197 | + /** |
|
198 | + * Retrieves the type of command, e.g. "Commit" |
|
199 | + * @return string |
|
200 | + */ |
|
201 | 201 | public function getType() |
202 | 202 | { |
203 | 203 | return str_replace('SVNHelper_Command_', '', get_class($this)); |
@@ -44,12 +44,12 @@ |
||
44 | 44 | return $result; |
45 | 45 | } |
46 | 46 | |
47 | - /** |
|
48 | - * Whether the file or folder has already been committed |
|
49 | - * and has no pending changes. |
|
50 | - * |
|
51 | - * @return boolean |
|
52 | - */ |
|
47 | + /** |
|
48 | + * Whether the file or folder has already been committed |
|
49 | + * and has no pending changes. |
|
50 | + * |
|
51 | + * @return boolean |
|
52 | + */ |
|
53 | 53 | public function isCommitted() |
54 | 54 | { |
55 | 55 | $status = $this->target->getStatus(); |
@@ -28,17 +28,17 @@ discard block |
||
28 | 28 | return $result; |
29 | 29 | } |
30 | 30 | |
31 | - /** |
|
32 | - * @var SVNHelper_Command_Update_Status[] |
|
33 | - */ |
|
31 | + /** |
|
32 | + * @var SVNHelper_Command_Update_Status[] |
|
33 | + */ |
|
34 | 34 | protected $stati; |
35 | 35 | |
36 | 36 | protected $revision; |
37 | 37 | |
38 | - /** |
|
39 | - * Parses the command output to find out which files have been modified, and how. |
|
40 | - * @param SVNHelper_CommandResult $result |
|
41 | - */ |
|
38 | + /** |
|
39 | + * Parses the command output to find out which files have been modified, and how. |
|
40 | + * @param SVNHelper_CommandResult $result |
|
41 | + */ |
|
42 | 42 | protected function parseResult(SVNHelper_CommandResult $result) |
43 | 43 | { |
44 | 44 | $this->stati = array(); |
@@ -119,11 +119,11 @@ discard block |
||
119 | 119 | return $this->getByStatus('a'); |
120 | 120 | } |
121 | 121 | |
122 | - /** |
|
123 | - * Whether there were files with the specified status code. |
|
124 | - * @param string $status |
|
125 | - * @return boolean |
|
126 | - */ |
|
122 | + /** |
|
123 | + * Whether there were files with the specified status code. |
|
124 | + * @param string $status |
|
125 | + * @return boolean |
|
126 | + */ |
|
127 | 127 | protected function hasStatus($status) |
128 | 128 | { |
129 | 129 | $this->execute(); |
@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | |
25 | 25 | const STATUS_FILETYPE_CHANGE = 'filetype-change'; |
26 | 26 | |
27 | - /** |
|
28 | - * @var array |
|
29 | - * @see http://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.status.html |
|
30 | - */ |
|
27 | + /** |
|
28 | + * @var array |
|
29 | + * @see http://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.status.html |
|
30 | + */ |
|
31 | 31 | protected static $knownStati = array( |
32 | 32 | 'a' => self::STATUS_ADD, |
33 | 33 | 'd' => self::STATUS_DELETE, |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | '~' => self::STATUS_FILETYPE_CHANGE, |
41 | 41 | ); |
42 | 42 | |
43 | - /** |
|
44 | - * @var string |
|
45 | - */ |
|
43 | + /** |
|
44 | + * @var string |
|
45 | + */ |
|
46 | 46 | protected $status; |
47 | 47 | |
48 | 48 | protected function _execute() |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | $svnStatusCode = strtolower(substr($lines[0], 0, 1)); |
67 | 67 | if(isset(self::$knownStati[$svnStatusCode])) { |
68 | - $this->status = self::$knownStati[$svnStatusCode]; |
|
68 | + $this->status = self::$knownStati[$svnStatusCode]; |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 |
@@ -12,50 +12,50 @@ discard block |
||
12 | 12 | |
13 | 13 | const TYPE_SCRIPT_START = 'start'; |
14 | 14 | |
15 | - /** |
|
16 | - * @var ConvertHelper_ThrowableInfo |
|
17 | - */ |
|
15 | + /** |
|
16 | + * @var ConvertHelper_ThrowableInfo |
|
17 | + */ |
|
18 | 18 | protected $info; |
19 | 19 | |
20 | - /** |
|
21 | - * @var array |
|
22 | - */ |
|
20 | + /** |
|
21 | + * @var array |
|
22 | + */ |
|
23 | 23 | protected $trace; |
24 | 24 | |
25 | - /** |
|
26 | - * @var VariableInfo[] |
|
27 | - */ |
|
25 | + /** |
|
26 | + * @var VariableInfo[] |
|
27 | + */ |
|
28 | 28 | protected $args = array(); |
29 | 29 | |
30 | - /** |
|
31 | - * The source file, if any |
|
32 | - * @var string |
|
33 | - */ |
|
30 | + /** |
|
31 | + * The source file, if any |
|
32 | + * @var string |
|
33 | + */ |
|
34 | 34 | protected $file = ''; |
35 | 35 | |
36 | - /** |
|
37 | - * @var string |
|
38 | - */ |
|
36 | + /** |
|
37 | + * @var string |
|
38 | + */ |
|
39 | 39 | protected $class = ''; |
40 | 40 | |
41 | - /** |
|
42 | - * @var integer |
|
43 | - */ |
|
41 | + /** |
|
42 | + * @var integer |
|
43 | + */ |
|
44 | 44 | protected $line = 0; |
45 | 45 | |
46 | - /** |
|
47 | - * @var int |
|
48 | - */ |
|
46 | + /** |
|
47 | + * @var int |
|
48 | + */ |
|
49 | 49 | protected $position = 1; |
50 | 50 | |
51 | - /** |
|
52 | - * @var string |
|
53 | - */ |
|
51 | + /** |
|
52 | + * @var string |
|
53 | + */ |
|
54 | 54 | protected $function = ''; |
55 | 55 | |
56 | - /** |
|
57 | - * @var string |
|
58 | - */ |
|
56 | + /** |
|
57 | + * @var string |
|
58 | + */ |
|
59 | 59 | protected $type = self::TYPE_SCRIPT_START; |
60 | 60 | |
61 | 61 | protected function __construct(ConvertHelper_ThrowableInfo $info, array $data) |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | } |
83 | 83 | } |
84 | 84 | |
85 | - /** |
|
86 | - * 1-based position of the call in the calls list. |
|
87 | - * @return int |
|
88 | - */ |
|
85 | + /** |
|
86 | + * 1-based position of the call in the calls list. |
|
87 | + * @return int |
|
88 | + */ |
|
89 | 89 | public function getPosition() : int |
90 | 90 | { |
91 | 91 | return $this->position; |
@@ -96,18 +96,18 @@ discard block |
||
96 | 96 | return $this->line; |
97 | 97 | } |
98 | 98 | |
99 | - /** |
|
100 | - * Whether the call had any arguments. |
|
101 | - * @return bool |
|
102 | - */ |
|
99 | + /** |
|
100 | + * Whether the call had any arguments. |
|
101 | + * @return bool |
|
102 | + */ |
|
103 | 103 | public function hasArguments() : bool |
104 | 104 | { |
105 | 105 | return !empty($this->args); |
106 | 106 | } |
107 | 107 | |
108 | - /** |
|
109 | - * @return VariableInfo[] |
|
110 | - */ |
|
108 | + /** |
|
109 | + * @return VariableInfo[] |
|
110 | + */ |
|
111 | 111 | public function getArguments() |
112 | 112 | { |
113 | 113 | return $this->args; |
@@ -240,31 +240,31 @@ discard block |
||
240 | 240 | return implode(', ', $tokens); |
241 | 241 | } |
242 | 242 | |
243 | - /** |
|
244 | - * Retrieves the type of call: typcially a function |
|
245 | - * call, or a method call of an object. Note that the |
|
246 | - * first call in a script does not have either. |
|
247 | - * |
|
248 | - * @return string |
|
249 | - * |
|
250 | - * @see ConvertHelper_ThrowableInfo_Call::TYPE_FUNCTION_CALL |
|
251 | - * @see ConvertHelper_ThrowableInfo_Call::TYPE_METHOD_CALL |
|
252 | - * @see ConvertHelper_ThrowableInfo_Call::TYPE_SCRIPT_START |
|
253 | - * @see ConvertHelper_ThrowableInfo_Call::hasFunction() |
|
254 | - * @see ConvertHelper_ThrowableInfo_Call::hasClass() |
|
255 | - */ |
|
243 | + /** |
|
244 | + * Retrieves the type of call: typcially a function |
|
245 | + * call, or a method call of an object. Note that the |
|
246 | + * first call in a script does not have either. |
|
247 | + * |
|
248 | + * @return string |
|
249 | + * |
|
250 | + * @see ConvertHelper_ThrowableInfo_Call::TYPE_FUNCTION_CALL |
|
251 | + * @see ConvertHelper_ThrowableInfo_Call::TYPE_METHOD_CALL |
|
252 | + * @see ConvertHelper_ThrowableInfo_Call::TYPE_SCRIPT_START |
|
253 | + * @see ConvertHelper_ThrowableInfo_Call::hasFunction() |
|
254 | + * @see ConvertHelper_ThrowableInfo_Call::hasClass() |
|
255 | + */ |
|
256 | 256 | public function getType() : string |
257 | 257 | { |
258 | 258 | return $this->type; |
259 | 259 | } |
260 | 260 | |
261 | - /** |
|
262 | - * Serializes the call to an array, with all |
|
263 | - * necessary information. Can be used to restore |
|
264 | - * the call later using {@link ConvertHelper_ThrowableInfo_Call::fromSerialized()}. |
|
265 | - * |
|
266 | - * @return array |
|
267 | - */ |
|
261 | + /** |
|
262 | + * Serializes the call to an array, with all |
|
263 | + * necessary information. Can be used to restore |
|
264 | + * the call later using {@link ConvertHelper_ThrowableInfo_Call::fromSerialized()}. |
|
265 | + * |
|
266 | + * @return array |
|
267 | + */ |
|
268 | 268 | public function serialize() : array |
269 | 269 | { |
270 | 270 | $result = array( |