serendipity_hq/ansi-converter-shq-theme

此包已被废弃,不再维护。未建议替代包。

用于与AnsiConverter一起使用的主题。

1.0.2 2022-01-24 18:01 UTC

This package is auto-updated.

Last update: 2024-09-20 09:27:45 UTC


README

Serendipity HQ Ansi Converter Theme

用于与AnsiConverter一起使用的主题。

当前状态

Phan PHPStan PSalm PHPUnit Composer PHP CS Fixer Rector

你喜欢这个库吗?
留下 ★

或者运行
composer global require symfony/thanks && composer thanks
以感谢你当前项目中使用的所有库,包括这个!

通过Composer安装monolog-html-line-formatter

$ composer require serendipity_hq/ansi-converter-shq-theme

此库遵循http://semver.org/版本规范。

如何使用Serendipity HQ Rector Config

<?php

declare(strict_types = 1);

use SerendipityHQ\Integration\Rector\SerendipityHQ;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Rector\Core\Configuration\Option;
use Rector\Core\ValueObject\PhpVersion;

return static function (ContainerConfigurator $containerConfigurator) : void {
    $parameters = $containerConfigurator->parameters();

    $parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_81);
    $parameters->set(Option::PATHS, [__DIR__ . '/src', __DIR__ . '/tests']);
    $parameters->set(Option::BOOTSTRAP_FILES, [__DIR__ . '/vendor-bin/phpunit/vendor/autoload.php']);

    // Import directly the configuration from Serendipity HQ Rector Config
    $containerConfigurator->import(SerendipityHQ::SHQ_SYMFONY_APP);

    // Import the excluded rectors
    $toSkip = SerendipityHQ::buildToSkip(SerendipityHQ::SHQ_SYMFONY_APP_SKIP);

    // Set the rectors to exclude
    $parameters->set(Option::SKIP, $toSkip);
};

方法SerendipityHQ::buildToSkip()是可变参数的:它接受你需要的任意数量的数组。

使用它来排除你项目中不需要应用的rectors。

如果你想排除除了预定义配置中排除的rectors之外的其他rectors,只需在你的rector.php配置文件中创建一个数组,并将其传递给SerendipityHQ::buildToSkip()

<?php

declare(strict_types = 1);

use SerendipityHQ\Integration\Rector\SerendipityHQ;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Rector\Core\Configuration\Option;
use Rector\Core\ValueObject\PhpVersion;

return static function (ContainerConfigurator $containerConfigurator) : void {
    ...

    $othersToSkip = [
        \Rector\To\Exclude\Rector::class
    ];

    // Import the excluded rectors
    $toSkip = SerendipityHQ::buildToSkip(SerendipityHQ::SHQ_SYMFONY_APP_SKIP, $othersToSkip);

    // Set the rectors to exclude
    $parameters->set(Option::SKIP, $toSkip);
};

你喜欢这个库吗?
留下 ★

或者运行
composer global require symfony/thanks && composer thanks
以感谢你当前项目中使用的所有库,包括这个!