Test Setup Failed
Pull Request — master (#424)
by
unknown
02:56
created
base.php 2 patches
Doc Comments   +11 added lines patch added patch discarded remove patch
@@ -64,6 +64,9 @@  discard block
 block discarded – undo
64 64
     $_SERVER['REDIRECT_STATUS'] = 404;
65 65
 }
66 66
 
67
+/**
68
+ * @param string $name
69
+ */
67 70
 function getURLParam($name, $default = NULL)
68 71
 {
69 72
     if (!empty ($_GET) && isset($_GET[$name]) && $_GET[$name] != '') {
@@ -104,6 +107,11 @@  discard block
 block discarded – undo
104 107
     return $url . '?v=' . VERSION;
105 108
 }
106 109
 
110
+/**
111
+ * @param string $xml
112
+ *
113
+ * @return string
114
+ */
107 115
 function xml2xhtml($xml)
108 116
 {
109 117
     return preg_replace_callback('#<(\w+)([^>]*)\s*/>#s', function($m) {
@@ -326,6 +334,9 @@  discard block
 block discarded – undo
326 334
     return $phrase;
327 335
 }
328 336
 
337
+/**
338
+ * @param string $paramName
339
+ */
329 340
 function addURLParameter($urlParams, $paramName, $paramValue)
330 341
 {
331 342
     if (empty ($urlParams)) {
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
     // Generate the function for the template
33 33
     $template = new doT ();
34 34
     $dot = $template->template ($page, array ('bookdetail' => $bookdetail,
35
-                                              'header' => $header,
36
-                                              'footer' => $footer,
37
-                                              'main' => $main));
35
+                                                'header' => $header,
36
+                                                'footer' => $footer,
37
+                                                'main' => $main));
38 38
     // If there is a syntax error in the function created
39 39
     // $dot will be equal to FALSE
40 40
     if (!$dot) {
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         case LIBXML_ERR_WARNING:
126 126
             $return .= 'Warning ' . $error->code . ': ';
127 127
             break;
128
-         case LIBXML_ERR_ERROR:
128
+            case LIBXML_ERR_ERROR:
129 129
             $return .= 'Error ' . $error->code . ': ';
130 130
             break;
131 131
         case LIBXML_ERR_FATAL:
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
     }
135 135
 
136 136
     $return .= trim($error->message) .
137
-               "\n  Line: " . $error->line .
138
-               "\n  Column: " . $error->column;
137
+                "\n  Line: " . $error->line .
138
+                "\n  Column: " . $error->column;
139 139
 
140 140
     if ($error->file) {
141 141
         $return .= "\n  File: " . $error->file;
Please login to merge, or discard this patch.
lib/Author.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -62,6 +62,9 @@  discard block
 block discarded – undo
62 62
         return self::getEntryArray (self::SQL_AUTHORS_BY_FIRST_LETTER, array ($letter . "%"));
63 63
     }
64 64
 
65
+    /**
66
+     * @param string $query
67
+     */
65 68
     public static function getAuthorsForSearch($query) {
66 69
         return self::getEntryArray (self::SQL_AUTHORS_FOR_SEARCH, array ($query . "%", $query . "%"));
67 70
     }
@@ -70,6 +73,9 @@  discard block
 block discarded – undo
70 73
         return self::getEntryArray (self::SQL_ALL_AUTHORS, array ());
71 74
     }
72 75
 
76
+    /**
77
+     * @param string $query
78
+     */
73 79
     public static function getEntryArray ($query, $params) {
74 80
         return Base::getEntryArrayWithBookNumber ($query, self::AUTHOR_COLUMNS, $params, "Author");
75 81
     }
Please login to merge, or discard this patch.
lib/Base.php 2 patches
Doc Comments   +18 added lines patch added patch discarded remove patch
@@ -84,6 +84,9 @@  discard block
 block discarded – undo
84 84
         return "";
85 85
     }
86 86
 
87
+    /**
88
+     * @return string
89
+     */
87 90
     public static function getDbDirectory ($database = NULL) {
88 91
         global $config;
89 92
         if (self::isMultipleDatabaseEnabled ()) {
@@ -143,10 +146,18 @@  discard block
 block discarded – undo
143 146
         self::$db = NULL;
144 147
     }
145 148
 
149
+    /**
150
+     * @param string $query
151
+     */
146 152
     public static function executeQuerySingle ($query, $database = NULL) {
147 153
         return self::getDb ($database)->query($query)->fetchColumn();
148 154
     }
149 155
 
156
+    /**
157
+     * @param string $table
158
+     * @param string $id
159
+     * @param string $numberOfString
160
+     */
150 161
     public static function getCountGeneric($table, $id, $pageId, $numberOfString = NULL) {
151 162
         if (!$numberOfString) {
152 163
             $numberOfString = $table . ".alphabetical";
@@ -159,6 +170,10 @@  discard block
 block discarded – undo
159 170
         return $entry;
160 171
     }
161 172
 
173
+    /**
174
+     * @param string $columns
175
+     * @param string $category
176
+     */
162 177
     public static function getEntryArrayWithBookNumber ($query, $columns, $params, $category) {
163 178
         /* @var $result PDOStatement */
164 179
 
@@ -181,6 +196,9 @@  discard block
 block discarded – undo
181 196
         return $entryArray;
182 197
     }
183 198
 
199
+    /**
200
+     * @param string $filter
201
+     */
184 202
     public static function executeQuery($query, $columns, $filter, $params, $n, $database = NULL, $numberPerPage = NULL) {
185 203
         $totalResult = -1;
186 204
 
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -99,13 +99,13 @@
 block discarded – undo
99 99
 
100 100
     // -DC- Add image directory
101 101
     public static function getImgDirectory ($database = NULL) {
102
-    	global $config;
103
-    	if (self::isMultipleDatabaseEnabled ()) {
104
-    		if (is_null ($database)) $database = GetUrlParam (DB, 0);
105
-    		$array = array_values ($config['image_directory']);
106
-    		return  $array[$database];
107
-    	}
108
-    	return $config['image_directory'];
102
+        global $config;
103
+        if (self::isMultipleDatabaseEnabled ()) {
104
+            if (is_null ($database)) $database = GetUrlParam (DB, 0);
105
+            $array = array_values ($config['image_directory']);
106
+            return  $array[$database];
107
+        }
108
+        return $config['image_directory'];
109 109
     }
110 110
 
111 111
     public static function getDbFileName ($database = NULL) {
Please login to merge, or discard this patch.
lib/CustomColumnType.php 1 patch
Doc Comments   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,6 +39,9 @@  discard block
 block discarded – undo
39 39
     /** @var null|Entry[] */
40 40
     private $customValues = NULL;
41 41
 
42
+    /**
43
+     * @param string $pdatatype
44
+     */
42 45
     protected function __construct($pcustomId, $pdatatype)
43 46
     {
44 47
         $this->columnTitle = self::getTitleByCustomID($pcustomId);
@@ -147,7 +150,7 @@  discard block
 block discarded – undo
147 150
     /**
148 151
      * Encode a value of this column ready to be displayed in an HTML document
149 152
      *
150
-     * @param integer|string $value
153
+     * @param string $value
151 154
      * @return string
152 155
      */
153 156
     public function encodeHTMLValue($value)
@@ -277,7 +280,7 @@  discard block
 block discarded – undo
277 280
     /**
278 281
      * Get a CustomColumn for a specified (by ID) value
279 282
      *
280
-     * @param string|integer $id the id of the searched value
283
+     * @param integer $id the id of the searched value
281 284
      * @return CustomColumn
282 285
      */
283 286
     abstract public function getCustom($id);
Please login to merge, or discard this patch.
lib/LinkFacet.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -8,6 +8,9 @@
 block discarded – undo
8 8
 
9 9
 class LinkFacet extends Link
10 10
 {
11
+    /**
12
+     * @param string $phref
13
+     */
11 14
     public function __construct($phref, $ptitle = NULL, $pfacetGroup = NULL, $pactiveFacet = FALSE) {
12 15
         parent::__construct ($phref, Link::OPDS_PAGING_TYPE, "http://opds-spec.org/facet", $ptitle, $pfacetGroup, $pactiveFacet);
13 16
         if (!is_null (GetUrlParam (DB))) $this->href = addURLParameter ($this->href, DB, GetUrlParam (DB));
Please login to merge, or discard this patch.
lib/LinkNavigation.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -8,6 +8,9 @@
 block discarded – undo
8 8
 
9 9
 class LinkNavigation extends Link
10 10
 {
11
+    /**
12
+     * @param string $prel
13
+     */
11 14
     public function __construct($phref, $prel = NULL, $ptitle = NULL) {
12 15
         parent::__construct ($phref, Link::OPDS_NAVIGATION_TYPE, $prel, $ptitle);
13 16
         if (!is_null (GetUrlParam (DB))) $this->href = addURLParameter ($this->href, DB, GetUrlParam (DB));
Please login to merge, or discard this patch.
lib/PageCustomize.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -8,6 +8,9 @@  discard block
 block discarded – undo
8 8
 
9 9
 class PageCustomize extends Page
10 10
 {
11
+    /**
12
+     * @param string $key
13
+     */
11 14
     private function isChecked ($key, $testedValue = 1) {
12 15
         $value = getCurrentOption ($key);
13 16
         if (is_array ($value)) {
@@ -22,6 +25,9 @@  discard block
 block discarded – undo
22 25
         return "";
23 26
     }
24 27
 
28
+    /**
29
+     * @param string $key
30
+     */
25 31
     private function isSelected ($key, $value) {
26 32
         if (getCurrentOption ($key) == $value) {
27 33
             return "selected='selected'";
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -45,11 +45,11 @@
 block discarded – undo
45 45
         $this->entryArray = array ();
46 46
 
47 47
         $ignoredBaseArray = array (PageQueryResult::SCOPE_AUTHOR,
48
-                                   PageQueryResult::SCOPE_TAG,
49
-                                   PageQueryResult::SCOPE_SERIES,
50
-                                   PageQueryResult::SCOPE_PUBLISHER,
51
-                                   PageQueryResult::SCOPE_RATING,
52
-                                   "language");
48
+                                    PageQueryResult::SCOPE_TAG,
49
+                                    PageQueryResult::SCOPE_SERIES,
50
+                                    PageQueryResult::SCOPE_PUBLISHER,
51
+                                    PageQueryResult::SCOPE_RATING,
52
+                                    "language");
53 53
 
54 54
         $content = "";
55 55
         array_push ($this->entryArray, new Entry ("Template", "",
Please login to merge, or discard this patch.
lib/Rating.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -38,6 +38,9 @@
 block discarded – undo
38 38
         return self::getEntryArray (self::SQL_ALL_RATINGS, array ());
39 39
     }
40 40
 
41
+    /**
42
+     * @param string $query
43
+     */
41 44
     public static function getEntryArray ($query, $params) {
42 45
         list (, $result) = parent::executeQuery ($query, self::RATING_COLUMNS, "", $params, -1);
43 46
         $entryArray = array();
Please login to merge, or discard this patch.
index.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -37,14 +37,14 @@
 block discarded – undo
37 37
     header('Content-Type:text/html;charset=utf-8');
38 38
 
39 39
     $data = array('title'                 => $config['cops_title_default'],
40
-                  'version'               => VERSION,
41
-                  'opds_url'              => $config['cops_full_url'] . 'feed.php',
42
-                  'customHeader'          => '',
43
-                  'template'              => getCurrentTemplate(),
44
-                  'server_side_rendering' => useServerSideRendering(),
45
-                  'current_css'           => getCurrentCss(),
46
-                  'favico'                => $config['cops_icon'],
47
-                  'getjson_url'           => 'getJSON.php?' . addURLParameter(getQueryString(), 'complete', 1));
40
+                    'version'               => VERSION,
41
+                    'opds_url'              => $config['cops_full_url'] . 'feed.php',
42
+                    'customHeader'          => '',
43
+                    'template'              => getCurrentTemplate(),
44
+                    'server_side_rendering' => useServerSideRendering(),
45
+                    'current_css'           => getCurrentCss(),
46
+                    'favico'                => $config['cops_icon'],
47
+                    'getjson_url'           => 'getJSON.php?' . addURLParameter(getQueryString(), 'complete', 1));
48 48
     if (preg_match('/Kindle/', $_SERVER['HTTP_USER_AGENT'])) {
49 49
         $data['customHeader'] = '<style media="screen" type="text/css"> html { font-size: 75%; -webkit-text-size-adjust: 75%; -ms-text-size-adjust: 75%; }</style>';
50 50
     }
Please login to merge, or discard this patch.