<?xml version="1.0"?>
<ruleset name="Enhanced Admin User Search">

	<config name="testVersion" value="7.4-"/>
	<arg name="extensions" value="php"/>

	<!--
	Prevent deprecated errors caused by WordPress Coding Standards not supporting PHP 8.0+.
	See https://github.com/WordPress/WordPress-Coding-Standards/issues/2035
	-->
	<ini name="error_reporting" value="E_ALL &#38; ~E_DEPRECATED" />

	<exclude-pattern>/build/*</exclude-pattern>
	<exclude-pattern>/node_modules/*</exclude-pattern>
	<exclude-pattern>/tests/*</exclude-pattern>
	<exclude-pattern>/vendor/*</exclude-pattern>

	<rule ref="WordPress-Extra">

		<exclude name="WordPress.Files.FileName" />

		<!-- Exclude short description sniff so short `@var` notation can be used -->
		<exclude name="Generic.Commenting.DocComment.MissingShort"/>

		<!-- QM is a debugging plugin, so silence warnings about usage of development functionality -->
		<exclude name="WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace" />
		<exclude name="WordPress.PHP.DevelopmentFunctions.error_log_trigger_error" />
		<exclude name="WordPress.PHP.DevelopmentFunctions.error_log_set_error_handler" />
		<exclude name="WordPress.PHP.DevelopmentFunctions.error_log_print_r" />
		<exclude name="WordPress.PHP.DevelopmentFunctions.prevent_path_disclosure_error_reporting" />
		<exclude name="WordPress.PHP.DiscouragedPHPFunctions.runtime_configuration_error_reporting" />
		<exclude name="WordPress.PHP.DiscouragedPHPFunctions.runtime_configuration_ini_set" />
		<exclude name="WordPress.PHP.IniSet.display_errors_Blacklisted" />
		<exclude name="WordPress.DB.RestrictedFunctions" />

		<!-- @TODO remove this exclusion: -->
		<exclude name="Squiz.Commenting" />

		<!-- Not interested in whitespace issues at the moment -->
		<exclude name="PEAR.Functions.FunctionCallSignature" />
		<exclude name="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma" />
		<exclude name="Generic.WhiteSpace.ScopeIndent.Incorrect" />
		<exclude name="Generic.WhiteSpace.ScopeIndent.IncorrectExact" />
		<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning" />
		<exclude name="Generic.Formatting.MultipleStatementAlignment.IncorrectWarning" />
		<exclude name="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned" />

		<!-- We have the means -->
		<exclude name="WordPress.PHP.YodaConditions.NotYoda" />
		<exclude name="WordPress.PHP.DisallowShortTernary.Found" />

		<!-- QM looks at several superglobals -->
		<exclude name="WordPress.Security.NonceVerification.Missing" />
	</rule>

	<rule ref="WordPress-Docs" />

	<!-- Custom rule properties -->
	<rule ref="WordPress.WP.I18n">
		<properties>
			<property name="text_domain" type="array" value="enhanced-admin-user-search" />
		</properties>
	</rule>

	<rule ref="WordPress.WP.DeprecatedFunctions">
		<properties>
			<property name="minimum_supported_version" value="5.9" />
		</properties>
	</rule>

	<rule ref="WordPress.NamingConventions.ValidHookName">
		<properties>
			<property name="additionalWordDelimiters" value="-/"/>
		</properties>
	</rule>

	<rule ref="PHPCompatibilityWP"/>

    <!-- Paths to scan -->
    <!-- <file>./admin/</file> -->
    <file>./class-admin-user-search.php</file>
</ruleset>