@@ -32,4 +32,4 @@ |
||
| 32 | 32 | $GLOBALS['xoopsTpl']->assign('admin', \WGGITHUB_ADMIN);
|
| 33 | 33 | $GLOBALS['xoopsTpl']->assign('copyright', $copyright);
|
| 34 | 34 | // |
| 35 | -include_once \XOOPS_ROOT_PATH . '/footer.php'; |
|
| 35 | +include_once \XOOPS_ROOT_PATH.'/footer.php'; |
|
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | global $xoopsDB; |
| 33 | 33 | |
| 34 | 34 | if (!\defined('WGGITHUB_URL')) {
|
| 35 | - \define('WGGITHUB_URL', \XOOPS_URL . '/modules/wggithub');
|
|
| 35 | + \define('WGGITHUB_URL', \XOOPS_URL.'/modules/wggithub');
|
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | switch ($category) {
|
@@ -42,11 +42,11 @@ discard block |
||
| 42 | 42 | return $item; |
| 43 | 43 | break; |
| 44 | 44 | case 'repositories': |
| 45 | - $sql = 'SELECT repo_name FROM ' . $xoopsDB->prefix('wggithub_repositories') . ' WHERE repo_id = '. $item_id;
|
|
| 45 | + $sql = 'SELECT repo_name FROM '.$xoopsDB->prefix('wggithub_repositories').' WHERE repo_id = '.$item_id;
|
|
| 46 | 46 | $result = $xoopsDB->query($sql); |
| 47 | 47 | $result_array = $xoopsDB->fetchArray($result); |
| 48 | 48 | $item['name'] = $result_array['repo_name']; |
| 49 | - $item['url'] = \WGGITHUB_URL . '/repositories.php?repo_id=' . $item_id; |
|
| 49 | + $item['url'] = \WGGITHUB_URL.'/repositories.php?repo_id='.$item_id; |
|
| 50 | 50 | return $item; |
| 51 | 51 | break; |
| 52 | 52 | } |
@@ -20,29 +20,29 @@ |
||
| 20 | 20 | * @author Goffy - XOOPS Development Team - Email:<[email protected]> - Website:<https://wedega.com> |
| 21 | 21 | */ |
| 22 | 22 | if (!\defined('XOOPS_ICONS32_PATH')) {
|
| 23 | - \define('XOOPS_ICONS32_PATH', \XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32');
|
|
| 23 | + \define('XOOPS_ICONS32_PATH', \XOOPS_ROOT_PATH.'/Frameworks/moduleclasses/icons/32');
|
|
| 24 | 24 | } |
| 25 | 25 | if (!\defined('XOOPS_ICONS32_URL')) {
|
| 26 | - \define('XOOPS_ICONS32_URL', \XOOPS_URL . '/Frameworks/moduleclasses/icons/32');
|
|
| 26 | + \define('XOOPS_ICONS32_URL', \XOOPS_URL.'/Frameworks/moduleclasses/icons/32');
|
|
| 27 | 27 | } |
| 28 | 28 | \define('WGGITHUB_DIRNAME', 'wggithub');
|
| 29 | -\define('WGGITHUB_PATH', \XOOPS_ROOT_PATH . '/modules/' . \WGGITHUB_DIRNAME);
|
|
| 30 | -\define('WGGITHUB_URL', \XOOPS_URL . '/modules/' . \WGGITHUB_DIRNAME);
|
|
| 31 | -\define('WGGITHUB_ICONS_PATH', \WGGITHUB_PATH . '/assets/icons');
|
|
| 32 | -\define('WGGITHUB_ICONS_URL', \WGGITHUB_URL . '/assets/icons');
|
|
| 33 | -\define('WGGITHUB_IMAGE_PATH', \WGGITHUB_PATH . '/assets/images');
|
|
| 34 | -\define('WGGITHUB_IMAGE_URL', \WGGITHUB_URL . '/assets/images');
|
|
| 35 | -\define('WGGITHUB_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . \WGGITHUB_DIRNAME);
|
|
| 36 | -\define('WGGITHUB_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . \WGGITHUB_DIRNAME);
|
|
| 37 | -\define('WGGITHUB_UPLOAD_FILES_PATH', \WGGITHUB_UPLOAD_PATH . '/files');
|
|
| 38 | -\define('WGGITHUB_UPLOAD_FILES_URL', \WGGITHUB_UPLOAD_URL . '/files');
|
|
| 39 | -\define('WGGITHUB_UPLOAD_IMAGE_PATH', \WGGITHUB_UPLOAD_PATH . '/images');
|
|
| 40 | -\define('WGGITHUB_UPLOAD_IMAGE_URL', \WGGITHUB_UPLOAD_URL . '/images');
|
|
| 41 | -\define('WGGITHUB_UPLOAD_SHOTS_PATH', \WGGITHUB_UPLOAD_PATH . '/images/shots');
|
|
| 42 | -\define('WGGITHUB_UPLOAD_SHOTS_URL', \WGGITHUB_UPLOAD_URL . '/images/shots');
|
|
| 43 | -\define('WGGITHUB_ADMIN', \WGGITHUB_URL . '/admin/index.php');
|
|
| 44 | -$localLogo = \WGGITHUB_IMAGE_URL . '/wedega_logo.png'; |
|
| 29 | +\define('WGGITHUB_PATH', \XOOPS_ROOT_PATH.'/modules/'.\WGGITHUB_DIRNAME);
|
|
| 30 | +\define('WGGITHUB_URL', \XOOPS_URL.'/modules/'.\WGGITHUB_DIRNAME);
|
|
| 31 | +\define('WGGITHUB_ICONS_PATH', \WGGITHUB_PATH.'/assets/icons');
|
|
| 32 | +\define('WGGITHUB_ICONS_URL', \WGGITHUB_URL.'/assets/icons');
|
|
| 33 | +\define('WGGITHUB_IMAGE_PATH', \WGGITHUB_PATH.'/assets/images');
|
|
| 34 | +\define('WGGITHUB_IMAGE_URL', \WGGITHUB_URL.'/assets/images');
|
|
| 35 | +\define('WGGITHUB_UPLOAD_PATH', XOOPS_UPLOAD_PATH.'/'.\WGGITHUB_DIRNAME);
|
|
| 36 | +\define('WGGITHUB_UPLOAD_URL', XOOPS_UPLOAD_URL.'/'.\WGGITHUB_DIRNAME);
|
|
| 37 | +\define('WGGITHUB_UPLOAD_FILES_PATH', \WGGITHUB_UPLOAD_PATH.'/files');
|
|
| 38 | +\define('WGGITHUB_UPLOAD_FILES_URL', \WGGITHUB_UPLOAD_URL.'/files');
|
|
| 39 | +\define('WGGITHUB_UPLOAD_IMAGE_PATH', \WGGITHUB_UPLOAD_PATH.'/images');
|
|
| 40 | +\define('WGGITHUB_UPLOAD_IMAGE_URL', \WGGITHUB_UPLOAD_URL.'/images');
|
|
| 41 | +\define('WGGITHUB_UPLOAD_SHOTS_PATH', \WGGITHUB_UPLOAD_PATH.'/images/shots');
|
|
| 42 | +\define('WGGITHUB_UPLOAD_SHOTS_URL', \WGGITHUB_UPLOAD_URL.'/images/shots');
|
|
| 43 | +\define('WGGITHUB_ADMIN', \WGGITHUB_URL.'/admin/index.php');
|
|
| 44 | +$localLogo = \WGGITHUB_IMAGE_URL.'/wedega_logo.png'; |
|
| 45 | 45 | // Module Information |
| 46 | -$copyright = "<a href='https://wedega.com' title='XOOPS on Wedega' target='_blank'><img src='" . $localLogo . "' alt='XOOPS on Wedega' /></a>"; |
|
| 47 | -include_once \XOOPS_ROOT_PATH . '/class/xoopsrequest.php'; |
|
| 48 | -include_once \WGGITHUB_PATH . '/include/functions.php'; |
|
| 46 | +$copyright = "<a href='https://wedega.com' title='XOOPS on Wedega' target='_blank'><img src='".$localLogo."' alt='XOOPS on Wedega' /></a>"; |
|
| 47 | +include_once \XOOPS_ROOT_PATH.'/class/xoopsrequest.php'; |
|
| 48 | +include_once \WGGITHUB_PATH.'/include/functions.php'; |
|
@@ -59,15 +59,15 @@ discard block |
||
| 59 | 59 | } |
| 60 | 60 | if ($elementCount > 0) {
|
| 61 | 61 | $crKeywords = new \CriteriaCompo(); |
| 62 | - for ($i = 0; $i < $elementCount; $i++) {
|
|
| 63 | - $crKeywords->add(new \Criteria('repo_name', '%' . $queryarray[$i] . '%', 'LIKE'), 'OR');
|
|
| 62 | + for ($i = 0; $i < $elementCount; $i++) {
|
|
| 63 | + $crKeywords->add(new \Criteria('repo_name', '%'.$queryarray[$i].'%', 'LIKE'), 'OR');
|
|
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | // search user(s) |
| 67 | 67 | if ($userid && \is_array($userid)) {
|
| 68 | 68 | $userid = array_map('intval', $userid);
|
| 69 | 69 | $crUser = new \CriteriaCompo(); |
| 70 | - $crUser->add(new \Criteria('repo_submitter', '(' . \implode(',', $userid) . ')', 'IN'), 'OR');
|
|
| 70 | + $crUser->add(new \Criteria('repo_submitter', '('.\implode(',', $userid).')', 'IN'), 'OR');
|
|
| 71 | 71 | } elseif (is_numeric($userid) && $userid > 0) {
|
| 72 | 72 | $crUser = new \CriteriaCompo(); |
| 73 | 73 | $crUser->add(new \Criteria('repo_submitter', $userid), 'OR');
|
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | if (isset($crUser)) {
|
| 80 | 80 | $crSearch->add($crUser, 'AND'); |
| 81 | 81 | } |
| 82 | - if (0 === (int)$helper->getConfig('autoapproved')) {
|
|
| 82 | + if (0 === (int) $helper->getConfig('autoapproved')) {
|
|
| 83 | 83 | $crSearch->add(new \Criteria('repo_approved', 1));
|
| 84 | 84 | } |
| 85 | 85 | $crSearch->add(new \Criteria('repo_status', Constants::STATUS_UPTODATE));
|
@@ -91,8 +91,8 @@ discard block |
||
| 91 | 91 | foreach (\array_keys($repositoriesAll) as $i) {
|
| 92 | 92 | $ret[] = [ |
| 93 | 93 | 'image' => 'assets/icons/16/github.png', |
| 94 | - 'link' => 'index.php?op=show&dir_id=' . $directories[$repositoriesAll[$i]->getVar('repo_user')] . '&repo_id=' . $i,
|
|
| 95 | - 'title' => $repositoriesAll[$i]->getVar('repo_name') . ' (' . $repositoriesAll[$i]->getVar('repo_user') . ')',
|
|
| 94 | + 'link' => 'index.php?op=show&dir_id='.$directories[$repositoriesAll[$i]->getVar('repo_user')].'&repo_id='.$i,
|
|
| 95 | + 'title' => $repositoriesAll[$i]->getVar('repo_name').' ('.$repositoriesAll[$i]->getVar('repo_user').')',
|
|
| 96 | 96 | 'time' => $repositoriesAll[$i]->getVar('repo_datecreated')
|
| 97 | 97 | ]; |
| 98 | 98 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | $cat_sql .= current($cats); |
| 34 | 34 | \array_shift($cats); |
| 35 | 35 | foreach ($cats as $cat) {
|
| 36 | - $cat_sql .= ',' . $cat; |
|
| 36 | + $cat_sql .= ','.$cat; |
|
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | $cat_sql .= ')'; |
@@ -72,9 +72,9 @@ discard block |
||
| 72 | 72 | {
|
| 73 | 73 | global $xoopsTpl, $xoTheme; |
| 74 | 74 | $myts = MyTextSanitizer::getInstance(); |
| 75 | - $content= $myts->undoHtmlSpecialChars($myts->displayTarea($content)); |
|
| 76 | - if(isset($xoTheme) && \is_object($xoTheme)) {
|
|
| 77 | - $xoTheme->addMeta( 'meta', 'keywords', \strip_tags($content)); |
|
| 75 | + $content = $myts->undoHtmlSpecialChars($myts->displayTarea($content)); |
|
| 76 | + if (isset($xoTheme) && \is_object($xoTheme)) {
|
|
| 77 | + $xoTheme->addMeta('meta', 'keywords', \strip_tags($content));
|
|
| 78 | 78 | } else { // Compatibility for old Xoops versions
|
| 79 | 79 | $xoopsTpl->assign('xoops_meta_keywords', \strip_tags($content));
|
| 80 | 80 | } |
@@ -91,8 +91,8 @@ discard block |
||
| 91 | 91 | global $xoopsTpl, $xoTheme; |
| 92 | 92 | $myts = MyTextSanitizer::getInstance(); |
| 93 | 93 | $content = $myts->undoHtmlSpecialChars($myts->displayTarea($content)); |
| 94 | - if(isset($xoTheme) && \is_object($xoTheme)) {
|
|
| 95 | - $xoTheme->addMeta( 'meta', 'description', \strip_tags($content)); |
|
| 94 | + if (isset($xoTheme) && \is_object($xoTheme)) {
|
|
| 95 | + $xoTheme->addMeta('meta', 'description', \strip_tags($content));
|
|
| 96 | 96 | } else { // Compatibility for old Xoops versions
|
| 97 | 97 | $xoopsTpl->assign('xoops_meta_description', \strip_tags($content));
|
| 98 | 98 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | if (0 != $lenght_id) {
|
| 118 | 118 | $id = $array['content_id']; |
| 119 | 119 | while (\strlen($id) < $lenght_id) {
|
| 120 | - $id = '0' . $id; |
|
| 120 | + $id = '0'.$id; |
|
| 121 | 121 | } |
| 122 | 122 | } else {
|
| 123 | 123 | $id = $array['content_id']; |
@@ -132,23 +132,23 @@ discard block |
||
| 132 | 132 | switch ($rewrite_url) {
|
| 133 | 133 | |
| 134 | 134 | case 'none': |
| 135 | - if($topic_name) {
|
|
| 136 | - $topic_name = 'topic=' . $topic_name . '&'; |
|
| 135 | + if ($topic_name) {
|
|
| 136 | + $topic_name = 'topic='.$topic_name.'&'; |
|
| 137 | 137 | } |
| 138 | 138 | $rewrite_base = '/modules/'; |
| 139 | - $page = 'page=' . $array['content_alias']; |
|
| 140 | - return \XOOPS_URL . $rewrite_base . $module . '/' . $type . '.php?' . $topic_name . 'id=' . $id . '&' . $page . $comment; |
|
| 139 | + $page = 'page='.$array['content_alias']; |
|
| 140 | + return \XOOPS_URL.$rewrite_base.$module.'/'.$type.'.php?'.$topic_name.'id='.$id.'&'.$page.$comment; |
|
| 141 | 141 | break; |
| 142 | 142 | |
| 143 | 143 | case 'rewrite': |
| 144 | - if($topic_name) {
|
|
| 144 | + if ($topic_name) {
|
|
| 145 | 145 | $topic_name .= '/'; |
| 146 | 146 | } |
| 147 | 147 | $rewrite_base = xoops_getModuleOption('rewrite_mode', $module);
|
| 148 | 148 | $rewrite_ext = xoops_getModuleOption('rewrite_ext', $module);
|
| 149 | 149 | $module_name = ''; |
| 150 | - if(xoops_getModuleOption('rewrite_name', $module)) {
|
|
| 151 | - $module_name = xoops_getModuleOption('rewrite_name', $module) . '/';
|
|
| 150 | + if (xoops_getModuleOption('rewrite_name', $module)) {
|
|
| 151 | + $module_name = xoops_getModuleOption('rewrite_name', $module).'/';
|
|
| 152 | 152 | } |
| 153 | 153 | $page = $array['content_alias']; |
| 154 | 154 | $type .= '/'; |
@@ -157,21 +157,21 @@ discard block |
||
| 157 | 157 | $type = ''; |
| 158 | 158 | } |
| 159 | 159 | if ('comment-edit/' === $type || 'comment-reply/' === $type || 'comment-delete/' === $type) {
|
| 160 | - return \XOOPS_URL . $rewrite_base . $module_name . $type . $id . '/'; |
|
| 160 | + return \XOOPS_URL.$rewrite_base.$module_name.$type.$id.'/'; |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | - return \XOOPS_URL . $rewrite_base . $module_name . $type . $topic_name . $id . $page . $rewrite_ext; |
|
| 163 | + return \XOOPS_URL.$rewrite_base.$module_name.$type.$topic_name.$id.$page.$rewrite_ext; |
|
| 164 | 164 | break; |
| 165 | 165 | |
| 166 | 166 | case 'short': |
| 167 | - if($topic_name) {
|
|
| 167 | + if ($topic_name) {
|
|
| 168 | 168 | $topic_name .= '/'; |
| 169 | 169 | } |
| 170 | 170 | $rewrite_base = xoops_getModuleOption('rewrite_mode', $module);
|
| 171 | 171 | $rewrite_ext = xoops_getModuleOption('rewrite_ext', $module);
|
| 172 | 172 | $module_name = ''; |
| 173 | - if(xoops_getModuleOption('rewrite_name', $module)) {
|
|
| 174 | - $module_name = xoops_getModuleOption('rewrite_name', $module) . '/';
|
|
| 173 | + if (xoops_getModuleOption('rewrite_name', $module)) {
|
|
| 174 | + $module_name = xoops_getModuleOption('rewrite_name', $module).'/';
|
|
| 175 | 175 | } |
| 176 | 176 | $page = $array['content_alias']; |
| 177 | 177 | $type .= '/'; |
@@ -179,10 +179,10 @@ discard block |
||
| 179 | 179 | $type = ''; |
| 180 | 180 | } |
| 181 | 181 | if ('comment-edit/' === $type || 'comment-reply/' === $type || 'comment-delete/' === $type) {
|
| 182 | - return \XOOPS_URL . $rewrite_base . $module_name . $type . $id . '/'; |
|
| 182 | + return \XOOPS_URL.$rewrite_base.$module_name.$type.$id.'/'; |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | - return \XOOPS_URL . $rewrite_base . $module_name . $type . $topic_name . $page . $rewrite_ext; |
|
| 185 | + return \XOOPS_URL.$rewrite_base.$module_name.$type.$topic_name.$page.$rewrite_ext; |
|
| 186 | 186 | break; |
| 187 | 187 | } |
| 188 | 188 | return null; |
@@ -206,6 +206,6 @@ discard block |
||
| 206 | 206 | $url .= htmlentities($url, ENT_COMPAT, 'utf-8'); |
| 207 | 207 | $url .= \preg_replace('`&([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig);`i', "\1", $url);
|
| 208 | 208 | $url .= \preg_replace([$regular_expression, '`[-]+`'], '-', $url); |
| 209 | - $url = ($url == '') ? $type : strtolower( rim($url, '-')); |
|
| 209 | + $url = ($url == '') ? $type : strtolower(rim($url, '-')); |
|
| 210 | 210 | return $url; |
| 211 | 211 | } |
| 212 | 212 | \ No newline at end of file |
@@ -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)) |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | } else {
|
| 221 | 221 | if ($this->isBlockCompletable($CurrentBlock['type'])) |
| 222 | 222 | {
|
| 223 | - $methodName = 'block' . $CurrentBlock['type'] . 'Complete'; |
|
| 223 | + $methodName = 'block'.$CurrentBlock['type'].'Complete'; |
|
| 224 | 224 | $CurrentBlock = $this->$methodName($CurrentBlock); |
| 225 | 225 | } |
| 226 | 226 | } |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | {
|
| 239 | 239 | foreach ($this->BlockTypes[$marker] as $blockType) |
| 240 | 240 | {
|
| 241 | - $blockTypes []= $blockType; |
|
| 241 | + $blockTypes [] = $blockType; |
|
| 242 | 242 | } |
| 243 | 243 | } |
| 244 | 244 | |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | {
|
| 254 | 254 | $Block['type'] = $blockType; |
| 255 | 255 | |
| 256 | - if ( ! isset($Block['identified'])) |
|
| 256 | + if (!isset($Block['identified'])) |
|
| 257 | 257 | {
|
| 258 | 258 | if (isset($CurrentBlock)) |
| 259 | 259 | {
|
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | |
| 301 | 301 | if (isset($CurrentBlock['continuable']) and $this->isBlockCompletable($CurrentBlock['type'])) |
| 302 | 302 | {
|
| 303 | - $methodName = 'block' . $CurrentBlock['type'] . 'Complete'; |
|
| 303 | + $methodName = 'block'.$CurrentBlock['type'].'Complete'; |
|
| 304 | 304 | $CurrentBlock = $this->$methodName($CurrentBlock); |
| 305 | 305 | } |
| 306 | 306 | |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | |
| 319 | 319 | protected function extractElement(array $Component) |
| 320 | 320 | {
|
| 321 | - if ( ! isset($Component['element'])) |
|
| 321 | + if (!isset($Component['element'])) |
|
| 322 | 322 | {
|
| 323 | 323 | if (isset($Component['markup'])) |
| 324 | 324 | {
|
@@ -333,12 +333,12 @@ discard block |
||
| 333 | 333 | |
| 334 | 334 | protected function isBlockContinuable($Type) |
| 335 | 335 | {
|
| 336 | - return method_exists($this, 'block' . $Type . 'Continue'); |
|
| 336 | + return method_exists($this, 'block'.$Type.'Continue'); |
|
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | protected function isBlockCompletable($Type) |
| 340 | 340 | {
|
| 341 | - return method_exists($this, 'block' . $Type . 'Complete'); |
|
| 341 | + return method_exists($this, 'block'.$Type.'Complete'); |
|
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | # |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | |
| 347 | 347 | protected function blockCode($Line, $Block = null) |
| 348 | 348 | {
|
| 349 | - if (isset($Block) and $Block['type'] === 'Paragraph' and ! isset($Block['interrupted'])) |
|
| 349 | + if (isset($Block) and $Block['type'] === 'Paragraph' and !isset($Block['interrupted'])) |
|
| 350 | 350 | {
|
| 351 | 351 | return; |
| 352 | 352 | } |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | return; |
| 431 | 431 | } |
| 432 | 432 | |
| 433 | - $Block['element']['rawHtml'] .= "\n" . $Line['body']; |
|
| 433 | + $Block['element']['rawHtml'] .= "\n".$Line['body']; |
|
| 434 | 434 | |
| 435 | 435 | if (\strpos($Line['text'], '-->') !== false) |
| 436 | 436 | {
|
@@ -521,7 +521,7 @@ discard block |
||
| 521 | 521 | return $Block; |
| 522 | 522 | } |
| 523 | 523 | |
| 524 | - $Block['element']['element']['text'] .= "\n" . $Line['body']; |
|
| 524 | + $Block['element']['element']['text'] .= "\n".$Line['body']; |
|
| 525 | 525 | |
| 526 | 526 | return $Block; |
| 527 | 527 | } |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | |
| 555 | 555 | $Block = [ |
| 556 | 556 | 'element' => [ |
| 557 | - 'name' => 'h' . $level, |
|
| 557 | + 'name' => 'h'.$level, |
|
| 558 | 558 | 'handler' => [ |
| 559 | 559 | 'function' => 'lineElements', |
| 560 | 560 | 'argument' => $text, |
@@ -581,7 +581,7 @@ discard block |
||
| 581 | 581 | {
|
| 582 | 582 | $contentIndent -= 1; |
| 583 | 583 | $matches[1] = \substr($matches[1], 0, -$contentIndent); |
| 584 | - $matches[3] = \str_repeat(' ', $contentIndent) . $matches[3];
|
|
| 584 | + $matches[3] = \str_repeat(' ', $contentIndent).$matches[3];
|
|
| 585 | 585 | } elseif ($contentIndent === 0) {
|
| 586 | 586 | $matches[1] .= ' '; |
| 587 | 587 | } |
@@ -612,7 +612,7 @@ discard block |
||
| 612 | 612 | if ( |
| 613 | 613 | isset($CurrentBlock) |
| 614 | 614 | and $CurrentBlock['type'] === 'Paragraph' |
| 615 | - and ! isset($CurrentBlock['interrupted']) |
|
| 615 | + and !isset($CurrentBlock['interrupted']) |
|
| 616 | 616 | ) {
|
| 617 | 617 | return; |
| 618 | 618 | } |
@@ -630,7 +630,7 @@ discard block |
||
| 630 | 630 | ] |
| 631 | 631 | ]; |
| 632 | 632 | |
| 633 | - $Block['element']['elements'] []= & $Block['li']; |
|
| 633 | + $Block['element']['elements'] [] = & $Block['li']; |
|
| 634 | 634 | |
| 635 | 635 | return $Block; |
| 636 | 636 | } |
@@ -657,7 +657,7 @@ discard block |
||
| 657 | 657 | ) |
| 658 | 658 | ) {
|
| 659 | 659 | if (isset($Block['interrupted'])) {
|
| 660 | - $Block['li']['handler']['argument'] []= ''; |
|
| 660 | + $Block['li']['handler']['argument'] [] = ''; |
|
| 661 | 661 | |
| 662 | 662 | $Block['loose'] = true; |
| 663 | 663 | |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | ] |
| 680 | 680 | ]; |
| 681 | 681 | |
| 682 | - $Block['element']['elements'] []= & $Block['li']; |
|
| 682 | + $Block['element']['elements'] [] = & $Block['li']; |
|
| 683 | 683 | |
| 684 | 684 | return $Block; |
| 685 | 685 | } elseif ($Line['indent'] < $requiredIndent and $this->blockList($Line)) {
|
@@ -693,7 +693,7 @@ discard block |
||
| 693 | 693 | if ($Line['indent'] >= $requiredIndent) {
|
| 694 | 694 | if (isset($Block['interrupted'])) |
| 695 | 695 | {
|
| 696 | - $Block['li']['handler']['argument'] []= ''; |
|
| 696 | + $Block['li']['handler']['argument'] [] = ''; |
|
| 697 | 697 | |
| 698 | 698 | $Block['loose'] = true; |
| 699 | 699 | |
@@ -702,15 +702,15 @@ discard block |
||
| 702 | 702 | |
| 703 | 703 | $text = \substr($Line['body'], $requiredIndent); |
| 704 | 704 | |
| 705 | - $Block['li']['handler']['argument'] []= $text; |
|
| 705 | + $Block['li']['handler']['argument'] [] = $text; |
|
| 706 | 706 | |
| 707 | 707 | return $Block; |
| 708 | 708 | } |
| 709 | 709 | |
| 710 | - if ( ! isset($Block['interrupted'])) {
|
|
| 710 | + if (!isset($Block['interrupted'])) {
|
|
| 711 | 711 | $text = \preg_replace('/^[ ]{0,'.$requiredIndent.'}+/', '', $Line['body']);
|
| 712 | 712 | |
| 713 | - $Block['li']['handler']['argument'] []= $text; |
|
| 713 | + $Block['li']['handler']['argument'] [] = $text; |
|
| 714 | 714 | |
| 715 | 715 | return $Block; |
| 716 | 716 | } |
@@ -723,7 +723,7 @@ discard block |
||
| 723 | 723 | {
|
| 724 | 724 | if (end($li['handler']['argument']) !== '') |
| 725 | 725 | {
|
| 726 | - $li['handler']['argument'] []= ''; |
|
| 726 | + $li['handler']['argument'] [] = ''; |
|
| 727 | 727 | } |
| 728 | 728 | } |
| 729 | 729 | } |
@@ -759,13 +759,13 @@ discard block |
||
| 759 | 759 | } |
| 760 | 760 | |
| 761 | 761 | if ($Line['text'][0] === '>' and \preg_match('/^>[ ]?+(.*+)/', $Line['text'], $matches)) {
|
| 762 | - $Block['element']['handler']['argument'] []= $matches[1]; |
|
| 762 | + $Block['element']['handler']['argument'] [] = $matches[1]; |
|
| 763 | 763 | |
| 764 | 764 | return $Block; |
| 765 | 765 | } |
| 766 | 766 | |
| 767 | - if ( ! isset($Block['interrupted'])) {
|
|
| 768 | - $Block['element']['handler']['argument'] []= $Line['text']; |
|
| 767 | + if (!isset($Block['interrupted'])) {
|
|
| 768 | + $Block['element']['handler']['argument'] [] = $Line['text']; |
|
| 769 | 769 | |
| 770 | 770 | return $Block; |
| 771 | 771 | } |
@@ -794,7 +794,7 @@ discard block |
||
| 794 | 794 | |
| 795 | 795 | protected function blockSetextHeader($Line, array $Block = null) |
| 796 | 796 | {
|
| 797 | - if ( ! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) {
|
|
| 797 | + if (!isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) {
|
|
| 798 | 798 | return; |
| 799 | 799 | } |
| 800 | 800 | |
@@ -839,7 +839,7 @@ discard block |
||
| 839 | 839 | return; |
| 840 | 840 | } |
| 841 | 841 | |
| 842 | - $Block['element']['rawHtml'] .= "\n" . $Line['body']; |
|
| 842 | + $Block['element']['rawHtml'] .= "\n".$Line['body']; |
|
| 843 | 843 | |
| 844 | 844 | return $Block; |
| 845 | 845 | } |
@@ -874,7 +874,7 @@ discard block |
||
| 874 | 874 | |
| 875 | 875 | protected function blockTable($Line, array $Block = null) |
| 876 | 876 | {
|
| 877 | - if ( ! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) {
|
|
| 877 | + if (!isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) {
|
|
| 878 | 878 | return; |
| 879 | 879 | } |
| 880 | 880 | |
@@ -917,7 +917,7 @@ discard block |
||
| 917 | 917 | $alignment = $alignment === 'left' ? 'center' : 'right'; |
| 918 | 918 | } |
| 919 | 919 | |
| 920 | - $alignments []= $alignment; |
|
| 920 | + $alignments [] = $alignment; |
|
| 921 | 921 | } |
| 922 | 922 | |
| 923 | 923 | # ~ |
@@ -955,7 +955,7 @@ discard block |
||
| 955 | 955 | ]; |
| 956 | 956 | } |
| 957 | 957 | |
| 958 | - $HeaderElements []= $HeaderElement; |
|
| 958 | + $HeaderElements [] = $HeaderElement; |
|
| 959 | 959 | } |
| 960 | 960 | |
| 961 | 961 | # ~ |
@@ -969,16 +969,16 @@ discard block |
||
| 969 | 969 | ], |
| 970 | 970 | ]; |
| 971 | 971 | |
| 972 | - $Block['element']['elements'] []= [ |
|
| 972 | + $Block['element']['elements'] [] = [ |
|
| 973 | 973 | 'name' => 'thead', |
| 974 | 974 | ]; |
| 975 | 975 | |
| 976 | - $Block['element']['elements'] []= [ |
|
| 976 | + $Block['element']['elements'] [] = [ |
|
| 977 | 977 | 'name' => 'tbody', |
| 978 | 978 | 'elements' => [], |
| 979 | 979 | ]; |
| 980 | 980 | |
| 981 | - $Block['element']['elements'][0]['elements'] []= [ |
|
| 981 | + $Block['element']['elements'][0]['elements'] [] = [ |
|
| 982 | 982 | 'name' => 'tr', |
| 983 | 983 | 'elements' => $HeaderElements, |
| 984 | 984 | ]; |
@@ -1021,11 +1021,11 @@ discard block |
||
| 1021 | 1021 | if (isset($Block['alignments'][$index])) |
| 1022 | 1022 | {
|
| 1023 | 1023 | $Element['attributes'] = [ |
| 1024 | - 'style' => 'text-align: ' . $Block['alignments'][$index] . ';', |
|
| 1024 | + 'style' => 'text-align: '.$Block['alignments'][$index].';', |
|
| 1025 | 1025 | ]; |
| 1026 | 1026 | } |
| 1027 | 1027 | |
| 1028 | - $Elements []= $Element; |
|
| 1028 | + $Elements [] = $Element; |
|
| 1029 | 1029 | } |
| 1030 | 1030 | |
| 1031 | 1031 | $Element = [ |
@@ -1033,7 +1033,7 @@ discard block |
||
| 1033 | 1033 | 'elements' => $Elements, |
| 1034 | 1034 | ]; |
| 1035 | 1035 | |
| 1036 | - $Block['element']['elements'][1]['elements'] []= $Element; |
|
| 1036 | + $Block['element']['elements'][1]['elements'] [] = $Element; |
|
| 1037 | 1037 | |
| 1038 | 1038 | return $Block; |
| 1039 | 1039 | } |
@@ -1133,7 +1133,7 @@ discard block |
||
| 1133 | 1133 | |
| 1134 | 1134 | $Inline = $this->{"inline$inlineType"}($Excerpt);
|
| 1135 | 1135 | |
| 1136 | - if ( ! isset($Inline)) |
|
| 1136 | + if (!isset($Inline)) |
|
| 1137 | 1137 | {
|
| 1138 | 1138 | continue; |
| 1139 | 1139 | } |
@@ -1147,7 +1147,7 @@ discard block |
||
| 1147 | 1147 | |
| 1148 | 1148 | # sets a default inline position |
| 1149 | 1149 | |
| 1150 | - if ( ! isset($Inline['position'])) |
|
| 1150 | + if (!isset($Inline['position'])) |
|
| 1151 | 1151 | {
|
| 1152 | 1152 | $Inline['position'] = $markerPosition; |
| 1153 | 1153 | } |
@@ -1191,7 +1191,7 @@ discard block |
||
| 1191 | 1191 | |
| 1192 | 1192 | foreach ($Elements as &$Element) |
| 1193 | 1193 | {
|
| 1194 | - if ( ! isset($Element['autobreak'])) |
|
| 1194 | + if (!isset($Element['autobreak'])) |
|
| 1195 | 1195 | {
|
| 1196 | 1196 | $Element['autobreak'] = false; |
| 1197 | 1197 | } |
@@ -1247,14 +1247,14 @@ discard block |
||
| 1247 | 1247 | $hostnameLabel = '[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?';
|
| 1248 | 1248 | |
| 1249 | 1249 | $commonMarkEmail = '[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]++@'
|
| 1250 | - . $hostnameLabel . '(?:\.' . $hostnameLabel . ')*'; |
|
| 1250 | + . $hostnameLabel.'(?:\.'.$hostnameLabel.')*'; |
|
| 1251 | 1251 | |
| 1252 | 1252 | if (\strpos($Excerpt['text'], '>') !== false |
| 1253 | 1253 | and \preg_match("/^<((mailto:)?$commonMarkEmail)>/i", $Excerpt['text'], $matches)
|
| 1254 | - ){
|
|
| 1254 | + ) {
|
|
| 1255 | 1255 | $url = $matches[1]; |
| 1256 | 1256 | |
| 1257 | - if ( ! isset($matches[2])) |
|
| 1257 | + if (!isset($matches[2])) |
|
| 1258 | 1258 | {
|
| 1259 | 1259 | $url = "mailto:$url"; |
| 1260 | 1260 | } |
@@ -1274,7 +1274,7 @@ discard block |
||
| 1274 | 1274 | |
| 1275 | 1275 | protected function inlineEmphasis($Excerpt) |
| 1276 | 1276 | {
|
| 1277 | - if ( ! isset($Excerpt['text'][1])) |
|
| 1277 | + if (!isset($Excerpt['text'][1])) |
|
| 1278 | 1278 | {
|
| 1279 | 1279 | return; |
| 1280 | 1280 | } |
@@ -1320,12 +1320,12 @@ discard block |
||
| 1320 | 1320 | |
| 1321 | 1321 | protected function inlineImage($Excerpt) |
| 1322 | 1322 | {
|
| 1323 | - if ( ! isset($Excerpt['text'][1]) or $Excerpt['text'][1] !== '[') |
|
| 1323 | + if (!isset($Excerpt['text'][1]) or $Excerpt['text'][1] !== '[') |
|
| 1324 | 1324 | {
|
| 1325 | 1325 | return; |
| 1326 | 1326 | } |
| 1327 | 1327 | |
| 1328 | - $Excerpt['text']= \substr($Excerpt['text'], 1); |
|
| 1328 | + $Excerpt['text'] = \substr($Excerpt['text'], 1); |
|
| 1329 | 1329 | |
| 1330 | 1330 | $Link = $this->inlineLink($Excerpt); |
| 1331 | 1331 | |
@@ -1411,7 +1411,7 @@ discard block |
||
| 1411 | 1411 | $definition = strtolower($Element['handler']['argument']); |
| 1412 | 1412 | } |
| 1413 | 1413 | |
| 1414 | - if ( ! isset($this->DefinitionData['Reference'][$definition])) |
|
| 1414 | + if (!isset($this->DefinitionData['Reference'][$definition])) |
|
| 1415 | 1415 | {
|
| 1416 | 1416 | return; |
| 1417 | 1417 | } |
@@ -1466,7 +1466,7 @@ discard block |
||
| 1466 | 1466 | and \preg_match('/^&(#?+[0-9a-zA-Z]++);/', $Excerpt['text'], $matches)
|
| 1467 | 1467 | ) {
|
| 1468 | 1468 | return [ |
| 1469 | - 'element' => ['rawHtml' => '&' . $matches[1] . ';'], |
|
| 1469 | + 'element' => ['rawHtml' => '&'.$matches[1].';'], |
|
| 1470 | 1470 | 'extent' => \strlen($matches[0]), |
| 1471 | 1471 | ]; |
| 1472 | 1472 | } |
@@ -1476,7 +1476,7 @@ discard block |
||
| 1476 | 1476 | |
| 1477 | 1477 | protected function inlineStrikethrough($Excerpt) |
| 1478 | 1478 | {
|
| 1479 | - if ( ! isset($Excerpt['text'][1])) |
|
| 1479 | + if (!isset($Excerpt['text'][1])) |
|
| 1480 | 1480 | {
|
| 1481 | 1481 | return; |
| 1482 | 1482 | } |
@@ -1499,7 +1499,7 @@ discard block |
||
| 1499 | 1499 | |
| 1500 | 1500 | protected function inlineUrl($Excerpt) |
| 1501 | 1501 | {
|
| 1502 | - if ($this->urlsLinked !== true or ! isset($Excerpt['text'][2]) or $Excerpt['text'][2] !== '/') |
|
| 1502 | + if ($this->urlsLinked !== true or !isset($Excerpt['text'][2]) or $Excerpt['text'][2] !== '/') |
|
| 1503 | 1503 | {
|
| 1504 | 1504 | return; |
| 1505 | 1505 | } |
@@ -1670,7 +1670,7 @@ discard block |
||
| 1670 | 1670 | |
| 1671 | 1671 | if ($hasName) |
| 1672 | 1672 | {
|
| 1673 | - $markup .= '<' . $Element['name']; |
|
| 1673 | + $markup .= '<'.$Element['name']; |
|
| 1674 | 1674 | |
| 1675 | 1675 | if (isset($Element['attributes'])) |
| 1676 | 1676 | {
|
@@ -1728,7 +1728,7 @@ discard block |
||
| 1728 | 1728 | } |
| 1729 | 1729 | } |
| 1730 | 1730 | |
| 1731 | - $markup .= $hasName ? '</' . $Element['name'] . '>' : ''; |
|
| 1731 | + $markup .= $hasName ? '</'.$Element['name'].'>' : ''; |
|
| 1732 | 1732 | } |
| 1733 | 1733 | elseif ($hasName) |
| 1734 | 1734 | {
|
@@ -1757,7 +1757,7 @@ discard block |
||
| 1757 | 1757 | // (autobreak === false) covers both sides of an element |
| 1758 | 1758 | $autoBreak = !$autoBreak ? $autoBreak : $autoBreakNext; |
| 1759 | 1759 | |
| 1760 | - $markup .= ($autoBreak ? "\n" : '') . $this->element($Element); |
|
| 1760 | + $markup .= ($autoBreak ? "\n" : '').$this->element($Element); |
|
| 1761 | 1761 | $autoBreak = $autoBreakNext; |
| 1762 | 1762 | } |
| 1763 | 1763 | |
@@ -1772,7 +1772,7 @@ discard block |
||
| 1772 | 1772 | {
|
| 1773 | 1773 | $Elements = $this->linesElements($lines); |
| 1774 | 1774 | |
| 1775 | - if ( ! \in_array('', $lines)
|
|
| 1775 | + if (!\in_array('', $lines)
|
|
| 1776 | 1776 | and isset($Elements[0]) and isset($Elements[0]['name']) |
| 1777 | 1777 | and $Elements[0]['name'] === 'p' |
| 1778 | 1778 | ) {
|
@@ -1829,12 +1829,12 @@ discard block |
||
| 1829 | 1829 | protected function sanitiseElement(array $Element) |
| 1830 | 1830 | {
|
| 1831 | 1831 | static $goodAttribute = '/^[a-zA-Z0-9][a-zA-Z0-9-_]*+$/'; |
| 1832 | - static $safeUrlNameToAtt = [ |
|
| 1832 | + static $safeUrlNameToAtt = [ |
|
| 1833 | 1833 | 'a' => 'href', |
| 1834 | 1834 | 'img' => 'src', |
| 1835 | 1835 | ]; |
| 1836 | 1836 | |
| 1837 | - if ( ! isset($Element['name'])) |
|
| 1837 | + if (!isset($Element['name'])) |
|
| 1838 | 1838 | {
|
| 1839 | 1839 | unset($Element['attributes']); |
| 1840 | 1840 | return $Element; |
@@ -1845,12 +1845,12 @@ discard block |
||
| 1845 | 1845 | $Element = $this->filterUnsafeUrlInAttribute($Element, $safeUrlNameToAtt[$Element['name']]); |
| 1846 | 1846 | } |
| 1847 | 1847 | |
| 1848 | - if ( ! empty($Element['attributes'])) |
|
| 1848 | + if (!empty($Element['attributes'])) |
|
| 1849 | 1849 | {
|
| 1850 | 1850 | foreach ($Element['attributes'] as $att => $val) |
| 1851 | 1851 | {
|
| 1852 | 1852 | # filter out badly parsed attribute |
| 1853 | - if ( ! \preg_match($goodAttribute, $att)) |
|
| 1853 | + if (!\preg_match($goodAttribute, $att)) |
|
| 1854 | 1854 | {
|
| 1855 | 1855 | unset($Element['attributes'][$att]); |
| 1856 | 1856 | } |
@@ -1951,8 +1951,8 @@ discard block |
||
| 1951 | 1951 | protected $textLevelElements = [ |
| 1952 | 1952 | 'a', 'br', 'bdo', 'abbr', 'blink', 'nextid', 'acronym', 'basefont', |
| 1953 | 1953 | 'b', 'em', 'big', 'cite', 'small', 'spacer', 'listing', |
| 1954 | - 'i', 'rp', 'del', 'code', 'strike', 'marquee', |
|
| 1955 | - 'q', 'rt', 'ins', 'font', 'strong', |
|
| 1954 | + 'i', 'rp', 'del', 'code', 'strike', 'marquee', |
|
| 1955 | + 'q', 'rt', 'ins', 'font', 'strong', |
|
| 1956 | 1956 | 's', 'tt', 'kbd', 'mark', |
| 1957 | 1957 | 'u', 'xm', 'sub', 'nobr', |
| 1958 | 1958 | 'sup', 'ruby', |
@@ -31,94 +31,94 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | class RequestsHandler extends \XoopsPersistableObjectHandler |
| 33 | 33 | { |
| 34 | - /** |
|
| 35 | - * Constructor |
|
| 36 | - * |
|
| 37 | - * @param \XoopsDatabase $db |
|
| 38 | - */ |
|
| 39 | - public function __construct(\XoopsDatabase $db) |
|
| 40 | - { |
|
| 41 | - parent::__construct($db, 'wggithub_requests', Requests::class, 'req_id', 'req_request'); |
|
| 42 | - } |
|
| 34 | + /** |
|
| 35 | + * Constructor |
|
| 36 | + * |
|
| 37 | + * @param \XoopsDatabase $db |
|
| 38 | + */ |
|
| 39 | + public function __construct(\XoopsDatabase $db) |
|
| 40 | + { |
|
| 41 | + parent::__construct($db, 'wggithub_requests', Requests::class, 'req_id', 'req_request'); |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | - /** |
|
| 45 | - * @param bool $isNew |
|
| 46 | - * |
|
| 47 | - * @return object |
|
| 48 | - */ |
|
| 49 | - public function create($isNew = true) |
|
| 50 | - { |
|
| 51 | - return parent::create($isNew); |
|
| 52 | - } |
|
| 44 | + /** |
|
| 45 | + * @param bool $isNew |
|
| 46 | + * |
|
| 47 | + * @return object |
|
| 48 | + */ |
|
| 49 | + public function create($isNew = true) |
|
| 50 | + { |
|
| 51 | + return parent::create($isNew); |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * retrieve a field |
|
| 56 | - * |
|
| 57 | - * @param int $i field id |
|
| 58 | - * @param null fields |
|
| 59 | - * @return mixed reference to the {@link Get} object |
|
| 60 | - */ |
|
| 61 | - public function get($i = null, $fields = null) |
|
| 62 | - { |
|
| 63 | - return parent::get($i, $fields); |
|
| 64 | - } |
|
| 54 | + /** |
|
| 55 | + * retrieve a field |
|
| 56 | + * |
|
| 57 | + * @param int $i field id |
|
| 58 | + * @param null fields |
|
| 59 | + * @return mixed reference to the {@link Get} object |
|
| 60 | + */ |
|
| 61 | + public function get($i = null, $fields = null) |
|
| 62 | + { |
|
| 63 | + return parent::get($i, $fields); |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - /** |
|
| 67 | - * get inserted id |
|
| 68 | - * |
|
| 69 | - * @param null |
|
| 70 | - * @return int reference to the {@link Get} object |
|
| 71 | - */ |
|
| 72 | - public function getInsertId() |
|
| 73 | - { |
|
| 74 | - return $this->db->getInsertId(); |
|
| 75 | - } |
|
| 66 | + /** |
|
| 67 | + * get inserted id |
|
| 68 | + * |
|
| 69 | + * @param null |
|
| 70 | + * @return int reference to the {@link Get} object |
|
| 71 | + */ |
|
| 72 | + public function getInsertId() |
|
| 73 | + { |
|
| 74 | + return $this->db->getInsertId(); |
|
| 75 | + } |
|
| 76 | 76 | |
| 77 | - /** |
|
| 78 | - * Get Count Requests in the database |
|
| 79 | - * @param int $start |
|
| 80 | - * @param int $limit |
|
| 81 | - * @param string $sort |
|
| 82 | - * @param string $order |
|
| 83 | - * @return int |
|
| 84 | - */ |
|
| 85 | - public function getCountRequests($start = 0, $limit = 0, $sort = 'req_id ASC, req_request', $order = 'ASC') |
|
| 86 | - { |
|
| 87 | - $crCountRequests = new \CriteriaCompo(); |
|
| 88 | - $crCountRequests = $this->getRequestsCriteria($crCountRequests, $start, $limit, $sort, $order); |
|
| 89 | - return $this->getCount($crCountRequests); |
|
| 90 | - } |
|
| 77 | + /** |
|
| 78 | + * Get Count Requests in the database |
|
| 79 | + * @param int $start |
|
| 80 | + * @param int $limit |
|
| 81 | + * @param string $sort |
|
| 82 | + * @param string $order |
|
| 83 | + * @return int |
|
| 84 | + */ |
|
| 85 | + public function getCountRequests($start = 0, $limit = 0, $sort = 'req_id ASC, req_request', $order = 'ASC') |
|
| 86 | + { |
|
| 87 | + $crCountRequests = new \CriteriaCompo(); |
|
| 88 | + $crCountRequests = $this->getRequestsCriteria($crCountRequests, $start, $limit, $sort, $order); |
|
| 89 | + return $this->getCount($crCountRequests); |
|
| 90 | + } |
|
| 91 | 91 | |
| 92 | - /** |
|
| 93 | - * Get All Requests in the database |
|
| 94 | - * @param int $start |
|
| 95 | - * @param int $limit |
|
| 96 | - * @param string $sort |
|
| 97 | - * @param string $order |
|
| 98 | - * @return array |
|
| 99 | - */ |
|
| 100 | - public function getAllRequests($start = 0, $limit = 0, $sort = 'req_id ASC, req_request', $order = 'ASC') |
|
| 101 | - { |
|
| 102 | - $crAllRequests = new \CriteriaCompo(); |
|
| 103 | - $crAllRequests = $this->getRequestsCriteria($crAllRequests, $start, $limit, $sort, $order); |
|
| 104 | - return $this->getAll($crAllRequests); |
|
| 105 | - } |
|
| 92 | + /** |
|
| 93 | + * Get All Requests in the database |
|
| 94 | + * @param int $start |
|
| 95 | + * @param int $limit |
|
| 96 | + * @param string $sort |
|
| 97 | + * @param string $order |
|
| 98 | + * @return array |
|
| 99 | + */ |
|
| 100 | + public function getAllRequests($start = 0, $limit = 0, $sort = 'req_id ASC, req_request', $order = 'ASC') |
|
| 101 | + { |
|
| 102 | + $crAllRequests = new \CriteriaCompo(); |
|
| 103 | + $crAllRequests = $this->getRequestsCriteria($crAllRequests, $start, $limit, $sort, $order); |
|
| 104 | + return $this->getAll($crAllRequests); |
|
| 105 | + } |
|
| 106 | 106 | |
| 107 | - /** |
|
| 108 | - * Get Criteria Requests |
|
| 109 | - * @param $crRequests |
|
| 110 | - * @param int $start |
|
| 111 | - * @param int $limit |
|
| 112 | - * @param string $sort |
|
| 113 | - * @param string $order |
|
| 114 | - * @return int |
|
| 115 | - */ |
|
| 116 | - private function getRequestsCriteria($crRequests, $start, $limit, $sort, $order) |
|
| 117 | - { |
|
| 118 | - $crRequests->setStart($start); |
|
| 119 | - $crRequests->setLimit($limit); |
|
| 120 | - $crRequests->setSort($sort); |
|
| 121 | - $crRequests->setOrder($order); |
|
| 122 | - return $crRequests; |
|
| 123 | - } |
|
| 107 | + /** |
|
| 108 | + * Get Criteria Requests |
|
| 109 | + * @param $crRequests |
|
| 110 | + * @param int $start |
|
| 111 | + * @param int $limit |
|
| 112 | + * @param string $sort |
|
| 113 | + * @param string $order |
|
| 114 | + * @return int |
|
| 115 | + */ |
|
| 116 | + private function getRequestsCriteria($crRequests, $start, $limit, $sort, $order) |
|
| 117 | + { |
|
| 118 | + $crRequests->setStart($start); |
|
| 119 | + $crRequests->setLimit($limit); |
|
| 120 | + $crRequests->setSort($sort); |
|
| 121 | + $crRequests->setOrder($order); |
|
| 122 | + return $crRequests; |
|
| 123 | + } |
|
| 124 | 124 | } |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | |
| 65 | 65 | $this->storage->set('auth.state', $state);
|
| 66 | 66 | |
| 67 | - $url = $this->authUrl . '?' . \http_build_query($params); |
|
| 67 | + $url = $this->authUrl.'?'.\http_build_query($params); |
|
| 68 | 68 | if ($redirectCb === NULL) {
|
| 69 | 69 | header("Location: $url");
|
| 70 | 70 | die(); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $logsHandler = $this->helper->getHandler('Logs');
|
| 85 | 85 | $logsHandler->updateTableLogs(Constants::LOG_TYPE_REQUEST, '', 'START Test API1'); |
| 86 | 86 | |
| 87 | - $url = static::BASE_URL . $url; |
|
| 87 | + $url = static::BASE_URL.$url; |
|
| 88 | 88 | $logsHandler->updateTableLogs(Constants::LOG_TYPE_REQUEST, $url, 'URL'); |
| 89 | 89 | $data = $this->_get($url); |
| 90 | 90 | |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | $token = new Github\OAuth\Token('{myKey}', 'bearer', ['repo', 'user', 'public_repo']);
|
| 101 | 101 | $api->setToken($token); |
| 102 | - $response = $api->get(static::BASE_URL . $url); |
|
| 102 | + $response = $api->get(static::BASE_URL.$url); |
|
| 103 | 103 | |
| 104 | 104 | $data = $api->decode($response); |
| 105 | 105 | |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | $logsHandler = $this->helper->getHandler('Logs');
|
| 125 | 125 | $logsHandler->updateTableLogs(Constants::LOG_TYPE_REQUEST, '', 'START Test UserRepositories'); |
| 126 | 126 | |
| 127 | - $url = static::BASE_URL . 'users/' . \rawurlencode($this->userAuth) . '/repos?per_page=1&page=1'; |
|
| 127 | + $url = static::BASE_URL.'users/'.\rawurlencode($this->userAuth).'/repos?per_page=1&page=1'; |
|
| 128 | 128 | $logsHandler->updateTableLogs(Constants::LOG_TYPE_REQUEST, $url, 'URL'); |
| 129 | 129 | |
| 130 | 130 | $data = $this->_get($url); |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | public function getUserRepositories($username, $per_page = 100, $page = 1) |
| 147 | 147 | {
|
| 148 | - $url = static::BASE_URL . 'users/' . \rawurlencode($username) . '/repos?per_page=' . $per_page . '&page=' . $page; |
|
| 148 | + $url = static::BASE_URL.'users/'.\rawurlencode($username).'/repos?per_page='.$per_page.'&page='.$page; |
|
| 149 | 149 | |
| 150 | 150 | return $this->_get($url); |
| 151 | 151 | } |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | */ |
| 161 | 161 | public function getOrgRepositories($org, $per_page = 100, $page = 1) |
| 162 | 162 | {
|
| 163 | - $url = static::BASE_URL . 'orgs/' . \rawurlencode($org) . '/repos?per_page=' . $per_page . '&page=' . $page; |
|
| 163 | + $url = static::BASE_URL.'orgs/'.\rawurlencode($org).'/repos?per_page='.$per_page.'&page='.$page; |
|
| 164 | 164 | |
| 165 | 165 | return $this->_get($url); |
| 166 | 166 | } |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | */ |
| 175 | 175 | public function getReadme($username, $repository) |
| 176 | 176 | {
|
| 177 | - $url = static::BASE_URL . 'repos/' . \rawurlencode($username) . '/' . \rawurlencode($repository) . '/readme'; |
|
| 177 | + $url = static::BASE_URL.'repos/'.\rawurlencode($username).'/'.\rawurlencode($repository).'/readme'; |
|
| 178 | 178 | |
| 179 | 179 | return $this->_get($url, true); |
| 180 | 180 | } |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | */ |
| 189 | 189 | public function getReleases($username, $repository) |
| 190 | 190 | {
|
| 191 | - $url = static::BASE_URL . 'repos/' . $username . '/' . $repository . '/releases'; |
|
| 191 | + $url = static::BASE_URL.'repos/'.$username.'/'.$repository.'/releases'; |
|
| 192 | 192 | |
| 193 | 193 | return $this->_get($url, true); |
| 194 | 194 | } |
@@ -205,9 +205,9 @@ discard block |
||
| 205 | 205 | {
|
| 206 | 206 | //function currently not used |
| 207 | 207 | if ($prerelease) {
|
| 208 | - $url = static::BASE_URL . 'repos/' . $username . '/' . $repository . '/releases'; |
|
| 208 | + $url = static::BASE_URL.'repos/'.$username.'/'.$repository.'/releases'; |
|
| 209 | 209 | } else {
|
| 210 | - $url = static::BASE_URL . 'repos/' . $username . '/' . $repository . '/releases/latest'; |
|
| 210 | + $url = static::BASE_URL.'repos/'.$username.'/'.$repository.'/releases/latest'; |
|
| 211 | 211 | } |
| 212 | 212 | $result = $this->_get($url); |
| 213 | 213 | |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | */ |
| 232 | 232 | public function getRepositoryContent($username, $repository) |
| 233 | 233 | {
|
| 234 | - $url = static::BASE_URL . 'repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/contents'; |
|
| 234 | + $url = static::BASE_URL.'repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/contents'; |
|
| 235 | 235 | |
| 236 | 236 | return $this->_get($url); |
| 237 | 237 | } |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | } else {
|
| 265 | 265 | $error = true; |
| 266 | 266 | $errMsg = $response->getContent(); |
| 267 | - $logsHandler->updateTableLogs(Constants::LOG_TYPE_ERROR, $errMsg, 'ERROR ' . $code); |
|
| 267 | + $logsHandler->updateTableLogs(Constants::LOG_TYPE_ERROR, $errMsg, 'ERROR '.$code); |
|
| 268 | 268 | } |
| 269 | 269 | } |
| 270 | 270 | if ($error) {
|
@@ -285,13 +285,13 @@ discard block |
||
| 285 | 285 | break; |
| 286 | 286 | case 0: |
| 287 | 287 | default: |
| 288 | - $message = \_MA_WGGITHUB_READGH_ERROR_API . '(' .$code . ' - ' . $errMsg . ')';
|
|
| 288 | + $message = \_MA_WGGITHUB_READGH_ERROR_API.'('.$code.' - '.$errMsg.')';
|
|
| 289 | 289 | break; |
| 290 | 290 | } |
| 291 | - \redirect_header('index.php?op=api_error&message='. $message . '&url='. $url, 5, $message);
|
|
| 291 | + \redirect_header('index.php?op=api_error&message='.$message.'&url='.$url, 5, $message);
|
|
| 292 | 292 | //throw new \RuntimeException('"' . $message . '"');
|
| 293 | 293 | } else {
|
| 294 | - $data = (array)$api->decode($response); |
|
| 294 | + $data = (array) $api->decode($response); |
|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | return $data; |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | $setting = $settingsHandler->getPrimarySetting(); |
| 370 | 370 | |
| 371 | 371 | if (0 == \count($setting)) {
|
| 372 | - \redirect_header(\XOOPS_URL . '/index.php', 3, \_AM_WGGITHUB_THEREARENT_SETTINGS); |
|
| 372 | + \redirect_header(\XOOPS_URL.'/index.php', 3, \_AM_WGGITHUB_THEREARENT_SETTINGS); |
|
| 373 | 373 | } |
| 374 | 374 | $this->userAuth = $setting['user']; |
| 375 | 375 | $this->tokenAuth = $setting['token']; |