On the MainPage RequestContextCreateSkin hook is called twice. It's because Parser::braceSubstitution() creates a new RequestContext instance (https://github.com/wikimedia/mediawiki/blob/master/includes/parser/Parser.php#L3202). Minerva hook onSpecialPageBeforeExecute try to get a skin which is not created as it operates on newly created RequestContext. It doesn't have side effects, my concerns are around performance as execute lots of uncesseary code.
Trace:
First Call
#0 /vagrant/mediawiki/includes/Hooks.php(186): MobileFrontendHooks::onRequestContextCreateSkin() #1 /vagrant/mediawiki/includes/context/RequestContext.php(406): Hooks::run() #2 /vagrant/mediawiki/includes/context/ContextSource.php(154): RequestContext->getSkin() #3 /vagrant/mediawiki/extensions/MobileFrontend/includes/Minerva.hooks.php(30): ContextSource->getSkin() #4 /vagrant/mediawiki/includes/Hooks.php(186): MinervaHooks::onSpecialPageBeforeExecute() #5 /vagrant/mediawiki/includes/specialpage/SpecialPage.php(515): Hooks::run() #6 /vagrant/mediawiki/includes/specialpage/SpecialPageFactory.php(578): SpecialPage->run() #7 /vagrant/mediawiki/includes/specialpage/SpecialPageFactory.php(633): SpecialPageFactory::executePath() #8 /vagrant/mediawiki/includes/parser/Parser.php(3213): SpecialPageFactory::capturePath() #9 /vagrant/mediawiki/includes/parser/Preprocessor_Hash.php(1039): Parser->braceSubstitution() #10 /vagrant/mediawiki/includes/parser/Preprocessor_Hash.php(1472): PPFrame_Hash->expand() #11 /vagrant/mediawiki/includes/parser/Parser.php(3287): PPTemplateFrame_Hash->cachedExpand() #12 /vagrant/mediawiki/includes/parser/Preprocessor_Hash.php(1039): Parser->braceSubstitution() #13 /vagrant/mediawiki/includes/parser/Parser.php(2950): PPFrame_Hash->expand() #14 /vagrant/mediawiki/includes/parser/Parser.php(1305): Parser->replaceVariables() #15 /vagrant/mediawiki/includes/parser/Parser.php(451): Parser->internalParse() #16 /vagrant/mediawiki/includes/content/WikitextContent.php(330): Parser->parse() #17 /vagrant/mediawiki/includes/content/AbstractContent.php(497): WikitextContent->fillParserOutput() #18 /vagrant/mediawiki/includes/poolcounter/PoolWorkArticleView.php(140): AbstractContent->getParserOutput() #19 /vagrant/mediawiki/includes/poolcounter/PoolCounterWork.php(123): PoolWorkArticleView->doWork() #20 /vagrant/mediawiki/includes/page/Article.php(586): PoolCounterWork->execute() #21 /vagrant/mediawiki/includes/actions/ViewAction.php(68): Article->view() #22 /vagrant/mediawiki/includes/MediaWiki.php(499): ViewAction->show() #23 /vagrant/mediawiki/includes/MediaWiki.php(293): MediaWiki->performAction() #24 /vagrant/mediawiki/includes/MediaWiki.php(862): MediaWiki->performRequest() #25 /vagrant/mediawiki/includes/MediaWiki.php(523): MediaWiki->main() #26 /vagrant/mediawiki/index.php(43): MediaWiki->run() #27 /var/www/w/index.php(5): include() #28 {main}
Second call
#0 /vagrant/mediawiki/includes/Hooks.php(186): MobileFrontendHooks::onRequestContextCreateSkin() #1 /vagrant/mediawiki/includes/context/RequestContext.php(406): Hooks::run() #2 /vagrant/mediawiki/includes/context/ContextSource.php(154): RequestContext->getSkin() #3 /vagrant/mediawiki/includes/parser/ParserOutput.php(267): ContextSource->getSkin() #4 /vagrant/mediawiki/includes/parser/ParserOutput.php(275): Closure$ParserOutput::getText() #5 /vagrant/mediawiki/includes/OutputPage.php(1879): ParserOutput->getText() #6 /vagrant/mediawiki/includes/OutputPage.php(1900): OutputPage->addParserOutputText() #7 /vagrant/mediawiki/includes/page/Article.php(601): OutputPage->addParserOutput() #8 /vagrant/mediawiki/includes/actions/ViewAction.php(68): Article->view() #9 /vagrant/mediawiki/includes/MediaWiki.php(499): ViewAction->show() #10 /vagrant/mediawiki/includes/MediaWiki.php(293): MediaWiki->performAction() #11 /vagrant/mediawiki/includes/MediaWiki.php(862): MediaWiki->performRequest() #12 /vagrant/mediawiki/includes/MediaWiki.php(523): MediaWiki->main() #13 /vagrant/mediawiki/index.php(43): MediaWiki->run() #14 /var/www/w/index.php(5): include() #15 {main}