Test Setup Failed
Pull Request — master (#497)
by
unknown
02:29
created
lib/Book.php 1 patch
Upper-Lower-Casing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -101,13 +101,13 @@  discard block
 block discarded – undo
101 101
     public $seriesIndex;
102 102
     public $comment;
103 103
     public $rating;
104
-    public $datas = NULL;
105
-    public $authors = NULL;
106
-    public $publisher = NULL;
107
-    public $serie = NULL;
108
-    public $tags = NULL;
109
-    public $identifiers = NULL;
110
-    public $languages = NULL;
104
+    public $datas = null;
105
+    public $authors = null;
106
+    public $publisher = null;
107
+    public $serie = null;
108
+    public $tags = null;
109
+    public $identifiers = null;
110
+    public $languages = null;
111 111
     public $format = array ();
112 112
 
113 113
 
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
     /* End of other class (author, series, tag, ...) initialization and accessors */
268 268
 
269 269
     public static function getFilterString() {
270
-        $filter = getURLParam('tag', NULL);
270
+        $filter = getURLParam('tag', null);
271 271
         if (empty($filter)) return '';
272 272
 
273 273
         $exists = true;
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
     {
290 290
         $bestFormatForKindle = array('EPUB', 'PDF', 'AZW3', 'MOBI');
291 291
         $bestRank = -1;
292
-        $bestData = NULL;
292
+        $bestData = null;
293 293
         foreach ($this->getDatas() as $data) {
294 294
             $key = array_search($data->format, $bestFormatForKindle);
295 295
             if ($key !== false && $key > $bestRank) {
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
         return reset($reduced);
357 357
     }
358 358
 
359
-    public function getFilePath($extension, $idData = NULL, $relative = false)
359
+    public function getFilePath($extension, $idData = null, $relative = false)
360 360
     {
361 361
         if ($extension == 'jpg')
362 362
         {
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
         else
366 366
         {
367 367
             $data = $this->getDataById($idData);
368
-            if (!$data) return NULL;
368
+            if (!$data) return null;
369 369
             $file = $data->name . '.' . strtolower($data->format);
370 370
         }
371 371
 
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
         }
418 418
     }
419 419
 
420
-    public function getThumbnail($width, $height, $outputfile = NULL) {
420
+    public function getThumbnail($width, $height, $outputfile = null) {
421 421
         if (is_null($width) && is_null($height)) {
422 422
             return false;
423 423
         }
@@ -458,9 +458,9 @@  discard block
 block discarded – undo
458 458
 
459 459
         if ($this->hasCover)
460 460
         {
461
-            array_push($linkArray, Data::getLink($this, 'jpg', 'image/jpeg', Link::OPDS_IMAGE_TYPE, 'cover.jpg', NULL));
461
+            array_push($linkArray, Data::getLink($this, 'jpg', 'image/jpeg', Link::OPDS_IMAGE_TYPE, 'cover.jpg', null));
462 462
 
463
-            array_push($linkArray, Data::getLink($this, 'jpg', 'image/jpeg', Link::OPDS_THUMBNAIL_TYPE, 'cover.jpg', NULL));
463
+            array_push($linkArray, Data::getLink($this, 'jpg', 'image/jpeg', Link::OPDS_THUMBNAIL_TYPE, 'cover.jpg', null));
464 464
         }
465 465
 
466 466
         foreach ($this->getDatas() as $data)
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
             $this->getLinkArray(), $this);
492 492
     }
493 493
 
494
-    public static function getBookCount($database = NULL) {
494
+    public static function getBookCount($database = null) {
495 495
         return parent::executeQuerySingle('select count(*) from books', $database);
496 496
     }
497 497
 
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
             $book = new Book($post);
561 561
             return $book;
562 562
         }
563
-        return NULL;
563
+        return null;
564 564
     }
565 565
 
566 566
     public static function getBookByDataId($dataId) {
@@ -576,10 +576,10 @@  discard block
 block discarded – undo
576 576
             $book->datas = array($data);
577 577
             return $book;
578 578
         }
579
-        return NULL;
579
+        return null;
580 580
     }
581 581
 
582
-    public static function getBooksByQuery($query, $n, $database = NULL, $numberPerPage = NULL) {
582
+    public static function getBooksByQuery($query, $n, $database = null, $numberPerPage = null) {
583 583
         $i = 0;
584 584
         $critArray = array();
585 585
         foreach (array(PageQueryResult::SCOPE_AUTHOR,
@@ -626,11 +626,11 @@  discard block
 block discarded – undo
626 626
         return $entryArray;
627 627
     }
628 628
 
629
-    public static function getBooksByStartingLetter($letter, $n, $database = NULL, $numberPerPage = NULL) {
629
+    public static function getBooksByStartingLetter($letter, $n, $database = null, $numberPerPage = null) {
630 630
         return self::getEntryArray(self::SQL_BOOKS_BY_FIRST_LETTER, array($letter . '%'), $n, $database, $numberPerPage);
631 631
     }
632 632
 
633
-    public static function getEntryArray($query, $params, $n, $database = NULL, $numberPerPage = NULL) {
633
+    public static function getEntryArray($query, $params, $n, $database = null, $numberPerPage = null) {
634 634
         /* @var $totalNumber integer */
635 635
         /* @var $result PDOStatement */
636 636
         list($totalNumber, $result) = parent::executeQuery($query, self::BOOK_COLUMNS, self::getFilterString(), $params, $n, $database, $numberPerPage);
Please login to merge, or discard this patch.