Test Setup Failed
Pull Request — master (#519)
by
unknown
01:04
created
lib/PageAllTags.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 
9 9
 class PageAllTags extends Page
10 10
 {
11
-    public function InitializeContent ()
11
+    public function InitializeContent()
12 12
     {
13 13
         $this->title = localize("tags.title");
14 14
         $this->entryArray = Tag::getAllTags();
Please login to merge, or discard this patch.
lib/PageTagDetail.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,11 +8,11 @@
 block discarded – undo
8 8
 
9 9
 class PageTagDetail extends Page
10 10
 {
11
-    public function InitializeContent ()
11
+    public function InitializeContent()
12 12
     {
13
-        $tag = Tag::getTagById ($this->idGet);
14
-        $this->idPage = $tag->getEntryId ();
13
+        $tag = Tag::getTagById($this->idGet);
14
+        $this->idPage = $tag->getEntryId();
15 15
         $this->title = $tag->name;
16
-        list ($this->entryArray, $this->totalNumber) = Book::getBooksByTag ($this->idGet, $this->n);
16
+        list ($this->entryArray, $this->totalNumber) = Book::getBooksByTag($this->idGet, $this->n);
17 17
     }
18 18
 }
Please login to merge, or discard this patch.
lib/PageLanguageDetail.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,11 +8,11 @@
 block discarded – undo
8 8
 
9 9
 class PageLanguageDetail extends Page
10 10
 {
11
-    public function InitializeContent ()
11
+    public function InitializeContent()
12 12
     {
13
-        $language = Language::getLanguageById ($this->idGet);
14
-        $this->idPage = $language->getEntryId ();
13
+        $language = Language::getLanguageById($this->idGet);
14
+        $this->idPage = $language->getEntryId();
15 15
         $this->title = $language->lang_code;
16
-        list ($this->entryArray, $this->totalNumber) = Book::getBooksByLanguage ($this->idGet, $this->n);
16
+        list ($this->entryArray, $this->totalNumber) = Book::getBooksByLanguage($this->idGet, $this->n);
17 17
     }
18 18
 }
Please login to merge, or discard this patch.
lib/CustomColumnTypeFloat.php 2 patches
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     public function getDescription()
56 56
     {
57 57
         $desc = $this->getDatabaseDescription();
58
-        if ($desc === NULL || empty($desc)) $desc = str_format(localize("customcolumn.description"), $this->getTitle());
58
+        if ($desc === null || empty($desc)) $desc = str_format(localize("customcolumn.description"), $this->getTitle());
59 59
         return $desc;
60 60
     }
61 61
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         if ($post = $result->fetchObject()) {
69 69
             return new CustomColumn($post->value, $post->value, $this);
70 70
         }
71
-        return new CustomColumn(NULL, localize("customcolumn.float.unknown"), $this);
71
+        return new CustomColumn(null, localize("customcolumn.float.unknown"), $this);
72 72
     }
73 73
 
74 74
     public function isSearchable()
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,9 @@
 block discarded – undo
55 55
     public function getDescription()
56 56
     {
57 57
         $desc = $this->getDatabaseDescription();
58
-        if ($desc === NULL || empty($desc)) $desc = str_format(localize("customcolumn.description"), $this->getTitle());
58
+        if ($desc === NULL || empty($desc)) {
59
+            $desc = str_format(localize("customcolumn.description"), $this->getTitle());
60
+        }
59 61
         return $desc;
60 62
     }
61 63
 
Please login to merge, or discard this patch.
lib/PageQueryResult.php 3 patches
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -15,16 +15,16 @@  discard block
 block discarded – undo
15 15
     const SCOPE_BOOK = "book";
16 16
     const SCOPE_PUBLISHER = "publisher";
17 17
 
18
-    private function useTypeahead () {
19
-        return !is_null (getURLParam ("search"));
18
+    private function useTypeahead() {
19
+        return !is_null(getURLParam("search"));
20 20
     }
21 21
 
22
-    private function searchByScope ($scope, $limit = FALSE) {
22
+    private function searchByScope($scope, $limit = FALSE) {
23 23
         $n = $this->n;
24 24
         $numberPerPage = NULL;
25 25
         $queryNormedAndUp = trim($this->query);
26
-        if (useNormAndUp ()) {
27
-            $queryNormedAndUp = normAndUp ($this->query);
26
+        if (useNormAndUp()) {
27
+            $queryNormedAndUp = normAndUp($this->query);
28 28
         }
29 29
         if ($limit) {
30 30
             $n = 1;
@@ -32,59 +32,59 @@  discard block
 block discarded – undo
32 32
         }
33 33
         switch ($scope) {
34 34
             case self::SCOPE_BOOK :
35
-                $array = Book::getBooksByStartingLetter ('%' . $queryNormedAndUp, $n, NULL, $numberPerPage);
35
+                $array = Book::getBooksByStartingLetter('%' . $queryNormedAndUp, $n, NULL, $numberPerPage);
36 36
                 break;
37 37
             case self::SCOPE_AUTHOR :
38
-                $array = Author::getAuthorsForSearch ('%' . $queryNormedAndUp);
38
+                $array = Author::getAuthorsForSearch('%' . $queryNormedAndUp);
39 39
                 break;
40 40
             case self::SCOPE_SERIES :
41
-                $array = Serie::getAllSeriesByQuery ($queryNormedAndUp);
41
+                $array = Serie::getAllSeriesByQuery($queryNormedAndUp);
42 42
                 break;
43 43
             case self::SCOPE_TAG :
44
-                $array = Tag::getAllTagsByQuery ($queryNormedAndUp, $n, NULL, $numberPerPage);
44
+                $array = Tag::getAllTagsByQuery($queryNormedAndUp, $n, NULL, $numberPerPage);
45 45
                 break;
46 46
             case self::SCOPE_PUBLISHER :
47
-                $array = Publisher::getAllPublishersByQuery ($queryNormedAndUp);
47
+                $array = Publisher::getAllPublishersByQuery($queryNormedAndUp);
48 48
                 break;
49 49
             default:
50
-                $array = Book::getBooksByQuery (
51
-                    array ("all" => "%" . $queryNormedAndUp . "%"), $n);
50
+                $array = Book::getBooksByQuery(
51
+                    array("all" => "%" . $queryNormedAndUp . "%"), $n);
52 52
         }
53 53
 
54 54
         return $array;
55 55
     }
56 56
 
57
-    public function doSearchByCategory () {
58
-        $database = GetUrlParam (DB);
59
-        $out = array ();
57
+    public function doSearchByCategory() {
58
+        $database = GetUrlParam(DB);
59
+        $out = array();
60 60
         $pagequery = Base::PAGE_OPENSEARCH_QUERY;
61
-        $dbArray = array ("");
61
+        $dbArray = array("");
62 62
         $d = $database;
63 63
         $query = $this->query;
64 64
         // Special case when no databases were chosen, we search on all databases
65
-        if (Base::noDatabaseSelected ()) {
66
-            $dbArray = Base::getDbNameList ();
65
+        if (Base::noDatabaseSelected()) {
66
+            $dbArray = Base::getDbNameList();
67 67
             $d = 0;
68 68
         }
69 69
         foreach ($dbArray as $key) {
70
-            if (Base::noDatabaseSelected ()) {
71
-                array_push ($this->entryArray, new Entry ($key, DB . ":query:{$d}",
70
+            if (Base::noDatabaseSelected()) {
71
+                array_push($this->entryArray, new Entry($key, DB . ":query:{$d}",
72 72
                                         " ", "text",
73
-                                        array ( new LinkNavigation ("?" . DB . "={$d}")), "tt-header"));
74
-                Base::getDb ($d);
73
+                                        array(new LinkNavigation("?" . DB . "={$d}")), "tt-header"));
74
+                Base::getDb($d);
75 75
             }
76
-            foreach (array (PageQueryResult::SCOPE_BOOK,
76
+            foreach (array(PageQueryResult::SCOPE_BOOK,
77 77
                             PageQueryResult::SCOPE_AUTHOR,
78 78
                             PageQueryResult::SCOPE_SERIES,
79 79
                             PageQueryResult::SCOPE_TAG,
80 80
                             PageQueryResult::SCOPE_PUBLISHER) as $key) {
81
-                if (in_array($key, getCurrentOption ('ignored_categories'))) {
81
+                if (in_array($key, getCurrentOption('ignored_categories'))) {
82 82
                     continue;
83 83
                 }
84
-                $array = $this->searchByScope ($key, TRUE);
84
+                $array = $this->searchByScope($key, TRUE);
85 85
 
86 86
                 $i = 0;
87
-                if (count ($array) == 2 && is_array ($array [0])) {
87
+                if (count($array) == 2 && is_array($array [0])) {
88 88
                     $total = $array [1];
89 89
                     $array = $array [0];
90 90
                 } else {
@@ -97,32 +97,32 @@  discard block
 block discarded – undo
97 97
                     // str_format (localize("seriesword", count($array))
98 98
                     // str_format (localize("tagword", count($array))
99 99
                     // str_format (localize("publisherword", count($array))
100
-                    array_push ($this->entryArray, new Entry (str_format (localize ("search.result.{$key}"), $this->query), DB . ":query:{$d}:{$key}",
101
-                                        str_format (localize("{$key}word", $total), $total), "text",
102
-                                        array ( new LinkNavigation ("?page={$pagequery}&query={$query}&db={$d}&scope={$key}")),
103
-                                        Base::noDatabaseSelected () ? "" : "tt-header", $total));
100
+                    array_push($this->entryArray, new Entry(str_format(localize("search.result.{$key}"), $this->query), DB . ":query:{$d}:{$key}",
101
+                                        str_format(localize("{$key}word", $total), $total), "text",
102
+                                        array(new LinkNavigation("?page={$pagequery}&query={$query}&db={$d}&scope={$key}")),
103
+                                        Base::noDatabaseSelected()?"":"tt-header", $total));
104 104
                 }
105
-                if (!Base::noDatabaseSelected () && $this->useTypeahead ()) {
105
+                if (!Base::noDatabaseSelected() && $this->useTypeahead()) {
106 106
                     foreach ($array as $entry) {
107
-                        array_push ($this->entryArray, $entry);
107
+                        array_push($this->entryArray, $entry);
108 108
                         $i++;
109 109
                         if ($i > 4) { break; };
110 110
                     }
111 111
                 }
112 112
             }
113 113
             $d++;
114
-            if (Base::noDatabaseSelected ()) {
115
-                Base::clearDb ();
114
+            if (Base::noDatabaseSelected()) {
115
+                Base::clearDb();
116 116
             }
117 117
         }
118 118
         return $out;
119 119
     }
120 120
 
121
-    public function InitializeContent ()
121
+    public function InitializeContent()
122 122
     {
123
-        $scope = getURLParam ("scope");
123
+        $scope = getURLParam("scope");
124 124
         if (empty ($scope)) {
125
-            $this->title = str_format (localize ("search.result"), $this->query);
125
+            $this->title = str_format(localize("search.result"), $this->query);
126 126
         } else {
127 127
             // Comment to help the perl i18n script
128 128
             // str_format (localize ("search.result.author"), $this->query)
@@ -130,31 +130,31 @@  discard block
 block discarded – undo
130 130
             // str_format (localize ("search.result.series"), $this->query)
131 131
             // str_format (localize ("search.result.book"), $this->query)
132 132
             // str_format (localize ("search.result.publisher"), $this->query)
133
-            $this->title = str_format (localize ("search.result.{$scope}"), $this->query);
133
+            $this->title = str_format(localize("search.result.{$scope}"), $this->query);
134 134
         }
135 135
 
136 136
         $crit = "%" . $this->query . "%";
137 137
 
138 138
         // Special case when we are doing a search and no database is selected
139
-        if (Base::noDatabaseSelected () && !$this->useTypeahead ()) {
139
+        if (Base::noDatabaseSelected() && !$this->useTypeahead()) {
140 140
             $i = 0;
141
-            foreach (Base::getDbNameList () as $key) {
142
-                Base::clearDb ();
143
-                list ($array, $totalNumber) = Book::getBooksByQuery (array ("all" => $crit), 1, $i, 1);
144
-                array_push ($this->entryArray, new Entry ($key, DB . ":query:{$i}",
145
-                                        str_format (localize ("bookword", $totalNumber), $totalNumber), "text",
146
-                                        array ( new LinkNavigation ("?" . DB . "={$i}&page=9&query=" . $this->query)), "", $totalNumber));
141
+            foreach (Base::getDbNameList() as $key) {
142
+                Base::clearDb();
143
+                list ($array, $totalNumber) = Book::getBooksByQuery(array("all" => $crit), 1, $i, 1);
144
+                array_push($this->entryArray, new Entry($key, DB . ":query:{$i}",
145
+                                        str_format(localize("bookword", $totalNumber), $totalNumber), "text",
146
+                                        array(new LinkNavigation("?" . DB . "={$i}&page=9&query=" . $this->query)), "", $totalNumber));
147 147
                 $i++;
148 148
             }
149 149
             return;
150 150
         }
151 151
         if (empty ($scope)) {
152
-            $this->doSearchByCategory ();
152
+            $this->doSearchByCategory();
153 153
             return;
154 154
         }
155 155
 
156
-        $array = $this->searchByScope ($scope);
157
-        if (count ($array) == 2 && is_array ($array [0])) {
156
+        $array = $this->searchByScope($scope);
157
+        if (count($array) == 2 && is_array($array [0])) {
158 158
             list ($this->entryArray, $this->totalNumber) = $array;
159 159
         } else {
160 160
             $this->entryArray = $array;
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,11 +15,13 @@  discard block
 block discarded – undo
15 15
     const SCOPE_BOOK = "book";
16 16
     const SCOPE_PUBLISHER = "publisher";
17 17
 
18
-    private function useTypeahead () {
18
+    private function useTypeahead ()
19
+    {
19 20
         return !is_null (getURLParam ("search"));
20 21
     }
21 22
 
22
-    private function searchByScope ($scope, $limit = FALSE) {
23
+    private function searchByScope ($scope, $limit = FALSE)
24
+    {
23 25
         $n = $this->n;
24 26
         $numberPerPage = NULL;
25 27
         $queryNormedAndUp = trim($this->query);
@@ -54,7 +56,8 @@  discard block
 block discarded – undo
54 56
         return $array;
55 57
     }
56 58
 
57
-    public function doSearchByCategory () {
59
+    public function doSearchByCategory ()
60
+    {
58 61
         $database = GetUrlParam (DB);
59 62
         $out = array ();
60 63
         $pagequery = Base::PAGE_OPENSEARCH_QUERY;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@  discard block
 block discarded – undo
19 19
         return !is_null (getURLParam ("search"));
20 20
     }
21 21
 
22
-    private function searchByScope ($scope, $limit = FALSE) {
22
+    private function searchByScope ($scope, $limit = false) {
23 23
         $n = $this->n;
24
-        $numberPerPage = NULL;
24
+        $numberPerPage = null;
25 25
         $queryNormedAndUp = trim($this->query);
26 26
         if (useNormAndUp ()) {
27 27
             $queryNormedAndUp = normAndUp ($this->query);
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
         }
33 33
         switch ($scope) {
34 34
             case self::SCOPE_BOOK :
35
-                $array = Book::getBooksByStartingLetter ('%' . $queryNormedAndUp, $n, NULL, $numberPerPage);
35
+                $array = Book::getBooksByStartingLetter ('%' . $queryNormedAndUp, $n, null, $numberPerPage);
36 36
                 break;
37 37
             case self::SCOPE_AUTHOR :
38 38
                 $array = Author::getAuthorsForSearch ('%' . $queryNormedAndUp);
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
                 $array = Serie::getAllSeriesByQuery ($queryNormedAndUp);
42 42
                 break;
43 43
             case self::SCOPE_TAG :
44
-                $array = Tag::getAllTagsByQuery ($queryNormedAndUp, $n, NULL, $numberPerPage);
44
+                $array = Tag::getAllTagsByQuery ($queryNormedAndUp, $n, null, $numberPerPage);
45 45
                 break;
46 46
             case self::SCOPE_PUBLISHER :
47 47
                 $array = Publisher::getAllPublishersByQuery ($queryNormedAndUp);
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
                 if (in_array($key, getCurrentOption ('ignored_categories'))) {
82 82
                     continue;
83 83
                 }
84
-                $array = $this->searchByScope ($key, TRUE);
84
+                $array = $this->searchByScope ($key, true);
85 85
 
86 86
                 $i = 0;
87 87
                 if (count ($array) == 2 && is_array ($array [0])) {
Please login to merge, or discard this patch.
lib/PageBookDetail.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,9 +8,9 @@
 block discarded – undo
8 8
 
9 9
 class PageBookDetail extends Page
10 10
 {
11
-    public function InitializeContent ()
11
+    public function InitializeContent()
12 12
     {
13
-        $this->book = Book::getBookById ($this->idGet);
13
+        $this->book = Book::getBookById($this->idGet);
14 14
         $this->title = $this->book->title;
15 15
     }
16 16
 }
Please login to merge, or discard this patch.
lib/PageAllAuthors.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@
 block discarded – undo
8 8
 
9 9
 class PageAllAuthors extends Page
10 10
 {
11
-    public function InitializeContent ()
11
+    public function InitializeContent()
12 12
     {
13 13
         $this->title = localize("authors.title");
14
-        if (getCurrentOption ("author_split_first_letter") == 1) {
14
+        if (getCurrentOption("author_split_first_letter") == 1) {
15 15
             $this->entryArray = Author::getAllAuthorsByFirstLetter();
16 16
         }
17 17
         else {
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,7 @@
 block discarded – undo
13 13
         $this->title = localize("authors.title");
14 14
         if (getCurrentOption ("author_split_first_letter") == 1) {
15 15
             $this->entryArray = Author::getAllAuthorsByFirstLetter();
16
-        }
17
-        else {
16
+        } else {
18 17
             $this->entryArray = Author::getAllAuthors();
19 18
         }
20 19
         $this->idPage = Author::ALL_AUTHORS_ID;
Please login to merge, or discard this patch.
lib/CustomColumnTypeRating.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
 
58 58
     public function getCustom($id)
59 59
     {
60
-        return new CustomColumn ($id, str_format(localize("customcolumn.stars", $id / 2), $id / 2), $this);
60
+        return new CustomColumn($id, str_format(localize("customcolumn.stars", $id / 2), $id / 2), $this);
61 61
     }
62 62
 
63 63
     protected function getAllCustomValuesFromDatabase()
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
         if ($post = $result->fetchObject()) {
101 101
             return new CustomColumn($post->value, str_format(localize("customcolumn.stars", $post->value / 2), $post->value / 2), $this);
102 102
         }
103
-        return new CustomColumn(NULL, localize("customcolumn.rating.unknown"), $this);
103
+        return new CustomColumn(null, localize("customcolumn.rating.unknown"), $this);
104 104
     }
105 105
 
106 106
     public function isSearchable()
Please login to merge, or discard this patch.
lib/PageAllCustoms.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,9 +8,9 @@
 block discarded – undo
8 8
 
9 9
 class PageAllCustoms extends Page
10 10
 {
11
-    public function InitializeContent ()
11
+    public function InitializeContent()
12 12
     {
13
-        $customId = getURLParam ("custom", NULL);
13
+        $customId = getURLParam("custom", NULL);
14 14
         $columnType = CustomColumnType::createByCustomID($customId);
15 15
         
16 16
         $this->title = $columnType->getTitle();
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 {
11 11
     public function InitializeContent ()
12 12
     {
13
-        $customId = getURLParam ("custom", NULL);
13
+        $customId = getURLParam ("custom", null);
14 14
         $columnType = CustomColumnType::createByCustomID($customId);
15 15
         
16 16
         $this->title = $columnType->getTitle();
Please login to merge, or discard this patch.