MissingPageException::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php declare( strict_types=1 );
2
3
namespace BotRiconferme\Exception;
4
5
/**
6
 * Error thrown when trying to read a non-existent page, or write it when nocreate is specified
7
 */
8
class MissingPageException extends APIRequestException {
9
	/**
10
	 * @param string|null $title If available
11
	 */
12
	public function __construct( string $title = null ) {
13
		if ( $title ) {
14
			parent::__construct( "The specified page doesn't exist: $title" );
15
		} else {
16
			parent::__construct();
17
		}
18
	}
19
}
20