alphpaca / coding-standard
This package is abandoned and no longer maintained.
No replacement package was suggested.
Set of rules to make sticking to the coding standard easier
v1.0.0
2022-08-10 21:03 UTC
Requires
- php: ^8.0
- friendsofphp/php-cs-fixer: ^3.9
- phpstan/extension-installer: ^1.1
- phpstan/phpstan: ^1.8
- phpstan/phpstan-doctrine: ^1.3
- phpstan/phpstan-phpunit: ^1.1
- phpstan/phpstan-strict-rules: ^1.3
- phpstan/phpstan-symfony: ^1.2
- phpstan/phpstan-webmozart-assert: ^1.2
- psalm/plugin-phpunit: ^0.17.0
- psalm/plugin-symfony: ^3.1
- rector/rector: ^0.13.10
- symplify/easy-coding-standard: ^11.1
- vimeo/psalm: ^4.26
- weirdan/doctrine-psalm-plugin: ^2.3
README
🔧 Installation
-
Run
composer require alphpaca/coding-standard --dev vendor/bin/ecs init vendor/bin/rector init vendor/bin/psalm --init touch phpstan.neon
-
Replace the content of the
ecs.php
file<?php declare(strict_types=1); use Symplify\EasyCodingStandard\Config\ECSConfig; return static function (ECSConfig $ecsConfig): void { $ecsConfig->import('vendor/alphpaca/coding-standard/ecs.php'); $ecsConfig->paths([__DIR__ . '/src', __DIR__ . '/tests']); };
-
Replace the content of the
rector.php
file<?php declare(strict_types=1); use Rector\Config\RectorConfig; return static function (RectorConfig $rectorConfig): void { $rectorConfig->import('vendor/alphpaca/coding-standard/rector.php'); $rectorConfig->paths([ __DIR__ . '/src', __DIR__ . '/tests', ]); }
-
Create the
phpstan.neon
file with the following configurationparameters: level: 9 excludes_analyse: - 'tests/Application/**/*.php'
-
Replace the content of the
psalm.xml
file<?xml version="1.0"?> <psalm errorLevel="1" 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" xmlns:xi="http://www.w3.org/2001/XInclude" > <xi:include href="vendor/alphpaca/coding-standard/psalm_files.xml"/> <xi:include href="vendor/alphpaca/coding-standard/psalm_file_extensions.xml"/> <xi:include href="vendor/alphpaca/coding-standard/psalm_plugins.xml"/> </psalm>
-
(Optional) To run a static analysis process before each commit run
cp vendor/alphpaca/coding-standard/bin/pre-commit.dist .git/hooks/pre-commit