Passed
Push — master ( a44753...55161e )
by Goffy
03:59
created
include/search.inc.php 1 patch
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -35,60 +35,60 @@
 block discarded – undo
35 35
  */
36 36
 function wggithub_search($queryarray, $andor, $limit, $offset, $userid)
37 37
 {
38
-	$ret = [];
39
-	$helper = \XoopsModules\Wggithub\Helper::getInstance();
38
+    $ret = [];
39
+    $helper = \XoopsModules\Wggithub\Helper::getInstance();
40 40
 
41
-	// search in table repositories
42
-	// search keywords
43
-	$elementCount = 0;
44
-	$repositoriesHandler = $helper->getHandler('Repositories');
45
-	if (\is_array($queryarray)) {
46
-		$elementCount = \count($queryarray);
47
-	}
48
-	if ($elementCount > 0) {
49
-		$crKeywords = new \CriteriaCompo();
50
-		for ($i = 0; $i  <  $elementCount; $i++) {
51
-			$crKeyword = new \CriteriaCompo();
52
-			unset($crKeyword);
53
-		}
54
-	}
55
-	// search user(s)
56
-	if ($userid && \is_array($userid)) {
57
-		$userid = array_map('intval', $userid);
58
-		$crUser = new \CriteriaCompo();
59
-		$crUser->add(new \Criteria('repo_submitter', '(' . \implode(',', $userid) . ')', 'IN'), 'OR');
60
-	} elseif (is_numeric($userid) && $userid > 0) {
61
-		$crUser = new \CriteriaCompo();
62
-		$crUser->add(new \Criteria('repo_submitter', $userid), 'OR');
63
-	}
64
-	$crSearch = new \CriteriaCompo();
65
-	if (isset($crKeywords)) {
66
-		$crSearch->add($crKeywords, 'AND');
67
-	}
68
-	if (isset($crUser)) {
69
-		$crSearch->add($crUser, 'AND');
70
-	}
71
-	$crSearch->setStart($offset);
72
-	$crSearch->setLimit($limit);
73
-	$crSearch->setSort('repo_datecreated');
74
-	$crSearch->setOrder('DESC');
75
-	$repositoriesAll = $repositoriesHandler->getAll($crSearch);
76
-	foreach (\array_keys($repositoriesAll) as $i) {
77
-		$ret[] = [
78
-			'image'  => 'assets/icons/16/repositories.png',
79
-			'link'   => 'repositories.php?op=show&amp;repo_id=' . $repositoriesAll[$i]->getVar('repo_id'),
80
-			'title'  => $repositoriesAll[$i]->getVar('repo_name'),
81
-			'time'   => $repositoriesAll[$i]->getVar('repo_datecreated')
82
-		];
83
-	}
84
-	unset($crKeywords);
85
-	unset($crKeyword);
86
-	unset($crUser);
87
-	unset($crSearch);
41
+    // search in table repositories
42
+    // search keywords
43
+    $elementCount = 0;
44
+    $repositoriesHandler = $helper->getHandler('Repositories');
45
+    if (\is_array($queryarray)) {
46
+        $elementCount = \count($queryarray);
47
+    }
48
+    if ($elementCount > 0) {
49
+        $crKeywords = new \CriteriaCompo();
50
+        for ($i = 0; $i  <  $elementCount; $i++) {
51
+            $crKeyword = new \CriteriaCompo();
52
+            unset($crKeyword);
53
+        }
54
+    }
55
+    // search user(s)
56
+    if ($userid && \is_array($userid)) {
57
+        $userid = array_map('intval', $userid);
58
+        $crUser = new \CriteriaCompo();
59
+        $crUser->add(new \Criteria('repo_submitter', '(' . \implode(',', $userid) . ')', 'IN'), 'OR');
60
+    } elseif (is_numeric($userid) && $userid > 0) {
61
+        $crUser = new \CriteriaCompo();
62
+        $crUser->add(new \Criteria('repo_submitter', $userid), 'OR');
63
+    }
64
+    $crSearch = new \CriteriaCompo();
65
+    if (isset($crKeywords)) {
66
+        $crSearch->add($crKeywords, 'AND');
67
+    }
68
+    if (isset($crUser)) {
69
+        $crSearch->add($crUser, 'AND');
70
+    }
71
+    $crSearch->setStart($offset);
72
+    $crSearch->setLimit($limit);
73
+    $crSearch->setSort('repo_datecreated');
74
+    $crSearch->setOrder('DESC');
75
+    $repositoriesAll = $repositoriesHandler->getAll($crSearch);
76
+    foreach (\array_keys($repositoriesAll) as $i) {
77
+        $ret[] = [
78
+            'image'  => 'assets/icons/16/repositories.png',
79
+            'link'   => 'repositories.php?op=show&amp;repo_id=' . $repositoriesAll[$i]->getVar('repo_id'),
80
+            'title'  => $repositoriesAll[$i]->getVar('repo_name'),
81
+            'time'   => $repositoriesAll[$i]->getVar('repo_datecreated')
82
+        ];
83
+    }
84
+    unset($crKeywords);
85
+    unset($crKeyword);
86
+    unset($crUser);
87
+    unset($crSearch);
88 88
 
89 89
 
90 90
 
91 91
 
92
-	return $ret;
92
+    return $ret;
93 93
 
94 94
 }
Please login to merge, or discard this patch.
include/update.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     $ret = wggithub_check_db($module);
40 40
 
41 41
     //check upload directory
42
-	include_once __DIR__ . '/install.php';
42
+    include_once __DIR__ . '/install.php';
43 43
     $ret = xoops_module_install_wggithub($module);
44 44
 
45 45
     $errors = $module->getErrors();
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 function wggithub_check_db($module)
114 114
 {
115 115
     $ret = true;
116
-	//insert here code for database check
116
+    //insert here code for database check
117 117
 
118 118
     // Example: update table (add new field)
119 119
     $table   = $GLOBALS['xoopsDB']->prefix('wggithub_repositories');
Please login to merge, or discard this patch.
include/notification.inc.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -29,26 +29,26 @@
 block discarded – undo
29 29
  */
30 30
 function wggithub_notify_iteminfo($category, $item_id)
31 31
 {
32
-	global $xoopsDB;
32
+    global $xoopsDB;
33 33
 
34
-	if (!\defined('WGGITHUB_URL')) {
35
-		\define('WGGITHUB_URL', \XOOPS_URL . '/modules/wggithub');
36
-	}
34
+    if (!\defined('WGGITHUB_URL')) {
35
+        \define('WGGITHUB_URL', \XOOPS_URL . '/modules/wggithub');
36
+    }
37 37
 
38
-	switch ($category) {
39
-		case 'global':
40
-			$item['name'] = '';
41
-			$item['url']  = '';
42
-			return $item;
43
-			break;
44
-		case 'repositories':
45
-			$sql          = 'SELECT repo_name FROM ' . $xoopsDB->prefix('wggithub_repositories') . ' WHERE repo_id = '. $item_id;
46
-			$result       = $xoopsDB->query($sql);
47
-			$result_array = $xoopsDB->fetchArray($result);
48
-			$item['name'] = $result_array['repo_name'];
49
-			$item['url']  = WGGITHUB_URL . '/repositories.php?repo_id=' . $item_id;
50
-			return $item;
51
-			break;
52
-	}
53
-	return null;
38
+    switch ($category) {
39
+        case 'global':
40
+            $item['name'] = '';
41
+            $item['url']  = '';
42
+            return $item;
43
+            break;
44
+        case 'repositories':
45
+            $sql          = 'SELECT repo_name FROM ' . $xoopsDB->prefix('wggithub_repositories') . ' WHERE repo_id = '. $item_id;
46
+            $result       = $xoopsDB->query($sql);
47
+            $result_array = $xoopsDB->fetchArray($result);
48
+            $item['name'] = $result_array['repo_name'];
49
+            $item['url']  = WGGITHUB_URL . '/repositories.php?repo_id=' . $item_id;
50
+            return $item;
51
+            break;
52
+    }
53
+    return null;
54 54
 }
Please login to merge, or discard this patch.
include/install.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@
 block discarded – undo
84 84
             $dest = $configurator->copyBlankFiles[$i] . '/blank.gif';
85 85
             $utility::copyFile($file, $dest);
86 86
         }
87
-		$file = \dirname(__DIR__) . '/assets/images/blank.png';
87
+        $file = \dirname(__DIR__) . '/assets/images/blank.png';
88 88
         foreach (\array_keys($configurator->copyBlankFiles) as $i) {
89 89
             $dest = $configurator->copyBlankFiles[$i] . '/blank.png';
90 90
             $utility::copyFile($file, $dest);
Please login to merge, or discard this patch.
include/common.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,10 +20,10 @@
 block discarded – undo
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 29
 \define('WGGITHUB_PATH', XOOPS_ROOT_PATH . '/modules/' . WGGITHUB_DIRNAME);
Please login to merge, or discard this patch.
include/functions.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -28,16 +28,16 @@  discard block
 block discarded – undo
28 28
  */
29 29
 function wggithub_block_addCatSelect($cats)
30 30
 {
31
-	$cat_sql = '(';
32
-	if (\is_array($cats)) {
33
-		$cat_sql .= current($cats);
34
-		array_shift($cats);
35
-		foreach ($cats as $cat) {
36
-			$cat_sql .= ',' . $cat;
37
-		}
38
-	}
39
-	$cat_sql .= ')';
40
-	return $cat_sql;
31
+    $cat_sql = '(';
32
+    if (\is_array($cats)) {
33
+        $cat_sql .= current($cats);
34
+        array_shift($cats);
35
+        foreach ($cats as $cat) {
36
+            $cat_sql .= ',' . $cat;
37
+        }
38
+    }
39
+    $cat_sql .= ')';
40
+    return $cat_sql;
41 41
 }
42 42
 
43 43
 /**
@@ -49,17 +49,17 @@  discard block
 block discarded – undo
49 49
  */
50 50
 function wggithubGetMyItemIds($permtype, $dirname)
51 51
 {
52
-	global $xoopsUser;
53
-	static $permissions = [];
54
-	if (\is_array($permissions) && \array_key_exists($permtype, $permissions)) {
55
-		return $permissions[$permtype];
56
-	}
57
-	$moduleHandler = \xoops_getHandler('module');
58
-	$wggithubModule = $moduleHandler->getByDirname($dirname);
59
-	$groups = \is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
60
-	$grouppermHandler = \xoops_getHandler('groupperm');
61
-	$itemIds = $grouppermHandler->getItemIds($permtype, $groups, $wggithubModule->getVar('mid'));
62
-	return $itemIds;
52
+    global $xoopsUser;
53
+    static $permissions = [];
54
+    if (\is_array($permissions) && \array_key_exists($permtype, $permissions)) {
55
+        return $permissions[$permtype];
56
+    }
57
+    $moduleHandler = \xoops_getHandler('module');
58
+    $wggithubModule = $moduleHandler->getByDirname($dirname);
59
+    $groups = \is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
60
+    $grouppermHandler = \xoops_getHandler('groupperm');
61
+    $itemIds = $grouppermHandler->getItemIds($permtype, $groups, $wggithubModule->getVar('mid'));
62
+    return $itemIds;
63 63
 }
64 64
 
65 65
 /**
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 
134 134
         case 'none':
135 135
             if($topic_name) {
136
-                 $topic_name = 'topic=' . $topic_name . '&amp;';
136
+                    $topic_name = 'topic=' . $topic_name . '&amp;';
137 137
             }
138 138
             $rewrite_base = '/modules/';
139 139
             $page = 'page=' . $array['content_alias'];
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
             return XOOPS_URL . $rewrite_base . $module_name . $type . $topic_name  . $id . $page . $rewrite_ext;
164 164
             break;
165 165
 
166
-         case 'short':
166
+            case 'short':
167 167
             if($topic_name) {
168 168
                 $topic_name .= '/';
169 169
             }
Please login to merge, or discard this patch.
lib/Github/Psr/Enum/Enum.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
     public function __construct($value)
50 50
     {
51 51
         if ($value instanceof static) {
52
-           /** @psalm-var T */
52
+            /** @psalm-var T */
53 53
             $value = $value->getValue();
54 54
         }
55 55
 
Please login to merge, or discard this patch.
lib/Github/Http/Client/Common/Plugin/AddPathPlugin.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,8 +69,8 @@
 block discarded – undo
69 69
 
70 70
         if (\substr($path, 0, \strlen($prepend)) !== $prepend) {
71 71
             $request = $request->withUri($request->getUri()
72
-                 ->withPath($prepend.$path)
73
-             );
72
+                    ->withPath($prepend.$path)
73
+                );
74 74
         }
75 75
 
76 76
         return $next($request);
Please login to merge, or discard this patch.
lib/Github/Http/Client/CurlHttpClient.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
 
40 40
     private $defaultOptions = self::OPTIONS_DEFAULTS + [
41 41
         'auth_ntlm' => null, // array|string - an array containing the username as first value, and optionally the
42
-                             //   password as the second one; or string like username:password - enabling NTLM auth
42
+                                //   password as the second one; or string like username:password - enabling NTLM auth
43 43
         'extra' => [
44 44
             'curl' => [],    // A list of extra curl options indexed by their corresponding CURLOPT_*
45 45
         ],
Please login to merge, or discard this patch.