<?xml version="1.0"?>
<ruleset>
	<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
		<exclude name="Generic.Files.OneObjectStructurePerFile.MultipleFound" />
		<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate" />
		<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected"/>
		<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
		<exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" />
		<exclude name="MediaWiki.Commenting.PropertyDocumentation.WrongStyle" />
		<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
	</rule>
	<rule ref="Generic.Files.LineLength">
		<exclude-pattern>Translate\.alias\.php</exclude-pattern>
		<exclude-pattern>Translate\.i18n\.magic\.php</exclude-pattern>
		<exclude-pattern>*/tests/phpunit/data/Example*\.php</exclude-pattern>
	</rule>
	<rule ref="MediaWiki.NamingConventions.ValidGlobalName">
		<properties>
			<property name="ignoreList" type="array" value="$IP" />
		</properties>
	</rule>
	<rule ref="MediaWiki.Files.ClassMatchesFilename.NotMatch">
		<exclude-pattern>tests/|scripts/</exclude-pattern>
	</rule>
	<file>.</file>
	<arg name="extensions" value="php"/>
	<arg name="encoding" value="UTF-8"/>

	<!-- See https://github.com/slevomat/coding-standard#sniffs-included-in-this-standard -->
	<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator" />
	<rule ref="SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn" />
	<rule ref="SlevomatCodingStandard.ControlStructures.UselessTernaryOperator" />
	<rule ref="SlevomatCodingStandard.Classes.PropertySpacing">
		<properties>
			<property name="minLinesCountBeforeWithComment" value="0"/>
			<property name="maxLinesCountBeforeWithComment" value="0"/>
			<property name="minLinesCountBeforeWithoutComment" value="0"/>
			<property name="maxLinesCountBeforeWithoutComment" value="0"/>
		</properties>
	</rule>
	<rule ref="SlevomatCodingStandard.Commenting.RequireOneLineDocComment" />
	<rule ref="SlevomatCodingStandard.Commenting.RequireOneLinePropertyDocComment" />
	<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing" />
	<rule ref="SlevomatCodingStandard.Whitespaces.DuplicateSpaces" />
</ruleset>
