<?xml version="1.0"?>
<ruleset name="Pantheon WP Coding Standards">
	<description>Pantheon WordPress Coding Standards.</description>

	<!-- What to scan -->
	<file>.</file>
	<exclude-pattern>/vendor/</exclude-pattern>
	<exclude-pattern>/assets/</exclude-pattern>

	<arg value="sp"/> <!-- Show sniff and progress -->
	<arg name="basepath" value="./"/><!-- Strip the file paths down to the relevant bit -->
	<arg name="colors"/>
	<arg name="extensions" value="php"/>
	<arg name="parallel" value="8"/><!-- Enables parallel processing when available for faster results. -->

	<!-- Rules: Check PHP version compatibility -->
	<config name="testVersion" value="7.4-"/>
	<!-- https://github.com/PHPCompatibility/PHPCompatibilityWP -->
	<rule ref="PHPCompatibilityWP"/>

	<!-- Rules: Pantheon WP WordPress Coding Standards -->
	<config name="minimum_supported_wp_version" value="4.6"/>
	<rule ref="Pantheon-WP">
		<exclude name="WordPress.DB.DirectDatabaseQuery.DirectQuery">
			<exclude-pattern>*/*</exclude-pattern>
		</exclude>
		<exclude name="WordPress.DB.DirectDatabaseQuery.NoCaching">
			<exclude-pattern>inc/network/includes-network.php</exclude-pattern>
		</exclude>
		<exclude name="WordPress.Security.NonceVerification.Missing">
			<exclude-pattern>inc/network/includes-network.php</exclude-pattern>
		</exclude>
		<exclude name="WordPress.Security.NonceVerification.Recommended">
			<exclude-pattern>inc/pantheon-page-cache.php</exclude-pattern>
		</exclude>
		<exclude name="WordPress.Security.ValidatedSanitizedInput.InputNotValidated">
			<exclude-pattern>inc/network/includes-network.php</exclude-pattern>
		</exclude>
		<exclude name="WordPress.Security.ValidatedSanitizedInput.InputNotSanitized">
			<exclude-pattern>inc/network/includes-network.php</exclude-pattern>
		</exclude>
		<exclude name="WordPressVIPMinimum.Files.IncludingFile.NotAbsolutePath">
			<exclude-pattern>pantheon.php</exclude-pattern>
		</exclude>
		<exclude name="WordPress.Files.FileName.InvalidClassFileName">
			<exclude-pattern>*/*</exclude-pattern>
		</exclude>
		<exclude name="WordPressVIPMinimum.Performance.FetchingRemoteData.FileGetContentsUnknown">
			<exclude-pattern>*/*</exclude-pattern>
		</exclude>
		<exclude name="WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid">
			<exclude-pattern>inc/pantheon-page-cache.php</exclude-pattern>
		</exclude>
		<exclude name="Universal.Files.SeparateFunctionsFromOO.Mixed">
			<exclude-pattern>inc/pantheon-page-cache.php</exclude-pattern>
		</exclude>

		<!-- Ignore missing doc comments in pantheon-page-cache.php for now. -->
		<exclude name="Squiz.Commenting.FunctionComment.Missing">
			<exclude-pattern>inc/pantheon-page-cache.php</exclude-pattern>
		</exclude>
		<exclude name="Squiz.Commenting.FunctionComment.MissingParamComment">
			<exclude-pattern>inc/pantheon-page-cache.php</exclude-pattern>
		</exclude>
		<exclude name="Squiz.Commenting.FunctionComment.MissingParamTag">
			<exclude-pattern>inc/pantheon-page-cache.php</exclude-pattern>
		</exclude>
		<exclude name="Generic.Commenting.DocComment.MissingShort">
			<exclude-pattern>inc/pantheon-page-cache.php</exclude-pattern>
		</exclude>
	</rule>
</ruleset>
