<?xml version="1.0"?>
<ruleset name="OpenLab">
	<description>A custom set of rules for OpenLab PHP files.</description>

	<!-- Exclude the Composer Vendor directory. -->
	<exclude-pattern>/vendor/*</exclude-pattern>

	<!-- Exclude any Node Modules directory. -->
	<exclude-pattern>/node_modules/*</exclude-pattern>

	<!-- Exclude JS files -->
	<exclude-pattern>*.js</exclude-pattern>

	<!-- Exclude minified and built files. -->
	<exclude-pattern>*.min.js</exclude-pattern>
	<exclude-pattern>*.min.css</exclude-pattern>
	<exclude-pattern>/js/dist/vendor.js</exclude-pattern>
	<exclude-pattern>/style.css</exclude-pattern>
	<exclude-pattern>/css/color-schemes/*</exclude-pattern>

	<!-- Exclude libraries -->
	<exclude-pattern>/js/jcarousellite.js</exclude-pattern>
	<exclude-pattern>/js/jquery.easing*</exclude-pattern>
	<exclude-pattern>/js/detect-zoom.js</exclude-pattern>
	<exclude-pattern>/js/less-*.js</exclude-pattern>
	<exclude-pattern>/js/jQuery.succinct.mod.js</exclude-pattern>
	<exclude-pattern>/js/easyaccordion.js</exclude-pattern>
	<exclude-pattern>/js/camera.*</exclude-pattern>
	<exclude-pattern>/css/camera.css</exclude-pattern>
	<exclude-pattern>/css/select2/*</exclude-pattern>

	<!-- Iterate over all PHP files by default -->
	<file>.</file>

	<rule ref="PHPCompatibilityWP">
		 <config name="testVersion" value="4.9.2-"/>
	</rule>

	<!-- Check for PHP cross-version compatibility. -->
	<config name="testVersion" value="5.6-"/>

	<rule ref="WordPress-Core">
		<exclude name="Universal.Arrays.DisallowShortArraySyntax"/>
	</rule>

	<!-- Include the WordPress-Extra standard. -->
	<rule ref="WordPress-Extra">
		<exclude name="WordPress.NamingConventions.PrefixAllGlobals"/>
		<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
		<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>

		<exclude name="PSR2.ControlStructures.SwitchDeclaration.SpaceBeforeColonCASE"/>
		<exclude name="PSR2.ControlStructures.SwitchDeclaration.SpaceBeforeColonDEFAULT"/>
	</rule>

	<!-- Add in some extra rules from other standards. -->
	<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>

	<rule ref="WordPress.WP.Capabilities">
		<properties>
			<property name="custom_capabilities[]" value="assign_topic_tags,bp_docs_associate_with_group,bp_docs_create,bp_docs_edit,bp_docs_manage,bp_moderate,edit_topic,grant_badges,moderate,view_private_members_of_group" />
		</properties>
	</rule>
</ruleset>
