-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpOffice\WMF\Reader\WMF; | ||
|
||
use GdImage; | ||
use PhpOffice\WMF\Exception\WMFException; | ||
|
||
abstract class ReaderAbstract implements ReaderInterface | ||
{ | ||
protected $hasExceptionsEnabled = true; | ||
Check failure on line 12 in src/WMF/Reader/WMF/ReaderAbstract.php GitHub Actions / PHP Static Analysis (7.1)
Check failure on line 12 in src/WMF/Reader/WMF/ReaderAbstract.php GitHub Actions / PHP Static Analysis (7.2)
Check failure on line 12 in src/WMF/Reader/WMF/ReaderAbstract.php GitHub Actions / PHP Static Analysis (7.3)
Check failure on line 12 in src/WMF/Reader/WMF/ReaderAbstract.php GitHub Actions / PHP Static Analysis (7.4)
Check failure on line 12 in src/WMF/Reader/WMF/ReaderAbstract.php GitHub Actions / PHP Static Analysis (8.0)
Check failure on line 12 in src/WMF/Reader/WMF/ReaderAbstract.php GitHub Actions / PHP Static Analysis (8.1)
Check failure on line 12 in src/WMF/Reader/WMF/ReaderAbstract.php GitHub Actions / PHP Static Analysis (8.2)
|
||
|
||
/** | ||
* Enable/Disable throwing exceptions | ||
* | ||
* By default, it's enabled | ||
*/ | ||
public function enableExceptions(bool $enable): self | ||
{ | ||
$this->hasExceptionsEnabled = $enable; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Returns if exceptions are thrown | ||
*/ | ||
public function hasExceptionsEnabled(): bool | ||
{ | ||
return $this->hasExceptionsEnabled; | ||
} | ||
|
||
public function getMediaType(): string | ||
{ | ||
return 'image/wmf'; | ||
} | ||
} |