<?xml version="1.0"?>
<ruleset name="SomewhereWarm-cs">
	<description>SomewhereWarm Coding Standards</description>

	<arg name="extensions" value="php"/>
	<file>./</file>

	<!-- Exclude paths -->
	<exclude-pattern type="relative">node_modules/*</exclude-pattern>
	<exclude-pattern type="relative">vendor/*</exclude-pattern>
	<exclude-pattern type="relative">assets/*</exclude-pattern>
	<exclude-pattern type="relative">tests/_support/docker/*</exclude-pattern>

	<!-- Show progress, show the error codes for each message (source). -->
	<arg value="ps" />

	<!-- Check up to 8 files simultaneously. -->
	<arg name="parallel" value="8" />

	<!-- Configs -->
	<config name="minimum_supported_wp_version" value="6.2" />
	<config name="testVersion" value="7.4-" />

	<!-- Rules -->
	<rule ref="WooCommerce-Core">
		<!-- Duplicate of Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure -->
		<exclude name="Generic.CodeAnalysis.AssignmentInCondition.Found" />
	</rule>

	<rule ref="WordPress.WP.I18n">
		<properties>
			<property name="text_domain" type="array" value="woocommerce,woocommerce-subscriptions,woocommerce-gift-cards" />
		</properties>
	</rule>

	<rule ref="WordPress.WP.Capabilities">
		<properties>
			<property name="custom_capabilities" type="array">
				<element key="0" value="download_file"/>
				<element key="1" value="read_product"/>
				<element key="2" value="edit_products"/>
				<element key="3" value="edit_private_products"/>
				<element key="4" value="edit_others_products"/>
				<element key="5" value="edit_product"/>
				<element key="6" value="publish_shop_orders"/>
				<element key="7" value="edit_shop_orders"/>
				<element key="8" value="edit_others_shop_orders"/>
				<element key="9" value="view_order"/>
				<element key="10" value="pay_for_order"/>
				<element key="11" value="order_again"/>
				<element key="12" value="cancel_order"/>
				<element key="13" value="read_private_shop_orders"/>
				<element key="14" value="customer"/>
				<element key="15" value="manage_woocommerce"/>
				<element key="16" value="manage_product_terms"/>
				<element key="17" value="view_woocommerce_reports"/>
			</property>
		</properties>
	</rule>

	<!-- Exclude specific files from specific the class/file name rule -->
	<rule ref="WordPress.Files.FileName.InvalidClassFileName">
		<exclude-pattern>woocommerce-gift-cards.php</exclude-pattern>
	</rule>

	<!-- This is a standard that breaks the standard, keeping as is. -->
	<rule ref="WordPress.Files.FileName">
		<exclude-pattern>tests/*</exclude-pattern>
	</rule>

	<rule ref="PHPCompatibility" />
</ruleset>
