<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         name="Better Admin Bar Coding Standards"
         xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">

	<description>The coding standard for the Better Admin Bar plugin.</description>

	<!-- Scan only this plugin folder -->
	<file>.</file>

	<!-- Only check PHP files -->
	<arg name="extensions" value="php"/>

	<!-- Show progress and error sources -->
	<arg value="ps"/>

	<!-- Strip base path to local folder -->
	<arg name="basepath" value="."/>

	<!-- Parallel processing -->
	<arg name="parallel" value="50"/>

	<!-- ========================================================================= -->
	<!-- RULESETS                                                                 -->
	<!-- ========================================================================= -->

	<rule ref="WordPress">
		<exclude name="WordPress.Files.FileName"/>
		<exclude name="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid"/>
		<exclude name="WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents"/>
		<exclude name="WordPress.WhiteSpace.ControlStructureSpacing.BlankLineAfterEnd"/>
	</rule>

	<rule ref="WordPress-Extra">
		<exclude name="Universal.Operators.DisallowShortTernary.Found"/>
		<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found"/>
		<exclude name="Universal.CodeAnalysis.NoEchoSprintf.Found"/>

		<exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket"/>
		<exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine"/>
		<exclude name="PEAR.Functions.FunctionCallSignature.MultipleArguments"/>

		<exclude name="PSR2.Classes.ClassDeclaration.CloseBraceAfterBody"/>
		<exclude name="PSR2.Methods.FunctionClosingBrace.SpacingBeforeClose"/>

		<exclude name="Squiz.Commenting.FileComment.Missing"/>
		<exclude name="Squiz.Commenting.ClassComment.Missing"/>
	</rule>

	<rule ref="WordPress.Arrays.MultipleStatementAlignment">
		<properties>
			<property name="alignMultilineItems" value="!=100"/>
			<property name="exact" value="false" phpcs-only="true"/>
		</properties>
	</rule>

</ruleset>
