Code
- GlobalFunctions.php ➔ wfLoadExtension()
- GlobalFunctions.php ➔ wfLoadExtensions()
- GlobalFunctions.php ➔ wfLoadSkin()
- GlobalFunctions.php ➔ wfLoadSkins()
- GlobalFunctions.php ➔ wfArrayDiff2()
- GlobalFunctions.php ➔ wfArrayDiff2_cmp()
- GlobalFunctions.php ➔ wfAppendToArrayIfNotDefault()
- GlobalFunctions.php ➔ wfMergeErrorArrays()
- GlobalFunctions.php ➔ wfArrayInsertAfter()
- GlobalFunctions.php ➔ wfObjectToArray()
- GlobalFunctions.php ➔ wfRandom()
- GlobalFunctions.php ➔ wfRandomString()
- GlobalFunctions.php ➔ wfUrlencode()
- GlobalFunctions.php ➔ wfArrayToCgi()
- GlobalFunctions.php ➔ wfCgiToArray()
- GlobalFunctions.php ➔ wfAppendQuery()
- GlobalFunctions.php ➔ wfExpandUrl()
- GlobalFunctions.php ➔ wfAssembleUrl()
- GlobalFunctions.php ➔ wfRemoveDotSegments()
- GlobalFunctions.php ➔ wfUrlProtocols()
- GlobalFunctions.php ➔ wfUrlProtocolsWithoutProtRel()
- GlobalFunctions.php ➔ wfParseUrl()
- GlobalFunctions.php ➔ wfExpandIRI()
- GlobalFunctions.php ➔ wfExpandIRI_callback()
- GlobalFunctions.php ➔ wfMakeUrlIndexes()
- GlobalFunctions.php ➔ wfMatchesDomainList()
- GlobalFunctions.php ➔ wfDebug()
- GlobalFunctions.php ➔ wfIsDebugRawPage()
- GlobalFunctions.php ➔ wfDebugMem()
- GlobalFunctions.php ➔ wfDebugLog()
- GlobalFunctions.php ➔ wfLogDBError()
- GlobalFunctions.php ➔ wfDeprecated()
- GlobalFunctions.php ➔ wfWarn()
- GlobalFunctions.php ➔ wfLogWarning()
- GlobalFunctions.php ➔ wfErrorLog()
- GlobalFunctions.php ➔ wfLogProfilingData()
- GlobalFunctions.php ➔ wfIncrStats()
- GlobalFunctions.php ➔ wfReadOnly()
- GlobalFunctions.php ➔ wfReadOnlyReason()
- GlobalFunctions.php ➔ wfConfiguredReadOnlyReason()
- GlobalFunctions.php ➔ wfGetLangObj()
- GlobalFunctions.php ➔ wfMessage()
- GlobalFunctions.php ➔ wfMessageFallback()
- GlobalFunctions.php ➔ wfMsgReplaceArgs()
- GlobalFunctions.php ➔ wfHostname()
- GlobalFunctions.php ➔ wfReportTime()
- GlobalFunctions.php ➔ wfDebugBacktrace()
- GlobalFunctions.php ➔ wfBacktrace()
- GlobalFunctions.php ➔ wfGetCaller()
- GlobalFunctions.php ➔ wfGetAllCallers()
- GlobalFunctions.php ➔ wfFormatStackFrame()
- GlobalFunctions.php ➔ wfShowingResults()
- GlobalFunctions.php ➔ wfClientAcceptsGzip()
- GlobalFunctions.php ➔ hash_equals()
- GlobalFunctions.php ➔ wfEscapeWikiText()
- GlobalFunctions.php ➔ wfSetVar()
- GlobalFunctions.php ➔ wfSetBit()
- GlobalFunctions.php ➔ wfVarDump()
- GlobalFunctions.php ➔ wfHttpError()
- GlobalFunctions.php ➔ wfResetOutputBuffers()
- GlobalFunctions.php ➔ wfClearOutputBuffers()
- GlobalFunctions.php ➔ wfAcceptToPrefs()
- GlobalFunctions.php ➔ mimeTypeMatch()
- GlobalFunctions.php ➔ wfNegotiateType()
- GlobalFunctions.php ➔ wfSuppressWarnings()
- GlobalFunctions.php ➔ wfRestoreWarnings()
- GlobalFunctions.php ➔ wfTimestamp()
- GlobalFunctions.php ➔ wfTimestampOrNull()
- GlobalFunctions.php ➔ wfTimestampNow()
- GlobalFunctions.php ➔ wfIsWindows()
- GlobalFunctions.php ➔ wfIsHHVM()
- GlobalFunctions.php ➔ wfTempDir()
- GlobalFunctions.php ➔ wfMkdirParents()
- GlobalFunctions.php ➔ wfRecursiveRemoveDir()
- GlobalFunctions.php ➔ wfPercent()
- GlobalFunctions.php ➔ wfIniGetBool()
- GlobalFunctions.php ➔ wfEscapeShellArg()
- GlobalFunctions.php ➔ wfShellExecDisabled()
- GlobalFunctions.php ➔ wfShellExec()
- GlobalFunctions.php ➔ wfShellExecWithStderr()
- GlobalFunctions.php ➔ wfInitShellLocale()
- GlobalFunctions.php ➔ wfShellWikiCmd()
- GlobalFunctions.php ➔ wfMerge()
- GlobalFunctions.php ➔ wfDiff()
- GlobalFunctions.php ➔ wfUsePHP()
- GlobalFunctions.php ➔ wfUseMW()
- GlobalFunctions.php ➔ wfBaseName()
- GlobalFunctions.php ➔ wfRelativePath()
- GlobalFunctions.php ➔ wfBaseConvert()
- GlobalFunctions.php ➔ wfFixSessionID()
- GlobalFunctions.php ➔ wfResetSessionID()
- GlobalFunctions.php ➔ wfSetupSession()
- GlobalFunctions.php ➔ wfGetPrecompiledData()
- GlobalFunctions.php ➔ wfMemcKey()
- GlobalFunctions.php ➔ wfForeignMemcKey()
- GlobalFunctions.php ➔ wfGlobalCacheKey()
- GlobalFunctions.php ➔ wfWikiID()
- GlobalFunctions.php ➔ wfSplitWikiID()
- GlobalFunctions.php ➔ wfGetDB()
- GlobalFunctions.php ➔ wfGetLB()
- GlobalFunctions.php ➔ wfGetLBFactory()
- GlobalFunctions.php ➔ wfFindFile()
- GlobalFunctions.php ➔ wfLocalFile()
- GlobalFunctions.php ➔ wfQueriesMustScale()
- GlobalFunctions.php ➔ wfScript()
- GlobalFunctions.php ➔ wfGetScriptUrl()
- GlobalFunctions.php ➔ wfBoolToStr()
- GlobalFunctions.php ➔ wfGetNull()
- GlobalFunctions.php ➔ wfWaitForSlaves()
- GlobalFunctions.php ➔ wfCountDown()
- GlobalFunctions.php ➔ wfStripIllegalFilenameChars()
- GlobalFunctions.php ➔ wfMemoryLimit()
- GlobalFunctions.php ➔ wfTransactionalTimeLimit()
- GlobalFunctions.php ➔ wfShorthandToInteger()
- GlobalFunctions.php ➔ wfBCP47()
- GlobalFunctions.php ➔ wfGetCache()
- GlobalFunctions.php ➔ wfGetMainCache()
- GlobalFunctions.php ➔ wfGetMessageCacheStorage()
- GlobalFunctions.php ➔ wfGetParserCacheStorage()
- GlobalFunctions.php ➔ wfRunHooks()
- GlobalFunctions.php ➔ wfUnpack()
- GlobalFunctions.php ➔ wfIsBadImage()
- GlobalFunctions.php ➔ wfCanIPUseHTTPS()
- GlobalFunctions.php ➔ wfIsInfinity()
- GlobalFunctions.php ➔ wfThumbIsStandard()
- GlobalFunctions.php ➔ wfArrayPlus2d()
Let’s take a look at an example:
In the above example, the authenticate() method works fine as long as you just pass instances of MyUser. However, if you now also want to pass a different sub-classes of User which does not have a getDisplayName() method, the code will break.
Available Fixes
Change the type-hint for the parameter:
Add an additional type-check:
Add the method to the parent class: