<?xml version="1.0"?>
<ruleset name="googleAnalyticsImporter" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">

    <description>Matomo Coding Standard for GoogleAnalyticsImporter plugin</description>

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

    <file>.</file>

    <exclude-pattern>tests/javascript/*</exclude-pattern>
    <exclude-pattern>*/vendor/*</exclude-pattern>
    <!-- Do nothing for GA3 code, as that code is not applicable anymore -->
    <exclude-pattern>Commands/GenerateGaTestData.php</exclude-pattern>
    <exclude-pattern>Commands/ImportReports.php</exclude-pattern>
    <exclude-pattern>Importers/Referrers/RecordImporter.php</exclude-pattern>
    <exclude-pattern>Importers/MarketingCampaignsReporting/RecordImporter.php</exclude-pattern>
    <exclude-pattern>Importers/Resolution/RecordImporter.php</exclude-pattern>
    <exclude-pattern>Importers/Events/RecordImporter.php</exclude-pattern>
    <exclude-pattern>Importers/CustomDimensions/RecordImporter.php</exclude-pattern>
    <exclude-pattern>Importers/UserLanguage/RecordImporter.php</exclude-pattern>
    <exclude-pattern>Importers/Actions/RecordImporter.php</exclude-pattern>
    <exclude-pattern>Importers/DevicesDetection/RecordImporter.php</exclude-pattern>
    <exclude-pattern>Importers/UserCountry/RecordImporter.php</exclude-pattern>
    <exclude-pattern>Importers/VisitFrequency/RecordImporter.php</exclude-pattern>
    <exclude-pattern>Importers/Goals/RecordImporter.php</exclude-pattern>
    <exclude-pattern>Importers/CustomVariables/RecordImporter.php</exclude-pattern>
    <exclude-pattern>Importers/VisitorInterest/RecordImporter.php</exclude-pattern>
    <exclude-pattern>Importers/VisitsSummary/RecordImporter.php</exclude-pattern>
    <exclude-pattern>Importer.php</exclude-pattern>
    <exclude-pattern>test.php</exclude-pattern>
    <exclude-pattern>RecordImporter.php</exclude-pattern>
    <exclude-pattern>Google/GoogleMetricMapper.php</exclude-pattern>
    <exclude-pattern>Google/GoogleCustomDimensionMapper.php</exclude-pattern>
    <exclude-pattern>Google/GoogleGoalMapper.php</exclude-pattern>
    <exclude-pattern>Google/GoogleAnalyticsQueryService.php</exclude-pattern>
    <exclude-pattern>Google/GoogleResponseDataTableFactory.php</exclude-pattern>

    <rule ref="Matomo"></rule>

    <rule ref="Generic.Files.LineLength">
        <properties>
            <property name="lineLimit" value="250" />
        </properties>
        <exclude-pattern>tests/*</exclude-pattern>
    </rule>

    <rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
        <!-- Classnames for our update files don't match PascalCase, this can't be changed easily -->
        <exclude-pattern>Updates/*</exclude-pattern>
    </rule>

    <rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
        <!-- Allow using method name without camel caps in tests as long as some methods are named test_* -->
        <exclude-pattern>tests/*</exclude-pattern>
    </rule>

    <rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
        <!-- Allow using multiple classes in one file for tests -->
        <exclude-pattern>tests/*</exclude-pattern>
        <exclude-pattern>Monolog/Handler/GASystemLogHandler.php</exclude-pattern>
    </rule>
</ruleset>