Documentation


Sample configuration file

This article shows a real example of a SymfonyInsight configuration file. Check out the configuration reference to learn more about all config options.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# NOTE: you don't need to include all these options in your own configuration
# files. Only include the options that make sense in your project.

# Configure the PHP version SymfonyInsight should use to analyze
# your project. It can be defined to 7.2, 7.3, 7.4, 8.0, 8.1, 8.2 or 8.3.
# If not present, it will prefer the latest PHP version.
php_version: 8.3

# Configure which PHP extensions your project need to be analyzed.
php_ini: |
    extension=openssl.so
    extension=mcrypt.so

# Ignore some branches to avoid triggering analysis for these
ignore_branches:
    - gh-pages

# Configure the failure conditions for your commit status.
# If at least one of these conditions is verified, the commit status is displayed as failed.
commit_failure_conditions:
    - "pr.severity.critical > 0"
    - "pr.severity.major > 0"

# Configure rules.
rules:
    # Disable a rule
    php.duplicated_code:
        enabled: false

    # Configure a rule
    php.class_too_long:
        max_length: 2000
        threshold:  10

# Configure in which directory your code is located.
# This can be set to any subdirectory of your project.
working_directory: myapp

# This section will be executed before installing dependencies.
# You should configure here what is needed for Composer to run without
# issue: install libraries, prepare the database, etc.
pre_composer_script: |
    #!/bin/bash
    sudo apt-get update