@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function getReleases($user, $repository) |
| 36 | 36 | { |
| 37 | - $url = static::BASE_URL . 'repos/' . $user . '/' . $repository . '/releases'; |
|
| 37 | + $url = static::BASE_URL.'repos/'.$user.'/'.$repository.'/releases'; |
|
| 38 | 38 | |
| 39 | 39 | return $this->_get($url); |
| 40 | 40 | } |
@@ -50,9 +50,9 @@ discard block |
||
| 50 | 50 | public function getLatestRelease($user, $repository, $prerelease = false) |
| 51 | 51 | { |
| 52 | 52 | if ($prerelease) { |
| 53 | - $url = static::BASE_URL . 'repos/' . $user . '/' . $repository . '/releases'; |
|
| 53 | + $url = static::BASE_URL.'repos/'.$user.'/'.$repository.'/releases'; |
|
| 54 | 54 | } else { |
| 55 | - $url = static::BASE_URL . 'repos/' . $user . '/' . $repository . '/releases/latest'; |
|
| 55 | + $url = static::BASE_URL.'repos/'.$user.'/'.$repository.'/releases/latest'; |
|
| 56 | 56 | } |
| 57 | 57 | $result = $this->_get($url); |
| 58 | 58 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | public function getUserRepositories($username, $per_page = 100, $page = 1) |
| 38 | 38 | { |
| 39 | - $url = static::BASE_URL . 'users/' . \rawurlencode($username) . '/repos?per_page=' . $per_page . '&page=' . $page; |
|
| 39 | + $url = static::BASE_URL.'users/'.\rawurlencode($username).'/repos?per_page='.$per_page.'&page='.$page; |
|
| 40 | 40 | |
| 41 | 41 | return $this->_get($url); |
| 42 | 42 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public function getOrgRepositories($org, $per_page = 100, $page = 1) |
| 53 | 53 | { |
| 54 | - $url = static::BASE_URL . 'orgs/' . \rawurlencode($org) . '/repos?per_page=' . $per_page . '&page=' . $page; |
|
| 54 | + $url = static::BASE_URL.'orgs/'.\rawurlencode($org).'/repos?per_page='.$per_page.'&page='.$page; |
|
| 55 | 55 | |
| 56 | 56 | return $this->_get($url); |
| 57 | 57 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | public function getReadme($username, $repository) |
| 70 | 70 | { |
| 71 | - $url = static::BASE_URL . 'repos/' . \rawurlencode($username) . '/' . \rawurlencode($repository) . '/readme'; |
|
| 71 | + $url = static::BASE_URL.'repos/'.\rawurlencode($username).'/'.\rawurlencode($repository).'/readme'; |
|
| 72 | 72 | |
| 73 | 73 | return $this->_get($url, false, false); |
| 74 | 74 | } |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | */ |
| 71 | 71 | public function getHandler($name) |
| 72 | 72 | { |
| 73 | - $class = __NAMESPACE__ . '\\' . \ucfirst($name) . 'Handler'; |
|
| 73 | + $class = __NAMESPACE__.'\\'.\ucfirst($name).'Handler'; |
|
| 74 | 74 | if (!\class_exists($class)) { |
| 75 | 75 | throw new \RuntimeException("Class '$class' not found"); |
| 76 | 76 | } |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | |
| 210 | 210 | if (isset($CurrentBlock['continuable'])) |
| 211 | 211 | { |
| 212 | - $methodName = 'block' . $CurrentBlock['type'] . 'Continue'; |
|
| 212 | + $methodName = 'block'.$CurrentBlock['type'].'Continue'; |
|
| 213 | 213 | $Block = $this->$methodName($Line, $CurrentBlock); |
| 214 | 214 | |
| 215 | 215 | if (isset($Block)) |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | { |
| 223 | 223 | if ($this->isBlockCompletable($CurrentBlock['type'])) |
| 224 | 224 | { |
| 225 | - $methodName = 'block' . $CurrentBlock['type'] . 'Complete'; |
|
| 225 | + $methodName = 'block'.$CurrentBlock['type'].'Complete'; |
|
| 226 | 226 | $CurrentBlock = $this->$methodName($CurrentBlock); |
| 227 | 227 | } |
| 228 | 228 | } |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | { |
| 241 | 241 | foreach ($this->BlockTypes[$marker] as $blockType) |
| 242 | 242 | { |
| 243 | - $blockTypes []= $blockType; |
|
| 243 | + $blockTypes [] = $blockType; |
|
| 244 | 244 | } |
| 245 | 245 | } |
| 246 | 246 | |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | { |
| 256 | 256 | $Block['type'] = $blockType; |
| 257 | 257 | |
| 258 | - if ( ! isset($Block['identified'])) |
|
| 258 | + if (!isset($Block['identified'])) |
|
| 259 | 259 | { |
| 260 | 260 | if (isset($CurrentBlock)) |
| 261 | 261 | { |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | |
| 305 | 305 | if (isset($CurrentBlock['continuable']) and $this->isBlockCompletable($CurrentBlock['type'])) |
| 306 | 306 | { |
| 307 | - $methodName = 'block' . $CurrentBlock['type'] . 'Complete'; |
|
| 307 | + $methodName = 'block'.$CurrentBlock['type'].'Complete'; |
|
| 308 | 308 | $CurrentBlock = $this->$methodName($CurrentBlock); |
| 309 | 309 | } |
| 310 | 310 | |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | |
| 323 | 323 | protected function extractElement(array $Component) |
| 324 | 324 | { |
| 325 | - if ( ! isset($Component['element'])) |
|
| 325 | + if (!isset($Component['element'])) |
|
| 326 | 326 | { |
| 327 | 327 | if (isset($Component['markup'])) |
| 328 | 328 | { |
@@ -339,12 +339,12 @@ discard block |
||
| 339 | 339 | |
| 340 | 340 | protected function isBlockContinuable($Type) |
| 341 | 341 | { |
| 342 | - return method_exists($this, 'block' . $Type . 'Continue'); |
|
| 342 | + return method_exists($this, 'block'.$Type.'Continue'); |
|
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | protected function isBlockCompletable($Type) |
| 346 | 346 | { |
| 347 | - return method_exists($this, 'block' . $Type . 'Complete'); |
|
| 347 | + return method_exists($this, 'block'.$Type.'Complete'); |
|
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | # |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | |
| 353 | 353 | protected function blockCode($Line, $Block = null) |
| 354 | 354 | { |
| 355 | - if (isset($Block) and $Block['type'] === 'Paragraph' and ! isset($Block['interrupted'])) |
|
| 355 | + if (isset($Block) and $Block['type'] === 'Paragraph' and !isset($Block['interrupted'])) |
|
| 356 | 356 | { |
| 357 | 357 | return; |
| 358 | 358 | } |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | return; |
| 437 | 437 | } |
| 438 | 438 | |
| 439 | - $Block['element']['rawHtml'] .= "\n" . $Line['body']; |
|
| 439 | + $Block['element']['rawHtml'] .= "\n".$Line['body']; |
|
| 440 | 440 | |
| 441 | 441 | if (strpos($Line['text'], '-->') !== false) |
| 442 | 442 | { |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | return $Block; |
| 528 | 528 | } |
| 529 | 529 | |
| 530 | - $Block['element']['element']['text'] .= "\n" . $Line['body']; |
|
| 530 | + $Block['element']['element']['text'] .= "\n".$Line['body']; |
|
| 531 | 531 | |
| 532 | 532 | return $Block; |
| 533 | 533 | } |
@@ -560,7 +560,7 @@ discard block |
||
| 560 | 560 | |
| 561 | 561 | $Block = array( |
| 562 | 562 | 'element' => array( |
| 563 | - 'name' => 'h' . $level, |
|
| 563 | + 'name' => 'h'.$level, |
|
| 564 | 564 | 'handler' => array( |
| 565 | 565 | 'function' => 'lineElements', |
| 566 | 566 | 'argument' => $text, |
@@ -587,7 +587,7 @@ discard block |
||
| 587 | 587 | { |
| 588 | 588 | $contentIndent -= 1; |
| 589 | 589 | $matches[1] = substr($matches[1], 0, -$contentIndent); |
| 590 | - $matches[3] = str_repeat(' ', $contentIndent) . $matches[3]; |
|
| 590 | + $matches[3] = str_repeat(' ', $contentIndent).$matches[3]; |
|
| 591 | 591 | } |
| 592 | 592 | elseif ($contentIndent === 0) |
| 593 | 593 | { |
@@ -620,7 +620,7 @@ discard block |
||
| 620 | 620 | if ( |
| 621 | 621 | isset($CurrentBlock) |
| 622 | 622 | and $CurrentBlock['type'] === 'Paragraph' |
| 623 | - and ! isset($CurrentBlock['interrupted']) |
|
| 623 | + and !isset($CurrentBlock['interrupted']) |
|
| 624 | 624 | ) { |
| 625 | 625 | return; |
| 626 | 626 | } |
@@ -638,7 +638,7 @@ discard block |
||
| 638 | 638 | ) |
| 639 | 639 | ); |
| 640 | 640 | |
| 641 | - $Block['element']['elements'] []= & $Block['li']; |
|
| 641 | + $Block['element']['elements'] [] = & $Block['li']; |
|
| 642 | 642 | |
| 643 | 643 | return $Block; |
| 644 | 644 | } |
@@ -666,7 +666,7 @@ discard block |
||
| 666 | 666 | ) { |
| 667 | 667 | if (isset($Block['interrupted'])) |
| 668 | 668 | { |
| 669 | - $Block['li']['handler']['argument'] []= ''; |
|
| 669 | + $Block['li']['handler']['argument'] [] = ''; |
|
| 670 | 670 | |
| 671 | 671 | $Block['loose'] = true; |
| 672 | 672 | |
@@ -688,7 +688,7 @@ discard block |
||
| 688 | 688 | ) |
| 689 | 689 | ); |
| 690 | 690 | |
| 691 | - $Block['element']['elements'] []= & $Block['li']; |
|
| 691 | + $Block['element']['elements'] [] = & $Block['li']; |
|
| 692 | 692 | |
| 693 | 693 | return $Block; |
| 694 | 694 | } |
@@ -706,7 +706,7 @@ discard block |
||
| 706 | 706 | { |
| 707 | 707 | if (isset($Block['interrupted'])) |
| 708 | 708 | { |
| 709 | - $Block['li']['handler']['argument'] []= ''; |
|
| 709 | + $Block['li']['handler']['argument'] [] = ''; |
|
| 710 | 710 | |
| 711 | 711 | $Block['loose'] = true; |
| 712 | 712 | |
@@ -715,16 +715,16 @@ discard block |
||
| 715 | 715 | |
| 716 | 716 | $text = substr($Line['body'], $requiredIndent); |
| 717 | 717 | |
| 718 | - $Block['li']['handler']['argument'] []= $text; |
|
| 718 | + $Block['li']['handler']['argument'] [] = $text; |
|
| 719 | 719 | |
| 720 | 720 | return $Block; |
| 721 | 721 | } |
| 722 | 722 | |
| 723 | - if ( ! isset($Block['interrupted'])) |
|
| 723 | + if (!isset($Block['interrupted'])) |
|
| 724 | 724 | { |
| 725 | 725 | $text = preg_replace('/^[ ]{0,'.$requiredIndent.'}+/', '', $Line['body']); |
| 726 | 726 | |
| 727 | - $Block['li']['handler']['argument'] []= $text; |
|
| 727 | + $Block['li']['handler']['argument'] [] = $text; |
|
| 728 | 728 | |
| 729 | 729 | return $Block; |
| 730 | 730 | } |
@@ -738,7 +738,7 @@ discard block |
||
| 738 | 738 | { |
| 739 | 739 | if (end($li['handler']['argument']) !== '') |
| 740 | 740 | { |
| 741 | - $li['handler']['argument'] []= ''; |
|
| 741 | + $li['handler']['argument'] [] = ''; |
|
| 742 | 742 | } |
| 743 | 743 | } |
| 744 | 744 | } |
@@ -777,14 +777,14 @@ discard block |
||
| 777 | 777 | |
| 778 | 778 | if ($Line['text'][0] === '>' and preg_match('/^>[ ]?+(.*+)/', $Line['text'], $matches)) |
| 779 | 779 | { |
| 780 | - $Block['element']['handler']['argument'] []= $matches[1]; |
|
| 780 | + $Block['element']['handler']['argument'] [] = $matches[1]; |
|
| 781 | 781 | |
| 782 | 782 | return $Block; |
| 783 | 783 | } |
| 784 | 784 | |
| 785 | - if ( ! isset($Block['interrupted'])) |
|
| 785 | + if (!isset($Block['interrupted'])) |
|
| 786 | 786 | { |
| 787 | - $Block['element']['handler']['argument'] []= $Line['text']; |
|
| 787 | + $Block['element']['handler']['argument'] [] = $Line['text']; |
|
| 788 | 788 | |
| 789 | 789 | return $Block; |
| 790 | 790 | } |
@@ -814,7 +814,7 @@ discard block |
||
| 814 | 814 | |
| 815 | 815 | protected function blockSetextHeader($Line, array $Block = null) |
| 816 | 816 | { |
| 817 | - if ( ! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) |
|
| 817 | + if (!isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) |
|
| 818 | 818 | { |
| 819 | 819 | return; |
| 820 | 820 | } |
@@ -865,7 +865,7 @@ discard block |
||
| 865 | 865 | return; |
| 866 | 866 | } |
| 867 | 867 | |
| 868 | - $Block['element']['rawHtml'] .= "\n" . $Line['body']; |
|
| 868 | + $Block['element']['rawHtml'] .= "\n".$Line['body']; |
|
| 869 | 869 | |
| 870 | 870 | return $Block; |
| 871 | 871 | } |
@@ -900,7 +900,7 @@ discard block |
||
| 900 | 900 | |
| 901 | 901 | protected function blockTable($Line, array $Block = null) |
| 902 | 902 | { |
| 903 | - if ( ! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) |
|
| 903 | + if (!isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) |
|
| 904 | 904 | { |
| 905 | 905 | return; |
| 906 | 906 | } |
@@ -949,7 +949,7 @@ discard block |
||
| 949 | 949 | $alignment = $alignment === 'left' ? 'center' : 'right'; |
| 950 | 950 | } |
| 951 | 951 | |
| 952 | - $alignments []= $alignment; |
|
| 952 | + $alignments [] = $alignment; |
|
| 953 | 953 | } |
| 954 | 954 | |
| 955 | 955 | # ~ |
@@ -990,7 +990,7 @@ discard block |
||
| 990 | 990 | ); |
| 991 | 991 | } |
| 992 | 992 | |
| 993 | - $HeaderElements []= $HeaderElement; |
|
| 993 | + $HeaderElements [] = $HeaderElement; |
|
| 994 | 994 | } |
| 995 | 995 | |
| 996 | 996 | # ~ |
@@ -1004,16 +1004,16 @@ discard block |
||
| 1004 | 1004 | ), |
| 1005 | 1005 | ); |
| 1006 | 1006 | |
| 1007 | - $Block['element']['elements'] []= array( |
|
| 1007 | + $Block['element']['elements'] [] = array( |
|
| 1008 | 1008 | 'name' => 'thead', |
| 1009 | 1009 | ); |
| 1010 | 1010 | |
| 1011 | - $Block['element']['elements'] []= array( |
|
| 1011 | + $Block['element']['elements'] [] = array( |
|
| 1012 | 1012 | 'name' => 'tbody', |
| 1013 | 1013 | 'elements' => array(), |
| 1014 | 1014 | ); |
| 1015 | 1015 | |
| 1016 | - $Block['element']['elements'][0]['elements'] []= array( |
|
| 1016 | + $Block['element']['elements'][0]['elements'] [] = array( |
|
| 1017 | 1017 | 'name' => 'tr', |
| 1018 | 1018 | 'elements' => $HeaderElements, |
| 1019 | 1019 | ); |
@@ -1057,11 +1057,11 @@ discard block |
||
| 1057 | 1057 | if (isset($Block['alignments'][$index])) |
| 1058 | 1058 | { |
| 1059 | 1059 | $Element['attributes'] = array( |
| 1060 | - 'style' => 'text-align: ' . $Block['alignments'][$index] . ';', |
|
| 1060 | + 'style' => 'text-align: '.$Block['alignments'][$index].';', |
|
| 1061 | 1061 | ); |
| 1062 | 1062 | } |
| 1063 | 1063 | |
| 1064 | - $Elements []= $Element; |
|
| 1064 | + $Elements [] = $Element; |
|
| 1065 | 1065 | } |
| 1066 | 1066 | |
| 1067 | 1067 | $Element = array( |
@@ -1069,7 +1069,7 @@ discard block |
||
| 1069 | 1069 | 'elements' => $Elements, |
| 1070 | 1070 | ); |
| 1071 | 1071 | |
| 1072 | - $Block['element']['elements'][1]['elements'] []= $Element; |
|
| 1072 | + $Block['element']['elements'][1]['elements'] [] = $Element; |
|
| 1073 | 1073 | |
| 1074 | 1074 | return $Block; |
| 1075 | 1075 | } |
@@ -1169,7 +1169,7 @@ discard block |
||
| 1169 | 1169 | |
| 1170 | 1170 | $Inline = $this->{"inline$inlineType"}($Excerpt); |
| 1171 | 1171 | |
| 1172 | - if ( ! isset($Inline)) |
|
| 1172 | + if (!isset($Inline)) |
|
| 1173 | 1173 | { |
| 1174 | 1174 | continue; |
| 1175 | 1175 | } |
@@ -1183,7 +1183,7 @@ discard block |
||
| 1183 | 1183 | |
| 1184 | 1184 | # sets a default inline position |
| 1185 | 1185 | |
| 1186 | - if ( ! isset($Inline['position'])) |
|
| 1186 | + if (!isset($Inline['position'])) |
|
| 1187 | 1187 | { |
| 1188 | 1188 | $Inline['position'] = $markerPosition; |
| 1189 | 1189 | } |
@@ -1227,7 +1227,7 @@ discard block |
||
| 1227 | 1227 | |
| 1228 | 1228 | foreach ($Elements as &$Element) |
| 1229 | 1229 | { |
| 1230 | - if ( ! isset($Element['autobreak'])) |
|
| 1230 | + if (!isset($Element['autobreak'])) |
|
| 1231 | 1231 | { |
| 1232 | 1232 | $Element['autobreak'] = false; |
| 1233 | 1233 | } |
@@ -1283,14 +1283,14 @@ discard block |
||
| 1283 | 1283 | $hostnameLabel = '[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?'; |
| 1284 | 1284 | |
| 1285 | 1285 | $commonMarkEmail = '[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]++@' |
| 1286 | - . $hostnameLabel . '(?:\.' . $hostnameLabel . ')*'; |
|
| 1286 | + . $hostnameLabel.'(?:\.'.$hostnameLabel.')*'; |
|
| 1287 | 1287 | |
| 1288 | 1288 | if (strpos($Excerpt['text'], '>') !== false |
| 1289 | 1289 | and preg_match("/^<((mailto:)?$commonMarkEmail)>/i", $Excerpt['text'], $matches) |
| 1290 | - ){ |
|
| 1290 | + ) { |
|
| 1291 | 1291 | $url = $matches[1]; |
| 1292 | 1292 | |
| 1293 | - if ( ! isset($matches[2])) |
|
| 1293 | + if (!isset($matches[2])) |
|
| 1294 | 1294 | { |
| 1295 | 1295 | $url = "mailto:$url"; |
| 1296 | 1296 | } |
@@ -1310,7 +1310,7 @@ discard block |
||
| 1310 | 1310 | |
| 1311 | 1311 | protected function inlineEmphasis($Excerpt) |
| 1312 | 1312 | { |
| 1313 | - if ( ! isset($Excerpt['text'][1])) |
|
| 1313 | + if (!isset($Excerpt['text'][1])) |
|
| 1314 | 1314 | { |
| 1315 | 1315 | return; |
| 1316 | 1316 | } |
@@ -1356,12 +1356,12 @@ discard block |
||
| 1356 | 1356 | |
| 1357 | 1357 | protected function inlineImage($Excerpt) |
| 1358 | 1358 | { |
| 1359 | - if ( ! isset($Excerpt['text'][1]) or $Excerpt['text'][1] !== '[') |
|
| 1359 | + if (!isset($Excerpt['text'][1]) or $Excerpt['text'][1] !== '[') |
|
| 1360 | 1360 | { |
| 1361 | 1361 | return; |
| 1362 | 1362 | } |
| 1363 | 1363 | |
| 1364 | - $Excerpt['text']= substr($Excerpt['text'], 1); |
|
| 1364 | + $Excerpt['text'] = substr($Excerpt['text'], 1); |
|
| 1365 | 1365 | |
| 1366 | 1366 | $Link = $this->inlineLink($Excerpt); |
| 1367 | 1367 | |
@@ -1447,7 +1447,7 @@ discard block |
||
| 1447 | 1447 | $definition = strtolower($Element['handler']['argument']); |
| 1448 | 1448 | } |
| 1449 | 1449 | |
| 1450 | - if ( ! isset($this->DefinitionData['Reference'][$definition])) |
|
| 1450 | + if (!isset($this->DefinitionData['Reference'][$definition])) |
|
| 1451 | 1451 | { |
| 1452 | 1452 | return; |
| 1453 | 1453 | } |
@@ -1502,7 +1502,7 @@ discard block |
||
| 1502 | 1502 | and preg_match('/^&(#?+[0-9a-zA-Z]++);/', $Excerpt['text'], $matches) |
| 1503 | 1503 | ) { |
| 1504 | 1504 | return array( |
| 1505 | - 'element' => array('rawHtml' => '&' . $matches[1] . ';'), |
|
| 1505 | + 'element' => array('rawHtml' => '&'.$matches[1].';'), |
|
| 1506 | 1506 | 'extent' => strlen($matches[0]), |
| 1507 | 1507 | ); |
| 1508 | 1508 | } |
@@ -1512,7 +1512,7 @@ discard block |
||
| 1512 | 1512 | |
| 1513 | 1513 | protected function inlineStrikethrough($Excerpt) |
| 1514 | 1514 | { |
| 1515 | - if ( ! isset($Excerpt['text'][1])) |
|
| 1515 | + if (!isset($Excerpt['text'][1])) |
|
| 1516 | 1516 | { |
| 1517 | 1517 | return; |
| 1518 | 1518 | } |
@@ -1535,7 +1535,7 @@ discard block |
||
| 1535 | 1535 | |
| 1536 | 1536 | protected function inlineUrl($Excerpt) |
| 1537 | 1537 | { |
| 1538 | - if ($this->urlsLinked !== true or ! isset($Excerpt['text'][2]) or $Excerpt['text'][2] !== '/') |
|
| 1538 | + if ($this->urlsLinked !== true or !isset($Excerpt['text'][2]) or $Excerpt['text'][2] !== '/') |
|
| 1539 | 1539 | { |
| 1540 | 1540 | return; |
| 1541 | 1541 | } |
@@ -1706,7 +1706,7 @@ discard block |
||
| 1706 | 1706 | |
| 1707 | 1707 | if ($hasName) |
| 1708 | 1708 | { |
| 1709 | - $markup .= '<' . $Element['name']; |
|
| 1709 | + $markup .= '<'.$Element['name']; |
|
| 1710 | 1710 | |
| 1711 | 1711 | if (isset($Element['attributes'])) |
| 1712 | 1712 | { |
@@ -1764,7 +1764,7 @@ discard block |
||
| 1764 | 1764 | } |
| 1765 | 1765 | } |
| 1766 | 1766 | |
| 1767 | - $markup .= $hasName ? '</' . $Element['name'] . '>' : ''; |
|
| 1767 | + $markup .= $hasName ? '</'.$Element['name'].'>' : ''; |
|
| 1768 | 1768 | } |
| 1769 | 1769 | elseif ($hasName) |
| 1770 | 1770 | { |
@@ -1793,7 +1793,7 @@ discard block |
||
| 1793 | 1793 | // (autobreak === false) covers both sides of an element |
| 1794 | 1794 | $autoBreak = !$autoBreak ? $autoBreak : $autoBreakNext; |
| 1795 | 1795 | |
| 1796 | - $markup .= ($autoBreak ? "\n" : '') . $this->element($Element); |
|
| 1796 | + $markup .= ($autoBreak ? "\n" : '').$this->element($Element); |
|
| 1797 | 1797 | $autoBreak = $autoBreakNext; |
| 1798 | 1798 | } |
| 1799 | 1799 | |
@@ -1808,7 +1808,7 @@ discard block |
||
| 1808 | 1808 | { |
| 1809 | 1809 | $Elements = $this->linesElements($lines); |
| 1810 | 1810 | |
| 1811 | - if ( ! in_array('', $lines) |
|
| 1811 | + if (!in_array('', $lines) |
|
| 1812 | 1812 | and isset($Elements[0]) and isset($Elements[0]['name']) |
| 1813 | 1813 | and $Elements[0]['name'] === 'p' |
| 1814 | 1814 | ) { |
@@ -1865,12 +1865,12 @@ discard block |
||
| 1865 | 1865 | protected function sanitiseElement(array $Element) |
| 1866 | 1866 | { |
| 1867 | 1867 | static $goodAttribute = '/^[a-zA-Z0-9][a-zA-Z0-9-_]*+$/'; |
| 1868 | - static $safeUrlNameToAtt = array( |
|
| 1868 | + static $safeUrlNameToAtt = array( |
|
| 1869 | 1869 | 'a' => 'href', |
| 1870 | 1870 | 'img' => 'src', |
| 1871 | 1871 | ); |
| 1872 | 1872 | |
| 1873 | - if ( ! isset($Element['name'])) |
|
| 1873 | + if (!isset($Element['name'])) |
|
| 1874 | 1874 | { |
| 1875 | 1875 | unset($Element['attributes']); |
| 1876 | 1876 | return $Element; |
@@ -1881,12 +1881,12 @@ discard block |
||
| 1881 | 1881 | $Element = $this->filterUnsafeUrlInAttribute($Element, $safeUrlNameToAtt[$Element['name']]); |
| 1882 | 1882 | } |
| 1883 | 1883 | |
| 1884 | - if ( ! empty($Element['attributes'])) |
|
| 1884 | + if (!empty($Element['attributes'])) |
|
| 1885 | 1885 | { |
| 1886 | 1886 | foreach ($Element['attributes'] as $att => $val) |
| 1887 | 1887 | { |
| 1888 | 1888 | # filter out badly parsed attribute |
| 1889 | - if ( ! preg_match($goodAttribute, $att)) |
|
| 1889 | + if (!preg_match($goodAttribute, $att)) |
|
| 1890 | 1890 | { |
| 1891 | 1891 | unset($Element['attributes'][$att]); |
| 1892 | 1892 | } |
@@ -1987,8 +1987,8 @@ discard block |
||
| 1987 | 1987 | protected $textLevelElements = array( |
| 1988 | 1988 | 'a', 'br', 'bdo', 'abbr', 'blink', 'nextid', 'acronym', 'basefont', |
| 1989 | 1989 | 'b', 'em', 'big', 'cite', 'small', 'spacer', 'listing', |
| 1990 | - 'i', 'rp', 'del', 'code', 'strike', 'marquee', |
|
| 1991 | - 'q', 'rt', 'ins', 'font', 'strong', |
|
| 1990 | + 'i', 'rp', 'del', 'code', 'strike', 'marquee', |
|
| 1991 | + 'q', 'rt', 'ins', 'font', 'strong', |
|
| 1992 | 1992 | 's', 'tt', 'kbd', 'mark', |
| 1993 | 1993 | 'u', 'xm', 'sub', 'nobr', |
| 1994 | 1994 | 'sup', 'ruby', |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | if (Constants::STATUS_NEW === $repoStatus || Constants::STATUS_UPDATED === $repoStatus || 0 == $releasesCount) { |
| 150 | 150 | $ghReleases = $libReleases->getReleases($repositoriesAll[$i]->getVar('repo_user'), $repositoriesAll[$i]->getVar('repo_name')); |
| 151 | 151 | if ($releasesCount > 0) { |
| 152 | - $sql = 'DELETE FROM `' . $GLOBALS['xoopsDB']->prefix('wggithub_releases') . '` WHERE `rel_repoid` = ' . $repoId; |
|
| 152 | + $sql = 'DELETE FROM `'.$GLOBALS['xoopsDB']->prefix('wggithub_releases').'` WHERE `rel_repoid` = '.$repoId; |
|
| 153 | 153 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 154 | 154 | return false; |
| 155 | 155 | } |
@@ -159,13 +159,13 @@ discard block |
||
| 159 | 159 | $first = true; |
| 160 | 160 | $final = false; |
| 161 | 161 | foreach ($ghReleases as $ghRelease) { |
| 162 | - if ($first || (!$final && !(bool)$ghRelease['prerelease'])) { |
|
| 162 | + if ($first || (!$final && !(bool) $ghRelease['prerelease'])) { |
|
| 163 | 163 | // save first in any case and save first final version |
| 164 | 164 | $releasesObj = $releasesHandler->create(); |
| 165 | 165 | $releasesObj->setVar('rel_repoid', $repoId); |
| 166 | 166 | $releasesObj->setVar('rel_type', $ghRelease['type']); |
| 167 | 167 | $releasesObj->setVar('rel_name', $ghRelease['name']); |
| 168 | - $releasesObj->setVar('rel_prerelease', (true == (bool)$ghRelease['prerelease'])); |
|
| 168 | + $releasesObj->setVar('rel_prerelease', (true == (bool) $ghRelease['prerelease'])); |
|
| 169 | 169 | $releasesObj->setVar('rel_publishedat', \strtotime($ghRelease['published_at'])); |
| 170 | 170 | $releasesObj->setVar('rel_tarballurl', $ghRelease['tarball_url']); |
| 171 | 171 | $releasesObj->setVar('rel_zipballurl', $ghRelease['zipball_url']); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | } |
| 178 | 178 | } |
| 179 | 179 | $first = false; |
| 180 | - if (false === (bool)$ghRelease['prerelease']) { |
|
| 180 | + if (false === (bool) $ghRelease['prerelease']) { |
|
| 181 | 181 | $final = true; |
| 182 | 182 | } |
| 183 | 183 | } |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | // must return true otherwise releases will not be loaded |
| 216 | 216 | return true; |
| 217 | 217 | } |
| 218 | - $sql = 'DELETE FROM `' . $GLOBALS['xoopsDB']->prefix('wggithub_releases') . '` WHERE `rel_repoid` = ' . $repoId; |
|
| 218 | + $sql = 'DELETE FROM `'.$GLOBALS['xoopsDB']->prefix('wggithub_releases').'` WHERE `rel_repoid` = '.$repoId; |
|
| 219 | 219 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 220 | 220 | return false; |
| 221 | 221 | } |
@@ -224,13 +224,13 @@ discard block |
||
| 224 | 224 | $first = true; |
| 225 | 225 | $final = false; |
| 226 | 226 | foreach ($ghReleases as $ghRelease) { |
| 227 | - if ($first || (!$final && !(bool)$ghRelease['prerelease'])) { |
|
| 227 | + if ($first || (!$final && !(bool) $ghRelease['prerelease'])) { |
|
| 228 | 228 | // save first in any case and save first final version |
| 229 | 229 | $releasesObj = $releasesHandler->create(); |
| 230 | 230 | $releasesObj->setVar('rel_repoid', $repoId); |
| 231 | 231 | $releasesObj->setVar('rel_type', $ghRelease['type']); |
| 232 | 232 | $releasesObj->setVar('rel_name', $ghRelease['name']); |
| 233 | - $releasesObj->setVar('rel_prerelease', (true == (bool)$ghRelease['prerelease'])); |
|
| 233 | + $releasesObj->setVar('rel_prerelease', (true == (bool) $ghRelease['prerelease'])); |
|
| 234 | 234 | $releasesObj->setVar('rel_publishedat', \strtotime($ghRelease['published_at'])); |
| 235 | 235 | $releasesObj->setVar('rel_tarballurl', $ghRelease['tarball_url']); |
| 236 | 236 | $releasesObj->setVar('rel_zipballurl', $ghRelease['zipball_url']); |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | } |
| 243 | 243 | } |
| 244 | 244 | $first = false; |
| 245 | - if (false === (bool)$ghRelease['prerelease']) { |
|
| 245 | + if (false === (bool) $ghRelease['prerelease']) { |
|
| 246 | 246 | $final = true; |
| 247 | 247 | } |
| 248 | 248 | } |
@@ -259,17 +259,17 @@ discard block |
||
| 259 | 259 | public function updateRepoReleases() |
| 260 | 260 | { |
| 261 | 261 | // update repo_prerelease |
| 262 | - $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('wggithub_repositories') . ' INNER JOIN ' . $GLOBALS['xoopsDB']->prefix('wggithub_releases'); |
|
| 263 | - $sql .= ' ON ' . $GLOBALS['xoopsDB']->prefix('wggithub_repositories') . '.repo_id = ' . $GLOBALS['xoopsDB']->prefix('wggithub_releases') . '.rel_repoid '; |
|
| 264 | - $sql .= 'SET ' . $GLOBALS['xoopsDB']->prefix('wggithub_repositories') . '.repo_prerelease = 1 '; |
|
| 265 | - $sql .= 'WHERE (((' . $GLOBALS['xoopsDB']->prefix('wggithub_releases') . '.rel_prerelease)=1));'; |
|
| 262 | + $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('wggithub_repositories').' INNER JOIN '.$GLOBALS['xoopsDB']->prefix('wggithub_releases'); |
|
| 263 | + $sql .= ' ON '.$GLOBALS['xoopsDB']->prefix('wggithub_repositories').'.repo_id = '.$GLOBALS['xoopsDB']->prefix('wggithub_releases').'.rel_repoid '; |
|
| 264 | + $sql .= 'SET '.$GLOBALS['xoopsDB']->prefix('wggithub_repositories').'.repo_prerelease = 1 '; |
|
| 265 | + $sql .= 'WHERE ((('.$GLOBALS['xoopsDB']->prefix('wggithub_releases').'.rel_prerelease)=1));'; |
|
| 266 | 266 | $GLOBALS['xoopsDB']->queryF($sql); |
| 267 | 267 | |
| 268 | 268 | // update repo_release |
| 269 | - $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('wggithub_repositories') . ' INNER JOIN ' . $GLOBALS['xoopsDB']->prefix('wggithub_releases'); |
|
| 270 | - $sql .= ' ON ' . $GLOBALS['xoopsDB']->prefix('wggithub_repositories') . '.repo_id = ' . $GLOBALS['xoopsDB']->prefix('wggithub_releases') . '.rel_repoid '; |
|
| 271 | - $sql .= 'SET ' . $GLOBALS['xoopsDB']->prefix('wggithub_repositories') . '.repo_release = 1 '; |
|
| 272 | - $sql .= 'WHERE (((' . $GLOBALS['xoopsDB']->prefix('wggithub_releases') . '.rel_prerelease)=0));'; |
|
| 269 | + $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('wggithub_repositories').' INNER JOIN '.$GLOBALS['xoopsDB']->prefix('wggithub_releases'); |
|
| 270 | + $sql .= ' ON '.$GLOBALS['xoopsDB']->prefix('wggithub_repositories').'.repo_id = '.$GLOBALS['xoopsDB']->prefix('wggithub_releases').'.rel_repoid '; |
|
| 271 | + $sql .= 'SET '.$GLOBALS['xoopsDB']->prefix('wggithub_repositories').'.repo_release = 1 '; |
|
| 272 | + $sql .= 'WHERE ((('.$GLOBALS['xoopsDB']->prefix('wggithub_releases').'.rel_prerelease)=0));'; |
|
| 273 | 273 | $GLOBALS['xoopsDB']->queryF($sql); |
| 274 | 274 | |
| 275 | 275 | return true; |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | $readmesObj->setVar('rm_content', $readme['content']); |
| 167 | 167 | $readmesObj->setVar('rm_encoding', $readme['encoding']); |
| 168 | 168 | $readmesObj->setVar('rm_downloadurl', $readme['download_url']); |
| 169 | - $readmesObj->setVar('rm_datecreated',time()); |
|
| 169 | + $readmesObj->setVar('rm_datecreated', time()); |
|
| 170 | 170 | $readmesObj->setVar('rm_submitter', $submitter); |
| 171 | 171 | // Insert Data |
| 172 | 172 | if (!$readmesHandler->insert($readmesObj)) { |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | $readmesObj->setVar('rm_content', $readme['content']); |
| 228 | 228 | $readmesObj->setVar('rm_encoding', $readme['encoding']); |
| 229 | 229 | $readmesObj->setVar('rm_downloadurl', $readme['download_url']); |
| 230 | - $readmesObj->setVar('rm_datecreated',time()); |
|
| 230 | + $readmesObj->setVar('rm_datecreated', time()); |
|
| 231 | 231 | $readmesObj->setVar('rm_submitter', $submitter); |
| 232 | 232 | // Insert Data |
| 233 | 233 | if (!$readmesHandler->insert($readmesObj)) { |
@@ -132,15 +132,15 @@ |
||
| 132 | 132 | */ |
| 133 | 133 | public function getValuesReleases($keys = null, $format = null, $maxDepth = null) |
| 134 | 134 | { |
| 135 | - $helper = \XoopsModules\Wggithub\Helper::getInstance(); |
|
| 135 | + $helper = \XoopsModules\Wggithub\Helper::getInstance(); |
|
| 136 | 136 | $ret = $this->getValues($keys, $format, $maxDepth); |
| 137 | - $ret['id'] = $this->getVar('rel_id'); |
|
| 137 | + $ret['id'] = $this->getVar('rel_id'); |
|
| 138 | 138 | $repositoriesHandler = $helper->getHandler('Repositories'); |
| 139 | 139 | $repositoriesObj = $repositoriesHandler->get($this->getVar('rel_repoid')); |
| 140 | - $ret['repoid'] = $repositoriesObj->getVar('repo_name'); |
|
| 140 | + $ret['repoid'] = $repositoriesObj->getVar('repo_name'); |
|
| 141 | 141 | $ret['type'] = $this->getVar('rel_type'); |
| 142 | 142 | $ret['name'] = $this->getVar('rel_name'); |
| 143 | - $ret['prerelease'] = (int)$this->getVar('rel_prerelease') > 0 ? _YES : _NO; |
|
| 143 | + $ret['prerelease'] = (int) $this->getVar('rel_prerelease') > 0 ? _YES : _NO; |
|
| 144 | 144 | $ret['publishedat'] = \formatTimestamp($this->getVar('rel_publishedat'), 'm'); |
| 145 | 145 | $ret['tarballurl'] = $this->getVar('rel_tarballurl'); |
| 146 | 146 | $ret['zipballurl'] = $this->getVar('rel_zipballurl'); |
@@ -173,7 +173,7 @@ |
||
| 173 | 173 | $ret = $this->getValues($keys, $format, $maxDepth); |
| 174 | 174 | $ret['id'] = $this->getVar('repo_id'); |
| 175 | 175 | $ret['nodeid'] = $this->getVar('repo_nodeid'); |
| 176 | - $ret['user'] = $this->getVar('repo_user'); |
|
| 176 | + $ret['user'] = $this->getVar('repo_user'); |
|
| 177 | 177 | $ret['name'] = $this->getVar('repo_name'); |
| 178 | 178 | $ret['fullname'] = $this->getVar('repo_fullname'); |
| 179 | 179 | $ret['createdat'] = \formatTimestamp($this->getVar('repo_createdat'), 'm'); |
@@ -167,9 +167,9 @@ |
||
| 167 | 167 | $ret['name'] = $this->getVar('dir_name'); |
| 168 | 168 | $ret['type'] = $this->getVar('dir_type'); |
| 169 | 169 | $ret['type_text'] = Constants::DIRECTORY_TYPE_USER == $this->getVar('dir_type') ? \_AM_WGGITHUB_DIRECTORY_TYPE_USER : \_AM_WGGITHUB_DIRECTORY_TYPE_ORG; |
| 170 | - $ret['autoupdate'] = (int)$this->getVar('dir_autoupdate') > 0 ? _YES : _NO; |
|
| 171 | - $ret['online'] = (int)$this->getVar('dir_online') > 0 ? _YES : _NO; |
|
| 172 | - $ret['filterrelease'] = (int)$this->getVar('dir_filterrelease') > 0 ? _YES : _NO; |
|
| 170 | + $ret['autoupdate'] = (int) $this->getVar('dir_autoupdate') > 0 ? _YES : _NO; |
|
| 171 | + $ret['online'] = (int) $this->getVar('dir_online') > 0 ? _YES : _NO; |
|
| 172 | + $ret['filterrelease'] = (int) $this->getVar('dir_filterrelease') > 0 ? _YES : _NO; |
|
| 173 | 173 | $ret['datecreated'] = \formatTimestamp($this->getVar('dir_datecreated'), 's'); |
| 174 | 174 | $ret['submitter'] = \XoopsUser::getUnameFromId($this->getVar('dir_submitter')); |
| 175 | 175 | return $ret; |