* @file
* @ingroup Site
*
- * @license GNU GPL v2+
+ * @license GPL-2.0-or-later
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
class Site implements Serializable {
*/
public function getLinkPath() {
$type = $this->getLinkPathType();
- return $type === null ? null: $this->getPath( $type );
+ return $type === null ? null : $this->getPath( $type );
}
/**
}
/**
- * Returns $pageName without changes.
- * Subclasses may override this to apply some kind of normalization.
+ * Attempt to normalize the page name in some fashion.
+ * May return false to indicate various kinds of failure.
+ *
+ * This implementation returns $pageName without changes.
*
* @see Site::normalizePageName
*
*
* @param string $pageName
*
- * @return string
+ * @return string|false
*/
public function normalizePageName( $pageName ) {
return $pageName;
*
* @since 1.21
*
- * @param string $languageCode
+ * @param string|null $languageCode
*/
public function setLanguageCode( $languageCode ) {
- if ( !Language::isValidCode( $languageCode ) ) {
+ if ( $languageCode !== null && !Language::isValidCode( $languageCode ) ) {
throw new InvalidArgumentException( "$languageCode is not a valid language code." );
}
$this->languageCode = $languageCode;