<?xml version="1.0"?>
<ruleset
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd"
>
	<arg name="basepath" value="."/>
	<arg name="extensions" value="php"/>
	<arg name="parallel" value="80"/>
	<arg name="cache" value=".phpcs-cache"/>
	<arg name="colors"/>

	<!-- Ignore warnings, show progress of the run and show sniff names -->
	<arg value="nps"/>

    <config name="php_version" value="80100"/>

    <!-- Directories to be checked -->
	<file>src</file>
	<file>tests</file>

	<!-- Run against the PHPCompatibility ruleset -->
	<!--<rule ref="PHPCompatibility"/>-->

	<!-- Include PSR12 rules -->
	<rule ref="PSR12">
		<exclude name="Generic.WhiteSpace.DisallowTabIndent"/>
		<exclude name="PSR2.Methods.MethodDeclaration.Underscore"/>
		<exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose"/>
	</rule>

	<!-- tab spacing -->
	<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
	<rule ref="Generic.WhiteSpace.ScopeIndent">
		<properties>
			<property name="indent" value="4"/>
			<property name="tabIndent" value="false"/>
		</properties>
	</rule>

	<!-- slevomat Functional -->
	<rule ref="SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation"/>
	<rule ref="SlevomatCodingStandard.ControlStructures.DisallowContinueWithoutIntegerOperandInSwitch"/>
	<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator"/>
	<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator"/>
	<rule ref="SlevomatCodingStandard.Functions.StaticClosure"/>
	<rule ref="SlevomatCodingStandard.PHP.DisallowDirectMagicInvokeCall"/>
	<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
		<properties>
			<property name="searchAnnotations" value="true"/>
		</properties>
	</rule>
	<rule ref="SlevomatCodingStandard.Namespaces.UselessAlias"/>

	<!-- slevomat formatting-->
	<rule ref="SlevomatCodingStandard.Arrays.MultiLineArrayEndBracketPlacement"/>
	<rule ref="SlevomatCodingStandard.Arrays.SingleLineArrayWhitespace"/>
	<rule ref="SlevomatCodingStandard.Classes.ClassMemberSpacing"/>
	<rule ref="SlevomatCodingStandard.Classes.TraitUseDeclaration"/>
	<rule ref="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison"/>
	<rule ref="SlevomatCodingStandard.Namespaces.NamespaceDeclaration"/>
	<rule ref="SlevomatCodingStandard.Namespaces.NamespaceSpacing"/>
	<rule ref="SlevomatCodingStandard.Namespaces.DisallowGroupUse"/>
	<rule ref="SlevomatCodingStandard.Namespaces.MultipleUsesPerLine"/>

	<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing">
		<properties>
			<property name="linesCountBetweenUseTypes" value="1"/>
		</properties>
	</rule>
	<rule ref="SlevomatCodingStandard.PHP.ShortList"/>
	<rule ref="SlevomatCodingStandard.PHP.TypeCast"/>
	<rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility"/>
	<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing"/>
	<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/>
	<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly"/>
	<rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash"/>
	<rule ref="SlevomatCodingStandard.Commenting.UselessInheritDocComment"/>
	<rule ref="SlevomatCodingStandard.Classes.PropertySpacing">
		<properties>
			<property name="minLinesCountBeforeWithComment" value="1"/>
			<property name="maxLinesCountBeforeWithComment" value="1"/>
			<property name="minLinesCountBeforeWithoutComment" value="0"/>
			<property name="maxLinesCountBeforeWithoutComment" value="1"/>
		</properties>
	</rule>
	<rule ref="SlevomatCodingStandard.Classes.MethodSpacing">
		<properties>
			<property name="minLinesCount" value="1"/>
			<property name="maxLinesCount" value="1"/>
		</properties>
	</rule>


	<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
		<properties>
			<property name="spacesCountAroundEqualsSign" type="int" value="0"/>
		</properties>
	</rule>
	<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators"/>
	<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
		<properties>
			<property name="rootNamespaces" type="array">
				<element key="src" value="Scienta\DoctrineJsonFunctions"/>
				<element key="tests" value="Scienta\DoctrineJsonFunctions\Tests"/>
			</property>
		</properties>
	</rule>
</ruleset>
