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