Test Setup Failed
Pull Request — master (#488)
by
unknown
03:18
created
lib/PageAllAuthors.php 1 patch
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.
lib/CustomColumnTypeRating.php 1 patch
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.
lib/PageAllCustoms.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 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.
lib/LinkFacet.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@
 block discarded – undo
9 9
 class LinkFacet extends Link
10 10
 {
11 11
     public function __construct($phref, $ptitle = NULL, $pfacetGroup = NULL, $pactiveFacet = FALSE) {
12
-        parent::__construct ($phref, Link::OPDS_PAGING_TYPE, "http://opds-spec.org/facet", $ptitle, $pfacetGroup, $pactiveFacet);
13
-        if (!is_null (GetUrlParam (DB))) $this->href = addURLParameter ($this->href, DB, GetUrlParam (DB));
12
+        parent::__construct($phref, Link::OPDS_PAGING_TYPE, "http://opds-spec.org/facet", $ptitle, $pfacetGroup, $pactiveFacet);
13
+        if (!is_null(GetUrlParam(DB))) $this->href = addURLParameter($this->href, DB, GetUrlParam(DB));
14 14
         $this->href = parent::getScriptName() . $this->href;
15 15
     }
16 16
 }
Please login to merge, or discard this patch.
lib/PageRatingDetail.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,11 +8,11 @@
 block discarded – undo
8 8
 
9 9
 class PageRatingDetail extends Page
10 10
 {
11
-    public function InitializeContent ()
11
+    public function InitializeContent()
12 12
     {
13
-        $rating = Rating::getRatingById ($this->idGet);
14
-        $this->idPage = $rating->getEntryId ();
15
-        $this->title =str_format (localize ("ratingword", $rating->name/2), $rating->name/2);
16
-        list ($this->entryArray, $this->totalNumber) = Book::getBooksByRating ($this->idGet, $this->n);
13
+        $rating = Rating::getRatingById($this->idGet);
14
+        $this->idPage = $rating->getEntryId();
15
+        $this->title = str_format(localize("ratingword", $rating->name / 2), $rating->name / 2);
16
+        list ($this->entryArray, $this->totalNumber) = Book::getBooksByRating($this->idGet, $this->n);
17 17
     }
18 18
 }
Please login to merge, or discard this patch.
lib/PageAuthorDetail.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 PageAuthorDetail extends Page
10 10
 {
11
-    public function InitializeContent ()
11
+    public function InitializeContent()
12 12
     {
13
-        $author = Author::getAuthorById ($this->idGet);
14
-        $this->idPage = $author->getEntryId ();
13
+        $author = Author::getAuthorById($this->idGet);
14
+        $this->idPage = $author->getEntryId();
15 15
         $this->title = $author->name;
16
-        list ($this->entryArray, $this->totalNumber) = Book::getBooksByAuthor ($this->idGet, $this->n);
16
+        list ($this->entryArray, $this->totalNumber) = Book::getBooksByAuthor($this->idGet, $this->n);
17 17
     }
18 18
 }
Please login to merge, or discard this patch.
lib/PageSerieDetail.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 PageSerieDetail extends Page
10 10
 {
11
-    public function InitializeContent ()
11
+    public function InitializeContent()
12 12
     {
13
-        $serie = Serie::getSerieById ($this->idGet);
13
+        $serie = Serie::getSerieById($this->idGet);
14 14
         $this->title = $serie->name;
15
-        list ($this->entryArray, $this->totalNumber) = Book::getBooksBySeries ($this->idGet, $this->n);
16
-        $this->idPage = $serie->getEntryId ();
15
+        list ($this->entryArray, $this->totalNumber) = Book::getBooksBySeries($this->idGet, $this->n);
16
+        $this->idPage = $serie->getEntryId();
17 17
     }
18 18
 }
Please login to merge, or discard this patch.
lib/Tag.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -20,44 +20,44 @@
 block discarded – undo
20 20
         $this->name = $post->name;
21 21
     }
22 22
 
23
-    public function getUri () {
24
-        return "?page=".parent::PAGE_TAG_DETAIL."&id=$this->id";
23
+    public function getUri() {
24
+        return "?page=" . parent::PAGE_TAG_DETAIL . "&id=$this->id";
25 25
     }
26 26
 
27
-    public function getEntryId () {
28
-        return self::ALL_TAGS_ID.":".$this->id;
27
+    public function getEntryId() {
28
+        return self::ALL_TAGS_ID . ":" . $this->id;
29 29
     }
30 30
 
31 31
     public static function getCount() {
32 32
         // str_format (localize("tags.alphabetical", count(array))
33
-        return parent::getCountGeneric ("tags", self::ALL_TAGS_ID, parent::PAGE_ALL_TAGS);
33
+        return parent::getCountGeneric("tags", self::ALL_TAGS_ID, parent::PAGE_ALL_TAGS);
34 34
     }
35 35
 
36
-    public static function getTagById ($tagId) {
37
-        $result = parent::getDb ()->prepare('select id, name  from tags where id = ?');
38
-        $result->execute (array ($tagId));
39
-        if ($post = $result->fetchObject ()) {
40
-            return new Tag ($post);
36
+    public static function getTagById($tagId) {
37
+        $result = parent::getDb()->prepare('select id, name  from tags where id = ?');
38
+        $result->execute(array($tagId));
39
+        if ($post = $result->fetchObject()) {
40
+            return new Tag($post);
41 41
         }
42 42
         return NULL;
43 43
     }
44 44
 
45 45
     public static function getAllTags() {
46
-        return Base::getEntryArrayWithBookNumber (self::SQL_ALL_TAGS, self::TAG_COLUMNS, array (), "Tag");
46
+        return Base::getEntryArrayWithBookNumber(self::SQL_ALL_TAGS, self::TAG_COLUMNS, array(), "Tag");
47 47
     }
48 48
 
49 49
     public static function getAllTagsByQuery($query, $n, $database = NULL, $numberPerPage = NULL) {
50
-        $columns  = "tags.id as id, tags.name as name, (select count(*) from books_tags_link where tags.id = tag) as count";
50
+        $columns = "tags.id as id, tags.name as name, (select count(*) from books_tags_link where tags.id = tag) as count";
51 51
         $sql = 'select {0} from tags where upper (tags.name) like ? {1} order by tags.name';
52
-        list ($totalNumber, $result) = parent::executeQuery ($sql, $columns, "", array ('%' . $query . '%'), $n, $database, $numberPerPage);
52
+        list ($totalNumber, $result) = parent::executeQuery($sql, $columns, "", array('%' . $query . '%'), $n, $database, $numberPerPage);
53 53
         $entryArray = array();
54
-        while ($post = $result->fetchObject ())
54
+        while ($post = $result->fetchObject())
55 55
         {
56
-            $tag = new Tag ($post);
57
-            array_push ($entryArray, new Entry ($tag->name, $tag->getEntryId (),
58
-                str_format (localize("bookword", $post->count), $post->count), "text",
59
-                array ( new LinkNavigation ($tag->getUri ()))));
56
+            $tag = new Tag($post);
57
+            array_push($entryArray, new Entry($tag->name, $tag->getEntryId(),
58
+                str_format(localize("bookword", $post->count), $post->count), "text",
59
+                array(new LinkNavigation($tag->getUri()))));
60 60
         }
61
-        return array ($entryArray, $totalNumber);
61
+        return array($entryArray, $totalNumber);
62 62
     }
63 63
 }
Please login to merge, or discard this patch.
lib/PageCustomize.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@  discard block
 block discarded – undo
8 8
 
9 9
 class PageCustomize extends Page
10 10
 {
11
-    private function isChecked ($key, $testedValue = 1) {
12
-        $value = getCurrentOption ($key);
13
-        if (is_array ($value)) {
14
-            if (in_array ($testedValue, $value)) {
11
+    private function isChecked($key, $testedValue = 1) {
12
+        $value = getCurrentOption($key);
13
+        if (is_array($value)) {
14
+            if (in_array($testedValue, $value)) {
15 15
                 return "checked='checked'";
16 16
             }
17 17
         } else {
@@ -22,29 +22,29 @@  discard block
 block discarded – undo
22 22
         return "";
23 23
     }
24 24
 
25
-    private function isSelected ($key, $value) {
26
-        if (getCurrentOption ($key) == $value) {
25
+    private function isSelected($key, $value) {
26
+        if (getCurrentOption($key) == $value) {
27 27
             return "selected='selected'";
28 28
         }
29 29
         return "";
30 30
     }
31 31
 
32
-    private function getStyleList () {
33
-        $result = array ();
34
-        foreach (glob ("templates/" . getCurrentTemplate () . "/styles/style-*.css") as $filename) {
35
-            if (preg_match ('/styles\/style-(.*?)\.css/', $filename, $m)) {
36
-                array_push ($result, $m [1]);
32
+    private function getStyleList() {
33
+        $result = array();
34
+        foreach (glob("templates/" . getCurrentTemplate() . "/styles/style-*.css") as $filename) {
35
+            if (preg_match('/styles\/style-(.*?)\.css/', $filename, $m)) {
36
+                array_push($result, $m [1]);
37 37
             }
38 38
         }
39 39
         return $result;
40 40
     }
41 41
 
42
-    public function InitializeContent ()
42
+    public function InitializeContent()
43 43
     {
44
-        $this->title = localize ("customize.title");
45
-        $this->entryArray = array ();
44
+        $this->title = localize("customize.title");
45
+        $this->entryArray = array();
46 46
 
47
-        $ignoredBaseArray = array (PageQueryResult::SCOPE_AUTHOR,
47
+        $ignoredBaseArray = array(PageQueryResult::SCOPE_AUTHOR,
48 48
                                    PageQueryResult::SCOPE_TAG,
49 49
                                    PageQueryResult::SCOPE_SERIES,
50 50
                                    PageQueryResult::SCOPE_PUBLISHER,
@@ -52,49 +52,49 @@  discard block
 block discarded – undo
52 52
                                    "language");
53 53
 
54 54
         $content = "";
55
-        array_push ($this->entryArray, new Entry ("Template", "",
55
+        array_push($this->entryArray, new Entry("Template", "",
56 56
                                         "<span style='cursor: pointer;' onclick='$.cookie(\"template\", \"bootstrap\", { expires: 365 });window.location=$(\".headleft\").attr(\"href\");'>Click to switch to Bootstrap</span>", "text",
57
-                                        array ()));
57
+                                        array()));
58 58
         if (!preg_match("/(Kobo|Kindle\/3.0|EBRD1101)/", $_SERVER['HTTP_USER_AGENT'])) {
59 59
             $content .= '<select id="style" onchange="updateCookie (this);">';
60
-            foreach ($this-> getStyleList () as $filename) {
61
-                $content .= "<option value='{$filename}' " . $this->isSelected ("style", $filename) . ">{$filename}</option>";
60
+            foreach ($this-> getStyleList() as $filename) {
61
+                $content .= "<option value='{$filename}' " . $this->isSelected("style", $filename) . ">{$filename}</option>";
62 62
             }
63 63
             $content .= '</select>';
64 64
         } else {
65
-            foreach ($this-> getStyleList () as $filename) {
66
-                $content .= "<input type='radio' onchange='updateCookieFromCheckbox (this);' id='style-{$filename}' name='style' value='{$filename}' " . $this->isChecked ("style", $filename) . " /><label for='style-{$filename}'> {$filename} </label>";
65
+            foreach ($this-> getStyleList() as $filename) {
66
+                $content .= "<input type='radio' onchange='updateCookieFromCheckbox (this);' id='style-{$filename}' name='style' value='{$filename}' " . $this->isChecked("style", $filename) . " /><label for='style-{$filename}'> {$filename} </label>";
67 67
             }
68 68
         }
69
-        array_push ($this->entryArray, new Entry (localize ("customize.style"), "",
69
+        array_push($this->entryArray, new Entry(localize("customize.style"), "",
70 70
                                         $content, "text",
71
-                                        array ()));
72
-        if (!useServerSideRendering ()) {
73
-            $content = '<input type="checkbox" onchange="updateCookieFromCheckbox (this);" id="use_fancyapps" ' . $this->isChecked ("use_fancyapps") . ' />';
74
-            array_push ($this->entryArray, new Entry (localize ("customize.fancybox"), "",
71
+                                        array()));
72
+        if (!useServerSideRendering()) {
73
+            $content = '<input type="checkbox" onchange="updateCookieFromCheckbox (this);" id="use_fancyapps" ' . $this->isChecked("use_fancyapps") . ' />';
74
+            array_push($this->entryArray, new Entry(localize("customize.fancybox"), "",
75 75
                                             $content, "text",
76
-                                            array ()));
76
+                                            array()));
77 77
         }
78
-        $content = '<input type="number" onchange="updateCookie (this);" id="max_item_per_page" value="' . getCurrentOption ("max_item_per_page") . '" min="-1" max="1200" pattern="^[-+]?[0-9]+$" />';
79
-        array_push ($this->entryArray, new Entry (localize ("customize.paging"), "",
78
+        $content = '<input type="number" onchange="updateCookie (this);" id="max_item_per_page" value="' . getCurrentOption("max_item_per_page") . '" min="-1" max="1200" pattern="^[-+]?[0-9]+$" />';
79
+        array_push($this->entryArray, new Entry(localize("customize.paging"), "",
80 80
                                         $content, "text",
81
-                                        array ()));
82
-        $content = '<input type="text" onchange="updateCookie (this);" id="email" value="' . getCurrentOption ("email") . '" />';
83
-        array_push ($this->entryArray, new Entry (localize ("customize.email"), "",
81
+                                        array()));
82
+        $content = '<input type="text" onchange="updateCookie (this);" id="email" value="' . getCurrentOption("email") . '" />';
83
+        array_push($this->entryArray, new Entry(localize("customize.email"), "",
84 84
                                         $content, "text",
85
-                                        array ()));
86
-        $content = '<input type="checkbox" onchange="updateCookieFromCheckbox (this);" id="html_tag_filter" ' . $this->isChecked ("html_tag_filter") . ' />';
87
-        array_push ($this->entryArray, new Entry (localize ("customize.filter"), "",
85
+                                        array()));
86
+        $content = '<input type="checkbox" onchange="updateCookieFromCheckbox (this);" id="html_tag_filter" ' . $this->isChecked("html_tag_filter") . ' />';
87
+        array_push($this->entryArray, new Entry(localize("customize.filter"), "",
88 88
                                         $content, "text",
89
-                                        array ()));
89
+                                        array()));
90 90
         $content = "";
91 91
         foreach ($ignoredBaseArray as $key) {
92
-            $keyPlural = preg_replace ('/(ss)$/', 's', $key . "s");
93
-            $content .=  '<input type="checkbox" name="ignored_categories[]" onchange="updateCookieFromCheckboxGroup (this);" id="ignored_categories_' . $key . '" ' . $this->isChecked ("ignored_categories", $key) . ' > ' . localize ("{$keyPlural}.title") . '</input> ';
92
+            $keyPlural = preg_replace('/(ss)$/', 's', $key . "s");
93
+            $content .= '<input type="checkbox" name="ignored_categories[]" onchange="updateCookieFromCheckboxGroup (this);" id="ignored_categories_' . $key . '" ' . $this->isChecked("ignored_categories", $key) . ' > ' . localize("{$keyPlural}.title") . '</input> ';
94 94
         }
95 95
 
96
-        array_push ($this->entryArray, new Entry (localize ("customize.ignored"), "",
96
+        array_push($this->entryArray, new Entry(localize("customize.ignored"), "",
97 97
                                         $content, "text",
98
-                                        array ()));
98
+                                        array()));
99 99
     }
100 100
 }
Please login to merge, or discard this patch.