Use typed properties in MissingExtensionException

Introduce typed properties for $isSkin, $extName, $path, and
$error in MissingExtensionException, eliminating docblock
annotations for a cleaner and type-safe codebase.

Change-Id: I8e05245da1eb0952a8adf28b64ab72f5a0ecfdfb
This commit is contained in:
Doğu Abaris 2024-04-01 15:05:54 +02:00 committed by Abaris
parent d96f37b412
commit 895aad4b80

View file

@ -14,20 +14,16 @@ use MediaWiki\Html\TemplateParser;
* @internal
*/
class MissingExtensionException extends Exception {
/** @var bool */
private $isSkin;
/** @var string */
private $extName = 'unknown';
/** @var string */
private $path;
/** @var string */
private $error;
private bool $isSkin;
private string $extName = 'unknown';
private string $path;
private string $error;
/**
* @param string $path Path of file that cannot be read
* @param string $error Text of error mtime gave
*/
public function __construct( $path, $error ) {
public function __construct( string $path, string $error ) {
$this->isSkin = str_ends_with( $path, "/skin.json" );
$m = [];
preg_match( "!/([^/]*)/[^/]*.json$!", $path, $m );