Completed
Branch master (31966b)
by Markus
09:57
created
serie.php 1 patch
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         if ($post = $result->fetchObject ()) {
42 42
             return new Serie ($post);
43 43
         }
44
-        return NULL;
44
+        return null;
45 45
     }
46 46
 
47 47
     public static function getSerieById ($serieId) {
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         if ($post = $result->fetchObject ()) {
51 51
             return new Serie ($post);
52 52
         }
53
-        return NULL;
53
+        return null;
54 54
     }
55 55
 
56 56
     public static function getAllSeries() {
Please login to merge, or discard this patch.
fetch.php 1 patch
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,9 +22,9 @@
 block discarded – undo
22 22
     header("Pragma: public");
23 23
     header("Cache-Control: maxage=".$expires);
24 24
     header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$expires) . ' GMT');
25
-    $bookId = getURLParam ("id", NULL);
25
+    $bookId = getURLParam ("id", null);
26 26
     $type = getURLParam ("type", "jpg");
27
-    $idData = getURLParam ("data", NULL);
27
+    $idData = getURLParam ("data", null);
28 28
     if (is_null ($bookId))
29 29
     {
30 30
         $book = Book::getBookByDataId($idData);
Please login to merge, or discard this patch.
sendtomail.php 1 patch
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
         empty ($config['cops_mail_configuration']["address.from"])) {
12 12
         return "NOK. bad configuration.";
13 13
     }
14
-    return False;
14
+    return false;
15 15
 }
16 16
 
17 17
 function checkRequest ($idData, $emailDest) {
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     if (empty ($emailDest)) {
22 22
         return 'No email sent.';
23 23
     }
24
-    return False;
24
+    return false;
25 25
 }
26 26
 
27 27
 if (php_sapi_name() === 'cli') { return; }
Please login to merge, or discard this patch.
epubfs.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
 
47 47
 if (php_sapi_name() === 'cli') { return; }
48 48
 
49
-$idData = getURLParam ("data", NULL);
49
+$idData = getURLParam ("data", null);
50 50
 $add = "data=$idData&";
51 51
 if (!is_null (GetUrlParam (DB))) $add .= DB . "=" . GetUrlParam (DB) . "&";
52 52
 $myBook = Book::getBookByDataId($idData);
Please login to merge, or discard this patch.
transliteration.php 1 patch
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  * @return
26 26
  *   Transliterated text.
27 27
  */
28
-function _transliteration_process($string, $unknown = '?', $source_langcode = NULL) {
28
+function _transliteration_process($string, $unknown = '?', $source_langcode = null) {
29 29
   // ASCII is always valid NFC! If we're only ever given plain ASCII, we can
30 30
   // avoid the overhead of initializing the decomposition tables by skipping
31 31
   // out early.
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
  * @return
176 176
  *   ASCII replacement character.
177 177
  */
178
-function _transliteration_replace($ord, $unknown = '?', $langcode = NULL) {
178
+function _transliteration_replace($ord, $unknown = '?', $langcode = null) {
179 179
   static $map = array();
180 180
 
181 181
   //GL: set language later
Please login to merge, or discard this patch.
publisher.php 1 patch
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         if ($post = $result->fetchObject ()) {
43 43
             return new Publisher ($post);
44 44
         }
45
-        return NULL;
45
+        return null;
46 46
     }
47 47
 
48 48
     public static function getPublisherById ($publisherId) {
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         if ($post = $result->fetchObject ()) {
53 53
             return new Publisher ($post);
54 54
         }
55
-        return NULL;
55
+        return null;
56 56
     }
57 57
 
58 58
     public static function getAllPublishers() {
Please login to merge, or discard this patch.
base.php 1 patch
Upper-Lower-Casing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -36,14 +36,14 @@  discard block
 block discarded – undo
36 36
     // If there is a syntax error in the function created
37 37
     // $dot will be equal to FALSE
38 38
     if (!$dot) {
39
-        return FALSE;
39
+        return false;
40 40
     }
41 41
     // Execute the template
42 42
     if (!empty ($data)) {
43 43
         return $dot ($data);
44 44
     }
45 45
 
46
-    return NULL;
46
+    return null;
47 47
 }
48 48
 
49 49
 function getQueryString () {
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     $_SERVER['REDIRECT_STATUS'] = 404;
61 61
 }
62 62
 
63
-function getURLParam ($name, $default = NULL) {
63
+function getURLParam ($name, $default = null) {
64 64
     if (!empty ($_GET) && isset($_GET[$name]) && $_GET[$name] != "") {
65 65
         return $_GET[$name];
66 66
     }
@@ -109,10 +109,10 @@  discard block
 block discarded – undo
109 109
 
110 110
     switch ($error->level) {
111 111
         case LIBXML_ERR_WARNING:
112
-            $return .= "Warning $error->code: ";
112
+            $return .= "warning $error->code: ";
113 113
             break;
114 114
          case LIBXML_ERR_ERROR:
115
-            $return .= "Error $error->code: ";
115
+            $return .= "error $error->code: ";
116 116
             break;
117 117
         case LIBXML_ERR_FATAL:
118 118
             $return .= "Fatal Error $error->code: ";
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
         $langs = getAcceptLanguages();
245 245
     }
246 246
     //echo var_dump($langs);
247
-    $lang_file = NULL;
247
+    $lang_file = null;
248 248
     foreach ($langs as $language => $val) {
249 249
         $temp_file = dirname(__FILE__). '/lang/Localization_' . $language . '.json';
250 250
         if (file_exists($temp_file)) {
@@ -273,13 +273,13 @@  discard block
 block discarded – undo
273 273
         $phrase .= ".many";
274 274
 
275 275
     /* Static keyword is used to ensure the file is loaded only once */
276
-    static $translations = NULL;
276
+    static $translations = null;
277 277
     if ($reset) {
278
-        $translations = NULL;
278
+        $translations = null;
279 279
     }
280 280
     /* If no instance of $translations has occured load the language file */
281 281
     if (is_null($translations)) {
282
-        $lang_file_en = NULL;
282
+        $lang_file_en = null;
283 283
         list ($lang, $lang_file) = getLangAndTranslationFile();
284 284
         if ($lang != "en") {
285 285
             $lang_file_en = dirname(__FILE__). '/lang/' . 'Localization_en.json';
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
     public $facetGroup;
357 357
     public $activeFacet;
358 358
 
359
-    public function __construct($phref, $ptype, $prel = NULL, $ptitle = NULL, $pfacetGroup = NULL, $pactiveFacet = FALSE) {
359
+    public function __construct($phref, $ptype, $prel = null, $ptitle = null, $pfacetGroup = null, $pactiveFacet = false) {
360 360
         $this->href = $phref;
361 361
         $this->type = $ptype;
362 362
         $this->rel = $prel;
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 
378 378
 class LinkNavigation extends Link
379 379
 {
380
-    public function __construct($phref, $prel = NULL, $ptitle = NULL) {
380
+    public function __construct($phref, $prel = null, $ptitle = null) {
381 381
         parent::__construct ($phref, Link::OPDS_NAVIGATION_TYPE, $prel, $ptitle);
382 382
         if (!is_null (GetUrlParam (DB))) $this->href = addURLParameter ($this->href, DB, GetUrlParam (DB));
383 383
         if (!preg_match ("#^\?(.*)#", $this->href) && !empty ($this->href)) $this->href = "?" . $this->href;
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 
392 392
 class LinkFacet extends Link
393 393
 {
394
-    public function __construct($phref, $ptitle = NULL, $pfacetGroup = NULL, $pactiveFacet = FALSE) {
394
+    public function __construct($phref, $ptitle = null, $pfacetGroup = null, $pactiveFacet = false) {
395 395
         parent::__construct ($phref, Link::OPDS_PAGING_TYPE, "http://opds-spec.org/facet", $ptitle, $pfacetGroup, $pactiveFacet);
396 396
         if (!is_null (GetUrlParam (DB))) $this->href = addURLParameter ($this->href, DB, GetUrlParam (DB));
397 397
         $this->href = parent::getScriptName() . $this->href;
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
     public $linkArray;
409 409
     public $localUpdated;
410 410
     public $className;
411
-    private static $updated = NULL;
411
+    private static $updated = null;
412 412
 
413 413
     public static $icons = array(
414 414
         Author::ALL_AUTHORS_ID       => 'images/author.png',
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
         if (($this->n) * getCurrentOption ("max_item_per_page") < $this->totalNumber) {
641 641
             return new LinkNavigation ($currentUrl . "&n=" . ($this->n + 1), "next", localize ("paging.next.alternate"));
642 642
         }
643
-        return NULL;
643
+        return null;
644 644
     }
645 645
 
646 646
     public function getPrevLink ()
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
         if ($this->n > 1) {
650 650
             return new LinkNavigation ($currentUrl . "&n=" . ($this->n - 1), "previous", localize ("paging.previous.alternate"));
651 651
         }
652
-        return NULL;
652
+        return null;
653 653
     }
654 654
 
655 655
     public function getMaxPage ()
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
 {
747 747
     public function InitializeContent ()
748 748
     {
749
-        $customId = getURLParam ("custom", NULL);
749
+        $customId = getURLParam ("custom", null);
750 750
         $custom = CustomColumn::getCustomById ($customId, $this->idGet);
751 751
         $this->idPage = $custom->getEntryId ();
752 752
         $this->title = $custom->name;
@@ -758,7 +758,7 @@  discard block
 block discarded – undo
758 758
 {
759 759
     public function InitializeContent ()
760 760
     {
761
-        $customId = getURLParam ("custom", NULL);
761
+        $customId = getURLParam ("custom", null);
762 762
         $this->title = CustomColumn::getAllTitle ($customId);
763 763
         $this->entryArray = CustomColumn::getAllCustoms($customId);
764 764
         $this->idPage = CustomColumn::getAllCustomsId ($customId);
@@ -882,9 +882,9 @@  discard block
 block discarded – undo
882 882
         return !is_null (getURLParam ("search"));
883 883
     }
884 884
 
885
-    private function searchByScope ($scope, $limit = FALSE) {
885
+    private function searchByScope ($scope, $limit = false) {
886 886
         $n = $this->n;
887
-        $numberPerPage = NULL;
887
+        $numberPerPage = null;
888 888
         $queryNormedAndUp = $this->query;
889 889
         if (useNormAndUp ()) {
890 890
             $queryNormedAndUp = normAndUp ($this->query);
@@ -895,7 +895,7 @@  discard block
 block discarded – undo
895 895
         }
896 896
         switch ($scope) {
897 897
             case self::SCOPE_BOOK :
898
-                $array = Book::getBooksByStartingLetter ('%' . $queryNormedAndUp, $n, NULL, $numberPerPage);
898
+                $array = Book::getBooksByStartingLetter ('%' . $queryNormedAndUp, $n, null, $numberPerPage);
899 899
                 break;
900 900
             case self::SCOPE_AUTHOR :
901 901
                 $array = Author::getAuthorsForSearch ('%' . $queryNormedAndUp);
@@ -904,7 +904,7 @@  discard block
 block discarded – undo
904 904
                 $array = Serie::getAllSeriesByQuery ($queryNormedAndUp);
905 905
                 break;
906 906
             case self::SCOPE_TAG :
907
-                $array = Tag::getAllTagsByQuery ($queryNormedAndUp, $n, NULL, $numberPerPage);
907
+                $array = Tag::getAllTagsByQuery ($queryNormedAndUp, $n, null, $numberPerPage);
908 908
                 break;
909 909
             case self::SCOPE_PUBLISHER :
910 910
                 $array = Publisher::getAllPublishersByQuery ($queryNormedAndUp);
@@ -944,7 +944,7 @@  discard block
 block discarded – undo
944 944
                 if (in_array($key, getCurrentOption ('ignored_categories'))) {
945 945
                     continue;
946 946
                 }
947
-                $array = $this->searchByScope ($key, TRUE);
947
+                $array = $this->searchByScope ($key, true);
948 948
 
949 949
                 $i = 0;
950 950
                 if (count ($array) == 2 && is_array ($array [0])) {
@@ -1165,7 +1165,7 @@  discard block
 block discarded – undo
1165 1165
 
1166 1166
     const COMPATIBILITY_XML_ALDIKO = "aldiko";
1167 1167
 
1168
-    private static $db = NULL;
1168
+    private static $db = null;
1169 1169
 
1170 1170
     public static function isMultipleDatabaseEnabled () {
1171 1171
         global $config;
@@ -1201,7 +1201,7 @@  discard block
 block discarded – undo
1201 1201
         }
1202 1202
     }
1203 1203
 
1204
-    public static function getDbName ($database = NULL) {
1204
+    public static function getDbName ($database = null) {
1205 1205
         global $config;
1206 1206
         if (self::isMultipleDatabaseEnabled ()) {
1207 1207
             if (is_null ($database)) $database = GetUrlParam (DB, 0);
@@ -1214,7 +1214,7 @@  discard block
 block discarded – undo
1214 1214
         return "";
1215 1215
     }
1216 1216
 
1217
-    public static function getDbDirectory ($database = NULL) {
1217
+    public static function getDbDirectory ($database = null) {
1218 1218
         global $config;
1219 1219
         if (self::isMultipleDatabaseEnabled ()) {
1220 1220
             if (is_null ($database)) $database = GetUrlParam (DB, 0);
@@ -1228,7 +1228,7 @@  discard block
 block discarded – undo
1228 1228
     }
1229 1229
 
1230 1230
 
1231
-    public static function getDbFileName ($database = NULL) {
1231
+    public static function getDbFileName ($database = null) {
1232 1232
         return self::getDbDirectory ($database) .'metadata.db';
1233 1233
     }
1234 1234
 
@@ -1239,7 +1239,7 @@  discard block
 block discarded – undo
1239 1239
         throw new Exception("Database <{$database}> not found.");
1240 1240
     }
1241 1241
 
1242
-    public static function getDb ($database = NULL) {
1242
+    public static function getDb ($database = null) {
1243 1243
         if (is_null (self::$db)) {
1244 1244
             try {
1245 1245
                 if (is_readable (self::getDbFileName ($database))) {
@@ -1270,19 +1270,19 @@  discard block
 block discarded – undo
1270 1270
     }
1271 1271
 
1272 1272
     public static function clearDb () {
1273
-        self::$db = NULL;
1273
+        self::$db = null;
1274 1274
     }
1275 1275
 
1276
-    public static function executeQuerySingle ($query, $database = NULL) {
1276
+    public static function executeQuerySingle ($query, $database = null) {
1277 1277
         return self::getDb ($database)->query($query)->fetchColumn();
1278 1278
     }
1279 1279
 
1280
-    public static function getCountGeneric($table, $id, $pageId, $numberOfString = NULL) {
1280
+    public static function getCountGeneric($table, $id, $pageId, $numberOfString = null) {
1281 1281
         if (!$numberOfString) {
1282 1282
             $numberOfString = $table . ".alphabetical";
1283 1283
         }
1284 1284
         $count = self::executeQuerySingle ('select count(*) from ' . $table);
1285
-        if ($count == 0) return NULL;
1285
+        if ($count == 0) return null;
1286 1286
         $entry = new Entry (localize($table . ".title"), $id,
1287 1287
             str_format (localize($numberOfString, $count), $count), "text",
1288 1288
             array ( new LinkNavigation ("?page=".$pageId)), "", $count);
@@ -1307,7 +1307,7 @@  discard block
 block discarded – undo
1307 1307
         return $entryArray;
1308 1308
     }
1309 1309
 
1310
-    public static function executeQuery($query, $columns, $filter, $params, $n, $database = NULL, $numberPerPage = NULL) {
1310
+    public static function executeQuery($query, $columns, $filter, $params, $n, $database = null, $numberPerPage = null) {
1311 1311
         $totalResult = -1;
1312 1312
 
1313 1313
         if (useNormAndUp ()) {
Please login to merge, or discard this patch.
OPDS_renderer.php 1 patch
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@
 block discarded – undo
10 10
 
11 11
 class OPDSRenderer
12 12
 {
13
-    private $xmlStream = NULL;
14
-    private $updated = NULL;
13
+    private $xmlStream = null;
14
+    private $updated = null;
15 15
 
16 16
     private function getUpdatedTime () {
17 17
         if (is_null ($this->updated)) {
Please login to merge, or discard this patch.
customcolumn.php 1 patch
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         if ($post = $result->fetchObject ()) {
61 61
             return $post->id;
62 62
         }
63
-        return NULL;
63
+        return null;
64 64
     }
65 65
 
66 66
     public static function getCount($customId) {
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         if ($post = $result->fetchObject ()) {
78 78
             return new CustomColumn ($post->id, $post->name, $customId);
79 79
         }
80
-        return NULL;
80
+        return null;
81 81
     }
82 82
 
83 83
     public static function getAllCustoms($customId) {
Please login to merge, or discard this patch.