Use PHP type hints

* Add PHP type hints where possible.
* Remove @var, @param and @return if redundant to type declaration.

Change-Id: Ief9f12370b094188b95fe48d3b1d68988da1e9b8
This commit is contained in:
Fomafix 2024-09-16 07:20:43 +00:00
parent 0ef42f8c1c
commit d3ba6712ab

View file

@ -23,16 +23,9 @@ class Hooks implements
EditPage__showEditForm_initialHook, EditPage__showEditForm_initialHook,
EditPage__showReadOnlyForm_initialHook EditPage__showReadOnlyForm_initialHook
{ {
/** @var UserOptionsLookup */ private UserOptionsLookup $userOptionsLookup;
private $userOptionsLookup; private HookRunner $hookRunner;
/** @var HookRunner */
private $hookRunner;
/**
* @param UserOptionsLookup $userOptionsLookup
* @param HookContainer $hookContainer
*/
public function __construct( public function __construct(
UserOptionsLookup $userOptionsLookup, UserOptionsLookup $userOptionsLookup,
HookContainer $hookContainer HookContainer $hookContainer
@ -41,13 +34,7 @@ class Hooks implements
$this->hookRunner = new HookRunner( $hookContainer ); $this->hookRunner = new HookRunner( $hookContainer );
} }
/** private function getPageLanguage( Title $title, string $model, string $format ): ?string {
* @param Title $title
* @param string $model
* @param string $format
* @return null|string
*/
private function getPageLanguage( Title $title, $model, $format ) {
if ( $model === CONTENT_MODEL_JAVASCRIPT ) { if ( $model === CONTENT_MODEL_JAVASCRIPT ) {
return 'javascript'; return 'javascript';
} elseif ( $model === CONTENT_MODEL_CSS ) { } elseif ( $model === CONTENT_MODEL_CSS ) {