-
Install this package:
$ composer require --dev antiseptikk/dev-kit
-
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"); };
-
[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>
** [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