Passed
Push — master ( 0cbb2e...6335df )
by Sébastien
12:28 queued 10:49
created
lib/Publisher.php 1 patch
Braces   +16 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,25 +17,30 @@  discard block
 block discarded – undo
17 17
     public $id;
18 18
     public $name;
19 19
 
20
-    public function __construct($post) {
20
+    public function __construct($post)
21
+    {
21 22
         $this->id = $post->id;
22 23
         $this->name = $post->name;
23 24
     }
24 25
 
25
-    public function getUri () {
26
+    public function getUri ()
27
+    {
26 28
         return "?page=".parent::PAGE_PUBLISHER_DETAIL."&id=$this->id";
27 29
     }
28 30
 
29
-    public function getEntryId () {
31
+    public function getEntryId ()
32
+    {
30 33
         return self::ALL_PUBLISHERS_ID.":".$this->id;
31 34
     }
32 35
 
33
-    public static function getCount() {
36
+    public static function getCount()
37
+    {
34 38
         // str_format (localize("publishers.alphabetical", count(array))
35 39
         return parent::getCountGeneric ("publishers", self::ALL_PUBLISHERS_ID, parent::PAGE_ALL_PUBLISHERS);
36 40
     }
37 41
 
38
-    public static function getPublisherByBookId ($bookId) {
42
+    public static function getPublisherByBookId ($bookId)
43
+    {
39 44
         $result = parent::getDb ()->prepare('select publishers.id as id, name
40 45
 from books_publishers_link, publishers
41 46
 where publishers.id = publisher and book = ?');
@@ -46,7 +51,8 @@  discard block
 block discarded – undo
46 51
         return NULL;
47 52
     }
48 53
 
49
-    public static function getPublisherById ($publisherId) {
54
+    public static function getPublisherById ($publisherId)
55
+    {
50 56
         $result = parent::getDb ()->prepare('select id, name
51 57
 from publishers where id = ?');
52 58
         $result->execute (array ($publisherId));
@@ -56,11 +62,13 @@  discard block
 block discarded – undo
56 62
         return NULL;
57 63
     }
58 64
 
59
-    public static function getAllPublishers() {
65
+    public static function getAllPublishers()
66
+    {
60 67
         return Base::getEntryArrayWithBookNumber (self::SQL_ALL_PUBLISHERS, self::PUBLISHERS_COLUMNS, array (), "Publisher");
61 68
     }
62 69
 
63
-    public static function getAllPublishersByQuery($query) {
70
+    public static function getAllPublishersByQuery($query)
71
+    {
64 72
         return Base::getEntryArrayWithBookNumber (self::SQL_PUBLISHERS_FOR_SEARCH, self::PUBLISHERS_COLUMNS, array ('%' . $query . '%'), "Publisher");
65 73
     }
66 74
 }
Please login to merge, or discard this patch.
lib/PageQueryResult.php 1 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.
lib/PageAllAuthors.php 1 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/LinkFacet.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,9 +8,12 @@
 block discarded – undo
8 8
 
9 9
 class LinkFacet extends Link
10 10
 {
11
-    public function __construct($phref, $ptitle = NULL, $pfacetGroup = NULL, $pactiveFacet = FALSE) {
11
+    public function __construct($phref, $ptitle = NULL, $pfacetGroup = NULL, $pactiveFacet = FALSE)
12
+    {
12 13
         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
+        if (!is_null (GetUrlParam (DB))) {
15
+            $this->href = addURLParameter ($this->href, DB, GetUrlParam (DB));
16
+        }
14 17
         $this->href = parent::getScriptName() . $this->href;
15 18
     }
16 19
 }
Please login to merge, or discard this patch.
lib/OPDS_renderer.php 1 patch
Braces   +32 added lines, -24 removed lines patch added patch discarded remove patch
@@ -13,14 +13,16 @@  discard block
 block discarded – undo
13 13
     private $xmlStream = NULL;
14 14
     private $updated = NULL;
15 15
 
16
-    private function getUpdatedTime () {
16
+    private function getUpdatedTime ()
17
+    {
17 18
         if (is_null ($this->updated)) {
18 19
             $this->updated = time();
19 20
         }
20 21
         return date (DATE_ATOM, $this->updated);
21 22
     }
22 23
 
23
-    private function getXmlStream () {
24
+    private function getXmlStream ()
25
+    {
24 26
         if (is_null ($this->xmlStream)) {
25 27
             $this->xmlStream = new XMLWriter();
26 28
             $this->xmlStream->openMemory();
@@ -29,7 +31,8 @@  discard block
 block discarded – undo
29 31
         return $this->xmlStream;
30 32
     }
31 33
 
32
-    public function getOpenSearch () {
34
+    public function getOpenSearch ()
35
+    {
33 36
         global $config;
34 37
         $xml = new XMLWriter ();
35 38
         $xml->openMemory ();
@@ -58,7 +61,9 @@  discard block
 block discarded – undo
58 61
                 $xml->startElement ("Url");
59 62
                     $xml->writeAttribute ("type", 'application/atom+xml');
60 63
                     $urlparam = "?query={searchTerms}";
61
-                    if (!is_null (GetUrlParam (DB))) $urlparam = addURLParameter ($urlparam, DB, GetUrlParam (DB));
64
+                    if (!is_null (GetUrlParam (DB))) {
65
+                        $urlparam = addURLParameter ($urlparam, DB, GetUrlParam (DB));
66
+                    }
62 67
                     $urlparam = str_replace ("%7B", "{", $urlparam);
63 68
                     $urlparam = str_replace ("%7D", "}", $urlparam);
64 69
                     $xml->writeAttribute ("template", $config['cops_full_url'] . 'feed.php' . $urlparam);
@@ -72,7 +77,8 @@  discard block
 block discarded – undo
72 77
         return $xml->outputMemory(true);
73 78
     }
74 79
 
75
-    private function startXmlDocument ($page) {
80
+    private function startXmlDocument ($page)
81
+    {
76 82
         global $config;
77 83
         self::getXmlStream ()->startDocument('1.0','UTF-8');
78 84
         self::getXmlStream ()->startElement ("feed");
@@ -84,21 +90,19 @@  discard block
 block discarded – undo
84 90
             self::getXmlStream ()->startElement ("title");
85 91
                 self::getXmlStream ()->text ($page->title);
86 92
             self::getXmlStream ()->endElement ();
87
-            if ($page->subtitle != "")
88
-            {
93
+            if ($page->subtitle != "") {
89 94
                 self::getXmlStream ()->startElement ("subtitle");
90 95
                     self::getXmlStream ()->text ($page->subtitle);
91 96
                 self::getXmlStream ()->endElement ();
92 97
             }
93 98
             self::getXmlStream ()->startElement ("id");
94
-                if ($page->idPage)
95
-                {
99
+                if ($page->idPage) {
96 100
                     $idPage = $page->idPage;
97
-                    if (!is_null (GetUrlParam (DB))) $idPage = str_replace ("cops:", "cops:" . GetUrlParam (DB) . ":", $idPage);
101
+                    if (!is_null (GetUrlParam (DB))) {
102
+                        $idPage = str_replace ("cops:", "cops:" . GetUrlParam (DB) . ":", $idPage);
103
+                    }
98 104
                     self::getXmlStream ()->text ($idPage);
99
-                }
100
-                else
101
-                {
105
+                } else {
102 106
                     self::getXmlStream ()->text ($_SERVER['REQUEST_URI']);
103 107
                 }
104 108
             self::getXmlStream ()->endElement ();
@@ -124,14 +128,14 @@  discard block
 block discarded – undo
124 128
             $link = new LinkNavigation ("?" . getQueryString (), "self");
125 129
             self::renderLink ($link);
126 130
             $urlparam = "?";
127
-            if (!is_null (GetUrlParam (DB))) $urlparam = addURLParameter ($urlparam, DB, GetUrlParam (DB));
131
+            if (!is_null (GetUrlParam (DB))) {
132
+                $urlparam = addURLParameter ($urlparam, DB, GetUrlParam (DB));
133
+            }
128 134
             if ($config['cops_generate_invalid_opds_stream'] == 0 || preg_match("/(MantanoReader|FBReader)/", $_SERVER['HTTP_USER_AGENT'])) {
129 135
                 // Good and compliant way of handling search
130 136
                 $urlparam = addURLParameter ($urlparam, "page", Base::PAGE_OPENSEARCH);
131 137
                 $link = new Link ("feed.php" . $urlparam, "application/opensearchdescription+xml", "search", "Search here");
132
-            }
133
-            else
134
-            {
138
+            } else {
135 139
                 // Bad way, will be removed when OPDS client are fixed
136 140
                 $urlparam = addURLParameter ($urlparam, "query", "{searchTerms}");
137 141
                 $urlparam = str_replace ("%7B", "{", $urlparam);
@@ -148,13 +152,15 @@  discard block
 block discarded – undo
148 152
             }
149 153
     }
150 154
 
151
-    private function endXmlDocument () {
155
+    private function endXmlDocument ()
156
+    {
152 157
         self::getXmlStream ()->endElement ();
153 158
         self::getXmlStream ()->endDocument ();
154 159
         return self::getXmlStream ()->outputMemory(true);
155 160
     }
156 161
 
157
-    private function renderLink ($link) {
162
+    private function renderLink ($link)
163
+    {
158 164
         self::getXmlStream ()->startElement ("link");
159 165
             self::getXmlStream ()->writeAttribute ("href", $link->href);
160 166
             self::getXmlStream ()->writeAttribute ("type", $link->type);
@@ -173,7 +179,8 @@  discard block
 block discarded – undo
173 179
         self::getXmlStream ()->endElement ();
174 180
     }
175 181
 
176
-    private function getPublicationDate($book) {
182
+    private function getPublicationDate($book)
183
+    {
177 184
         $dateYmd = substr($book->pubdate, 0, 10);
178 185
         $pubdate = \DateTime::createFromFormat('Y-m-d', $dateYmd);
179 186
         if ($pubdate === false ||
@@ -184,7 +191,8 @@  discard block
 block discarded – undo
184 191
         return $pubdate->format("Y-m-d");
185 192
     }
186 193
 
187
-    private function renderEntry ($entry) {
194
+    private function renderEntry ($entry)
195
+    {
188 196
         self::getXmlStream ()->startElement ("title");
189 197
             self::getXmlStream ()->text ($entry->title);
190 198
         self::getXmlStream ()->endElement ();
@@ -244,11 +252,11 @@  discard block
 block discarded – undo
244 252
 
245 253
     }
246 254
 
247
-    public function render ($page) {
255
+    public function render ($page)
256
+    {
248 257
         global $config;
249 258
         self::startXmlDocument ($page);
250
-        if ($page->isPaginated ())
251
-        {
259
+        if ($page->isPaginated ()) {
252 260
             self::getXmlStream ()->startElement ("opensearch:totalResults");
253 261
                 self::getXmlStream ()->text ($page->totalNumber);
254 262
             self::getXmlStream ()->endElement ();
Please login to merge, or discard this patch.
lib/Data.php 1 patch
Braces   +42 added lines, -29 removed lines patch added patch discarded remove patch
@@ -55,7 +55,8 @@  discard block
 block discarded – undo
55 55
         'zip'   => 'application/zip'
56 56
     );
57 57
 
58
-    public function __construct($post, $book = null) {
58
+    public function __construct($post, $book = null)
59
+    {
59 60
         $this->id = $post->id;
60 61
         $this->name = $post->name;
61 62
         $this->format = $post->format;
@@ -64,19 +65,20 @@  discard block
 block discarded – undo
64 65
         $this->book = $book;
65 66
     }
66 67
 
67
-    public function isKnownType () {
68
+    public function isKnownType ()
69
+    {
68 70
         return array_key_exists ($this->extension, self::$mimetypes);
69 71
     }
70 72
 
71
-    public function getMimeType () {
73
+    public function getMimeType ()
74
+    {
72 75
         $result = "application/octet-stream";
73 76
         if ($this->isKnownType ()) {
74 77
             return self::$mimetypes [$this->extension];
75 78
         } elseif (function_exists('finfo_open') === true) {
76 79
             $finfo = finfo_open(FILEINFO_MIME_TYPE);
77 80
 
78
-            if (is_resource($finfo) === true)
79
-            {
81
+            if (is_resource($finfo) === true) {
80 82
                 $result = finfo_file($finfo, $this->getLocalPath ());
81 83
             }
82 84
 
@@ -86,29 +88,35 @@  discard block
 block discarded – undo
86 88
         return $result;
87 89
     }
88 90
 
89
-    public function isEpubValidOnKobo () {
91
+    public function isEpubValidOnKobo ()
92
+    {
90 93
         return $this->format == "EPUB" || $this->format == "KEPUB";
91 94
     }
92 95
 
93
-    public function getFilename () {
96
+    public function getFilename ()
97
+    {
94 98
         return $this->name . "." . strtolower ($this->format);
95 99
     }
96 100
 
97
-    public function getUpdatedFilename () {
101
+    public function getUpdatedFilename ()
102
+    {
98 103
         return $this->book->getAuthorsSort () . " - " . $this->book->title;
99 104
     }
100 105
 
101
-    public function getUpdatedFilenameEpub () {
106
+    public function getUpdatedFilenameEpub ()
107
+    {
102 108
         return $this->getUpdatedFilename () . ".epub";
103 109
     }
104 110
 
105
-    public function getUpdatedFilenameKepub () {
111
+    public function getUpdatedFilenameKepub ()
112
+    {
106 113
         $str = $this->getUpdatedFilename () . ".kepub.epub";
107 114
         return str_replace(array(':', '#', '&'),
108 115
                            array('-', '-', ' '), $str );
109 116
     }
110 117
 
111
-    public function getDataLink ($rel, $title = NULL) {
118
+    public function getDataLink ($rel, $title = NULL)
119
+    {
112 120
         global $config;
113 121
 
114 122
         if ($rel == Link::OPDS_ACQUISITION_TYPE && $config['cops_use_url_rewriting'] == "1") {
@@ -118,19 +126,24 @@  discard block
 block discarded – undo
118 126
         return self::getLink ($this->book, $this->extension, $this->getMimeType (), $rel, $this->getFilename (), $this->id, $title);
119 127
     }
120 128
 
121
-    public function getHtmlLink () {
129
+    public function getHtmlLink ()
130
+    {
122 131
         return $this->getDataLink(Link::OPDS_ACQUISITION_TYPE)->href;
123 132
     }
124 133
 
125
-    public function getLocalPath () {
134
+    public function getLocalPath ()
135
+    {
126 136
         return $this->book->path . "/" . $this->getFilename ();
127 137
     }
128 138
 
129
-    public function getHtmlLinkWithRewriting ($title = NULL) {
139
+    public function getHtmlLinkWithRewriting ($title = NULL)
140
+    {
130 141
         global $config;
131 142
 
132 143
         $database = "";
133
-        if (!is_null (GetUrlParam (DB))) $database = GetUrlParam (DB) . "/";
144
+        if (!is_null (GetUrlParam (DB))) {
145
+            $database = GetUrlParam (DB) . "/";
146
+        }
134 147
 
135 148
         $href = "download/" . $this->id . "/" . $database;
136 149
 
@@ -144,28 +157,27 @@  discard block
 block discarded – undo
144 157
         return new Link ($href, $this->getMimeType (), Link::OPDS_ACQUISITION_TYPE, $title);
145 158
     }
146 159
 
147
-    public static function getDataByBook ($book) {
160
+    public static function getDataByBook ($book)
161
+    {
148 162
         $out = array ();
149 163
         $result = parent::getDb ()->prepare('select id, format, name
150 164
                                              from data where book = ?');
151 165
         $result->execute (array ($book->id));
152 166
 
153
-        while ($post = $result->fetchObject ())
154
-        {
167
+        while ($post = $result->fetchObject ()) {
155 168
             array_push ($out, new Data ($post, $book));
156 169
         }
157 170
         return $out;
158 171
     }
159 172
 
160
-    public static function handleThumbnailLink ($urlParam, $height) {
173
+    public static function handleThumbnailLink ($urlParam, $height)
174
+    {
161 175
         global $config;
162 176
 
163 177
         if (is_null ($height)) {
164 178
             if (preg_match ('/feed.php/', $_SERVER["SCRIPT_NAME"])) {
165 179
                 $height = $config['cops_opds_thumbnail_height'];
166
-            }
167
-            else
168
-            {
180
+            } else {
169 181
                 $height = $config['cops_html_thumbnail_height'];
170 182
             }
171 183
         }
@@ -184,14 +196,17 @@  discard block
 block discarded – undo
184 196
 
185 197
         if (Base::useAbsolutePath () ||
186 198
             $rel == Link::OPDS_THUMBNAIL_TYPE ||
187
-            ($type == "epub" && $config['cops_update_epub-metadata']))
188
-        {
189
-            if ($type != "jpg") $urlParam = addURLParameter($urlParam, "type", $type);
199
+            ($type == "epub" && $config['cops_update_epub-metadata'])) {
200
+            if ($type != "jpg") {
201
+                $urlParam = addURLParameter($urlParam, "type", $type);
202
+            }
190 203
             if ($rel == Link::OPDS_THUMBNAIL_TYPE) {
191 204
                 $urlParam = self::handleThumbnailLink($urlParam, $height);
192 205
             }
193 206
             $urlParam = addURLParameter($urlParam, "id", $book->id);
194
-            if (!is_null (GetUrlParam (DB))) $urlParam = addURLParameter ($urlParam, DB, GetUrlParam (DB));
207
+            if (!is_null (GetUrlParam (DB))) {
208
+                $urlParam = addURLParameter ($urlParam, DB, GetUrlParam (DB));
209
+            }
195 210
             if ($config['cops_thumbnail_handling'] != "1" &&
196 211
                 !empty ($config['cops_thumbnail_handling']) &&
197 212
                 $rel == Link::OPDS_THUMBNAIL_TYPE) {
@@ -199,9 +214,7 @@  discard block
 block discarded – undo
199 214
             } else {
200 215
                 return new Link ("fetch.php?" . $urlParam, $mime, $rel, $title);
201 216
             }
202
-        }
203
-        else
204
-        {
217
+        } else {
205 218
             return new Link (str_replace('%2F','/',rawurlencode ($book->path."/".$filename)), $mime, $rel, $title);
206 219
         }
207 220
     }
Please login to merge, or discard this patch.
lib/Tag.php 1 patch
Braces   +15 added lines, -9 removed lines patch added patch discarded remove patch
@@ -15,25 +15,30 @@  discard block
 block discarded – undo
15 15
     public $id;
16 16
     public $name;
17 17
 
18
-    public function __construct($post) {
18
+    public function __construct($post)
19
+    {
19 20
         $this->id = $post->id;
20 21
         $this->name = $post->name;
21 22
     }
22 23
 
23
-    public function getUri () {
24
+    public function getUri ()
25
+    {
24 26
         return "?page=".parent::PAGE_TAG_DETAIL."&id=$this->id";
25 27
     }
26 28
 
27
-    public function getEntryId () {
29
+    public function getEntryId ()
30
+    {
28 31
         return self::ALL_TAGS_ID.":".$this->id;
29 32
     }
30 33
 
31
-    public static function getCount() {
34
+    public static function getCount()
35
+    {
32 36
         // str_format (localize("tags.alphabetical", count(array))
33 37
         return parent::getCountGeneric ("tags", self::ALL_TAGS_ID, parent::PAGE_ALL_TAGS);
34 38
     }
35 39
 
36
-    public static function getTagById ($tagId) {
40
+    public static function getTagById ($tagId)
41
+    {
37 42
         $result = parent::getDb ()->prepare('select id, name  from tags where id = ?');
38 43
         $result->execute (array ($tagId));
39 44
         if ($post = $result->fetchObject ()) {
@@ -42,17 +47,18 @@  discard block
 block discarded – undo
42 47
         return NULL;
43 48
     }
44 49
 
45
-    public static function getAllTags() {
50
+    public static function getAllTags()
51
+    {
46 52
         return Base::getEntryArrayWithBookNumber (self::SQL_ALL_TAGS, self::TAG_COLUMNS, array (), "Tag");
47 53
     }
48 54
 
49
-    public static function getAllTagsByQuery($query, $n, $database = NULL, $numberPerPage = NULL) {
55
+    public static function getAllTagsByQuery($query, $n, $database = NULL, $numberPerPage = NULL)
56
+    {
50 57
         $columns  = "tags.id as id, tags.name as name, (select count(*) from books_tags_link where tags.id = tag) as count";
51 58
         $sql = 'select {0} from tags where upper (tags.name) like ? {1} order by tags.name';
52 59
         list ($totalNumber, $result) = parent::executeQuery ($sql, $columns, "", array ('%' . $query . '%'), $n, $database, $numberPerPage);
53 60
         $entryArray = array();
54
-        while ($post = $result->fetchObject ())
55
-        {
61
+        while ($post = $result->fetchObject ()) {
56 62
             $tag = new Tag ($post);
57 63
             array_push ($entryArray, new Entry ($tag->name, $tag->getEntryId (),
58 64
                 str_format (localize("bookword", $post->count), $post->count), "text",
Please login to merge, or discard this patch.
lib/PageCustomize.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,7 +8,8 @@  discard block
 block discarded – undo
8 8
 
9 9
 class PageCustomize extends Page
10 10
 {
11
-    private function isChecked ($key, $testedValue = 1) {
11
+    private function isChecked ($key, $testedValue = 1)
12
+    {
12 13
         $value = getCurrentOption ($key);
13 14
         if (is_array ($value)) {
14 15
             if (in_array ($testedValue, $value)) {
@@ -22,14 +23,16 @@  discard block
 block discarded – undo
22 23
         return "";
23 24
     }
24 25
 
25
-    private function isSelected ($key, $value) {
26
+    private function isSelected ($key, $value)
27
+    {
26 28
         if (getCurrentOption ($key) == $value) {
27 29
             return "selected='selected'";
28 30
         }
29 31
         return "";
30 32
     }
31 33
 
32
-    private function getStyleList () {
34
+    private function getStyleList ()
35
+    {
33 36
         $result = array ();
34 37
         foreach (glob ("templates/" . getCurrentTemplate () . "/styles/style-*.css") as $filename) {
35 38
             if (preg_match ('/styles\/style-(.*?)\.css/', $filename, $m)) {
Please login to merge, or discard this patch.
lib/EntryBook.php 1 patch
Braces   +12 added lines, -7 removed lines patch added patch discarded remove patch
@@ -19,28 +19,33 @@
 block discarded – undo
19 19
      * @param array $plinkArray
20 20
      * @param Book $pbook
21 21
      */
22
-    public function __construct($ptitle, $pid, $pcontent, $pcontentType, $plinkArray, $pbook) {
22
+    public function __construct($ptitle, $pid, $pcontent, $pcontentType, $plinkArray, $pbook)
23
+    {
23 24
         parent::__construct ($ptitle, $pid, $pcontent, $pcontentType, $plinkArray);
24 25
         $this->book = $pbook;
25 26
         $this->localUpdated = $pbook->timestamp;
26 27
     }
27 28
 
28
-    public function getCoverThumbnail () {
29
+    public function getCoverThumbnail ()
30
+    {
29 31
         foreach ($this->linkArray as $link) {
30 32
             /* @var $link LinkNavigation */
31 33
 
32
-            if ($link->rel == Link::OPDS_THUMBNAIL_TYPE)
33
-                return $link->hrefXhtml ();
34
+            if ($link->rel == Link::OPDS_THUMBNAIL_TYPE) {
35
+                            return $link->hrefXhtml ();
36
+            }
34 37
         }
35 38
         return null;
36 39
     }
37 40
 
38
-    public function getCover () {
41
+    public function getCover ()
42
+    {
39 43
         foreach ($this->linkArray as $link) {
40 44
             /* @var $link LinkNavigation */
41 45
 
42
-            if ($link->rel == Link::OPDS_IMAGE_TYPE)
43
-                return $link->hrefXhtml ();
46
+            if ($link->rel == Link::OPDS_IMAGE_TYPE) {
47
+                            return $link->hrefXhtml ();
48
+            }
44 49
         }
45 50
         return null;
46 51
     }
Please login to merge, or discard this patch.