zadorin/bitrix-psalm-plugin

Psalm plugin for Bitrix Framework

v0.0.2 2022-02-03 08:56 UTC

This package is auto-updated.

Last update: 2024-11-29 06:35:42 UTC


README

Very first prototype

Install

composer require zadorin/bitrix-psalm-plugin --dev
./vendor/bin/psalm-plugin enable zadorin/bitrix-psalm-plugin

Configure

Options psalm.autoloader and bitrixDir are important.

<!-- <project-dir>/bitrix/psalm.xml -->
<?xml version="1.0"?>
<psalm
    autoloader="vendor/zadorin/bitrix-psalm-plugin/autoload.php"
    errorLevel="1"
    resolveFromConfigFile="true"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="https://getpsalm.org/schema/config"
    xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
    <projectFiles>
        <directory name="modules/crm/lib" />
    </projectFiles>
    
    <issueHandlers>
        <InvalidGlobal errorLevel="suppress" />
    </issueHandlers>

    <plugins>
        <pluginClass class="\Zadorin\BitrixPsalmPlugin\Plugin">
            <bitrixDir>.</bitrixDir>
            <includeModules>
                <module name="crm" />
                <module name="sale" />
            </includeModules>
            <ignoreModules>
                <module name="currency" />
            </ignoreModules>
        </pluginClass>
    </plugins>

</psalm>

Execute

./vendor/bin/psalm --memory-limit=4G