1 | <?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed'); |
||
3 | class MerakiScans extends Base_Site_Model { |
||
4 | public $titleFormat = '/^[a-zA-Z0-9_-]+$/'; |
||
5 | public $chapterFormat = '/^[0-9\.]+$/'; |
||
6 | |||
7 | public function getFullTitleURL(string $title_url) : string { |
||
10 | |||
11 | public function getChapterData(string $title_url, string $chapter) : array { |
||
17 | |||
18 | public function getTitleData(string $title_url, bool $firstGet = FALSE) : ?array { |
||
44 | } |
||
45 |
This check looks for type mismatches where the missing type is
false
. This is usually indicative of an error condtion.Consider the follow example
This function either returns a new
DateTime
object or false, if there was an error. This is a typical pattern in PHP programming to show that an error has occurred without raising an exception. The calling code should check for this returnedfalse
before passing on the value to another function or method that may not be able to handle afalse
.