@@ -234,16 +234,16 @@ discard block |
||
234 | 234 | self::$logger->debug('<<__construct()'); |
235 | 235 | } |
236 | 236 | |
237 | - /** |
|
238 | - * Facade method which will invoke our custom markdown class rather than the standard one. |
|
239 | - * |
|
240 | - * @param $text The markdown content to parse |
|
241 | - * |
|
242 | - * @since 1.0 |
|
243 | - */ |
|
244 | - private function markdown($text) |
|
245 | - { |
|
246 | - $config = ConfigProvider::getInstance(); |
|
237 | + /** |
|
238 | + * Facade method which will invoke our custom markdown class rather than the standard one. |
|
239 | + * |
|
240 | + * @param $text The markdown content to parse |
|
241 | + * |
|
242 | + * @since 1.0 |
|
243 | + */ |
|
244 | + private function markdown($text) |
|
245 | + { |
|
246 | + $config = ConfigProvider::getInstance(); |
|
247 | 247 | |
248 | 248 | /* |
249 | 249 | * Initialize the parser and return the result of its transform method. |
@@ -251,9 +251,9 @@ discard block |
||
251 | 251 | */ |
252 | 252 | static $parser; |
253 | 253 | |
254 | - if (!isset($parser)) { |
|
255 | - $parser = new Markdown(); |
|
256 | - } |
|
254 | + if (!isset($parser)) { |
|
255 | + $parser = new Markdown(); |
|
256 | + } |
|
257 | 257 | |
258 | 258 | /* |
259 | 259 | * Replace all instances of $sysURL in the text with the app.url setting from config |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | |
264 | 264 | // transform text using parser. |
265 | 265 | return $parser->transform($text); |
266 | - } |
|
266 | + } |
|
267 | 267 | |
268 | 268 | /** |
269 | 269 | * Fetter for the content. |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | foreach ($attachments[0] as $attachmentURL) { |
155 | 155 | $start = mb_strpos($attachmentURL, '/'); |
156 | 156 | $end = mb_strrpos($attachmentURL, '"'); |
157 | - $fileName = mb_substr($attachmentURL, $start + 1, $end - ($start + 1)); |
|
157 | + $fileName = mb_substr($attachmentURL, $start+1, $end-($start+1)); |
|
158 | 158 | |
159 | 159 | if (method_exists($this->article, 'getAttachmentSecureURL')) { |
160 | 160 | $this->content = str_replace($attachmentURL, 'href='.$this->article->getAttachmentSecureURL($fileName), $this->content); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | foreach ($attachments[0] as $attachmentURL) { |
169 | 169 | $start = mb_strpos($attachmentURL, '/'); |
170 | 170 | $end = mb_strrpos($attachmentURL, '" alt'); |
171 | - $fileName = mb_substr($attachmentURL, $start + 1, $end - ($start + 1)); |
|
171 | + $fileName = mb_substr($attachmentURL, $start+1, $end-($start+1)); |
|
172 | 172 | |
173 | 173 | if ($config->get('cms.images.widget')) { |
174 | 174 | // get the details of the source image |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $type = 'png'; |
184 | 184 | } |
185 | 185 | |
186 | - $img = new Image($path, $image_details[0], $image_details[1], $type, 0.95, false, (boolean) $config->get('cms.images.widget.secure')); |
|
186 | + $img = new Image($path, $image_details[0], $image_details[1], $type, 0.95, false, (boolean)$config->get('cms.images.widget.secure')); |
|
187 | 187 | $this->content = str_replace($attachmentURL, $img->renderHTMLLink(), $this->content); |
188 | 188 | } else { |
189 | 189 | // render a normal image link to the ViewAttachment controller |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | /** |
285 | 285 | * Get the node offset. |
286 | 286 | * |
287 | - * @return string |
|
287 | + * @return integer |
|
288 | 288 | * |
289 | 289 | * @since 1.0 |
290 | 290 | */ |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | /** |
461 | 461 | * Calculates and returns the midpoint X coordinate of the children of this node. |
462 | 462 | * |
463 | - * @return int |
|
463 | + * @return double |
|
464 | 464 | * |
465 | 465 | * @since 1.0 |
466 | 466 | */ |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | /** |
488 | 488 | * Add a new node to the children array of this node. |
489 | 489 | * |
490 | - * @param Alpha\Util\Graph\GraphNode $node |
|
490 | + * @param GraphNode $node |
|
491 | 491 | * |
492 | 492 | * @throws ALpha\Exception\IllegalArguementException |
493 | 493 | * |
@@ -467,9 +467,9 @@ discard block |
||
467 | 467 | public function getChildrenCenter() |
468 | 468 | { |
469 | 469 | $node = $this->getChildAt(0); |
470 | - $node1 = $this->getChildAt(count($this->children) - 1); |
|
470 | + $node1 = $this->getChildAt(count($this->children)-1); |
|
471 | 471 | |
472 | - return $node->getOffset() + (($node1->getOffset() - $node->getOffset()) + $node1->getWidth()) / 2; |
|
472 | + return $node->getOffset()+(($node1->getOffset()-$node->getOffset())+$node1->getWidth())/2; |
|
473 | 473 | } |
474 | 474 | |
475 | 475 | /** |
@@ -521,14 +521,14 @@ discard block |
||
521 | 521 | */ |
522 | 522 | public function setUpLinks() |
523 | 523 | { |
524 | - $xa = $this->x + ($this->width / 2); |
|
525 | - $ya = $this->y + $this->height; |
|
524 | + $xa = $this->x+($this->width/2); |
|
525 | + $ya = $this->y+$this->height; |
|
526 | 526 | |
527 | 527 | foreach ($this->children as $child) { |
528 | - $xd = $xc = $child->getX() + ($child->getWidth() / 2); |
|
528 | + $xd = $xc = $child->getX()+($child->getWidth()/2); |
|
529 | 529 | $yd = $child->getY(); |
530 | 530 | $xb = $xa; |
531 | - $yb = $yc = $ya + ($yd - $ya) / 2; |
|
531 | + $yb = $yc = $ya+($yd-$ya)/2; |
|
532 | 532 | $this->links[$child->id]['xa'] = $xa; |
533 | 533 | $this->links[$child->id]['ya'] = $ya; |
534 | 534 | $this->links[$child->id]['xb'] = $xb; |
@@ -67,7 +67,7 @@ |
||
67 | 67 | * A static method that attempts to return a ActiveRecordProviderInterface instance |
68 | 68 | * based on the name of the provider class supplied. |
69 | 69 | * |
70 | - * @param $providerName The fully-qualified class name of the provider class. |
|
70 | + * @param string $providerName The fully-qualified class name of the provider class. |
|
71 | 71 | * @param $Record The (optional) active record instance to pass to the persistance provider for mapping. |
72 | 72 | * |
73 | 73 | * @throws \Alpha\Exception\IllegalArguementException |
@@ -2340,11 +2340,11 @@ |
||
2340 | 2340 | * parameters. If arrays of attribute names and values are provided, only those will be bound to |
2341 | 2341 | * the supplied statement. |
2342 | 2342 | * |
2343 | - * @param mysqli_stmt $stmt The SQL statement to bind to. |
|
2343 | + * @param \mysqli_stmt $stmt The SQL statement to bind to. |
|
2344 | 2344 | * @param array Optional array of Record attributes. |
2345 | 2345 | * @param array Optional array of Record values. |
2346 | 2346 | * |
2347 | - * @return mysqli_stmt |
|
2347 | + * @return \mysqli_stmt |
|
2348 | 2348 | * |
2349 | 2349 | * @since 1.1 |
2350 | 2350 | */ |
@@ -1014,7 +1014,7 @@ discard block |
||
1014 | 1014 | } else { |
1015 | 1015 | // there has been an error, so decrement the version number back |
1016 | 1016 | $temp = $this->record->getVersionNumber()->getValue(); |
1017 | - $this->record->set('version_num', $temp - 1); |
|
1017 | + $this->record->set('version_num', $temp-1); |
|
1018 | 1018 | |
1019 | 1019 | // check for unique violations |
1020 | 1020 | if (self::getConnection()->errno == '1062') { |
@@ -1063,7 +1063,7 @@ discard block |
||
1063 | 1063 | $this->record->setLastQuery($sqlQuery); |
1064 | 1064 | $stmt = self::getConnection()->stmt_init(); |
1065 | 1065 | |
1066 | - $newVersionNumber = $this->record->getVersionNumber()->getValue() + 1; |
|
1066 | + $newVersionNumber = $this->record->getVersionNumber()->getValue()+1; |
|
1067 | 1067 | |
1068 | 1068 | if ($stmt->prepare($sqlQuery)) { |
1069 | 1069 | if ($this->record->getPropObject($attribute) instanceof Integer) { |
@@ -2393,7 +2393,7 @@ discard block |
||
2393 | 2393 | |
2394 | 2394 | if ($propName == 'version_num') { |
2395 | 2395 | $temp = $this->record->getVersionNumber()->getValue(); |
2396 | - $this->record->set('version_num', $temp + 1); |
|
2396 | + $this->record->set('version_num', $temp+1); |
|
2397 | 2397 | $bindingsTypes .= 'i'; |
2398 | 2398 | array_push($params, $this->record->getVersionNumber()->getValue()); |
2399 | 2399 | } |
@@ -2489,7 +2489,7 @@ discard block |
||
2489 | 2489 | $singleQuote1 = mb_strpos($error, "'"); |
2490 | 2490 | $singleQuote2 = mb_strrpos($error, "'"); |
2491 | 2491 | |
2492 | - $value = mb_substr($error, $singleQuote1, ($singleQuote2 - $singleQuote1) + 1); |
|
2492 | + $value = mb_substr($error, $singleQuote1, ($singleQuote2-$singleQuote1)+1); |
|
2493 | 2493 | self::$logger->debug('<<findOffendingValue ['.$value.'])'); |
2494 | 2494 | |
2495 | 2495 | return $value; |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | /** |
509 | 509 | * Getter for the Relation value. |
510 | 510 | * |
511 | - * @return mixed |
|
511 | + * @return string |
|
512 | 512 | * |
513 | 513 | * @since 1.0 |
514 | 514 | */ |
@@ -748,7 +748,7 @@ discard block |
||
748 | 748 | * Set the taggedClass property to the name of the tagged class when building relations |
749 | 749 | * to the TagObject record. |
750 | 750 | * |
751 | - * @param $taggedClass |
|
751 | + * @param string $taggedClass |
|
752 | 752 | * |
753 | 753 | * @since 1.0 |
754 | 754 | */ |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | // work out how many columns will be in the table |
226 | 226 | $reflection = new ReflectionClass(get_class($this->record)); |
227 | 227 | $properties = array_keys($reflection->getDefaultProperties()); |
228 | - $fields['colCount'] = 1 + count(array_diff($properties, $this->record->getDefaultAttributes(), $this->record->getTransientAttributes())); |
|
228 | + $fields['colCount'] = 1+count(array_diff($properties, $this->record->getDefaultAttributes(), $this->record->getTransientAttributes())); |
|
229 | 229 | |
230 | 230 | // get the class attributes |
231 | 231 | $properties = $reflection->getProperties(); |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | $html .= ' <th>'.$this->record->getDataLabel($propName).'</th>'; |
247 | 247 | } |
248 | 248 | } else { |
249 | - $fields['colCount'] = $fields['colCount'] - 1; |
|
249 | + $fields['colCount'] = $fields['colCount']-1; |
|
250 | 250 | } |
251 | 251 | } |
252 | 252 | $html .= '</tr><tr>'; |
@@ -1031,7 +1031,7 @@ discard block |
||
1031 | 1031 | if ($viewState->get('markdownTextBoxRows') == '') { |
1032 | 1032 | $text = new TextBox($this->record->getPropObject($name), $label, $name, 10); |
1033 | 1033 | } else { |
1034 | - $text = new TextBox($this->record->getPropObject($name), $label, $name, (integer) $viewState->get('markdownTextBoxRows')); |
|
1034 | + $text = new TextBox($this->record->getPropObject($name), $label, $name, (integer)$viewState->get('markdownTextBoxRows')); |
|
1035 | 1035 | } |
1036 | 1036 | |
1037 | 1037 | $html .= $text->render(); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | // work out how many columns will be in the table |
104 | 104 | $reflection = new \ReflectionClass(get_class($this->record)); |
105 | 105 | $properties = array_keys($reflection->getDefaultProperties()); |
106 | - $fields['colCount'] = 1 + count(array_diff($properties, $this->record->getDefaultAttributes(), $this->record->getTransientAttributes())); |
|
106 | + $fields['colCount'] = 1+count(array_diff($properties, $this->record->getDefaultAttributes(), $this->record->getTransientAttributes())); |
|
107 | 107 | |
108 | 108 | // get the class attributes |
109 | 109 | $properties = $reflection->getProperties(); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $html .= ' <th>'.$this->record->getDataLabel($propName).'</th>'; |
125 | 125 | } |
126 | 126 | } else { |
127 | - $fields['colCount'] = $fields['colCount'] - 1; |
|
127 | + $fields['colCount'] = $fields['colCount']-1; |
|
128 | 128 | } |
129 | 129 | } |
130 | 130 | $html .= '</tr><tr>'; |
@@ -253,7 +253,7 @@ |
||
253 | 253 | |
254 | 254 | $html .= '<tr>'; |
255 | 255 | |
256 | - $html .= '<td>'.$file.' <em>('.number_format(filesize($this->record->getAttachmentsLocation().'/'.$file) / 1024).' KB)</em></td>'; |
|
256 | + $html .= '<td>'.$file.' <em>('.number_format(filesize($this->record->getAttachmentsLocation().'/'.$file)/1024).' KB)</em></td>'; |
|
257 | 257 | |
258 | 258 | $js = "if(window.jQuery) { |
259 | 259 | BootstrapDialog.show({ |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | foreach ($attachments[0] as $attachmentURL) { |
123 | 123 | $start = mb_strpos($attachmentURL, '/'); |
124 | 124 | $end = mb_strrpos($attachmentURL, '"'); |
125 | - $fileName = mb_substr($attachmentURL, $start + 1, $end - ($start + 1)); |
|
125 | + $fileName = mb_substr($attachmentURL, $start+1, $end-($start+1)); |
|
126 | 126 | |
127 | 127 | if (method_exists($this->record, 'getAttachmentSecureURL')) { |
128 | 128 | $this->content = str_replace($attachmentURL, 'href="'.$this->record->getAttachmentSecureURL($fileName).'" rel="nofollow"', $this->content); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $type = 'png'; |
151 | 151 | } |
152 | 152 | |
153 | - $img = new Image($path, $image_details[0], $image_details[1], $type, 0.95, false, (boolean) $config->get('cms.images.widget.secure')); |
|
153 | + $img = new Image($path, $image_details[0], $image_details[1], $type, 0.95, false, (boolean)$config->get('cms.images.widget.secure')); |
|
154 | 154 | |
155 | 155 | $this->content = str_replace($attachmentURL, $img->renderHTMLLink(), $this->content); |
156 | 156 | } else { |