antiseptikk/dev-kit

Battle-tested dev-kit.

v3.0.0 2022-07-19 14:46 UTC

This package is auto-updated.

Last update: 2024-11-19 19:39:41 UTC


README

PHP dev-kit

Quality Assurance Packagist Downloads GitHub release (latest SemVer)

Installation

  1. Install this package:

    $ composer require --dev antiseptikk/dev-kit
  2. Create a file named ecs.php in the root directory of your project.

    <?php
    
    declare(strict_types=1);
    
    use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
    use Symplify\EasyCodingStandard\ValueObject\Option;
    
    return static function (ContainerConfigurator $containerConfigurator): void
    {
        $containerConfigurator->import(__DIR__.'/vendor/antiseptikk/dev-kit/ecs.php');
    
        $parameters = $containerConfigurator->parameters();
        $parameters->set(Option::LINE_ENDING, "\n");
    };
  3. [v2] Creates a file named psalm.xml in the root directory of your project.

    <?xml version="1.0"?>
    <psalm
       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="src" />
            <ignoreFiles>
                <directory name="vendor" />
            </ignoreFiles>
        </projectFiles>
    </psalm>

Usage

** [v2] Static Analysis**

  • Psalm

    vendor/bin/psalm
  • PHPStan

    vendor/bin/phpstan analyse src

    By default, PHPStan runs only the most basic checks. Head to Rule Levels to learn how to turn on stricter checks.

Coding Standard

vendor/bin/ecs check src