承接 airlst/rector-config 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

airlst/rector-config

最新稳定版本:4.3.12

Composer 安装命令:

composer require airlst/rector-config

包简介

Rector config for AirLST projects

README 文档

README

Latest Version on Packagist Total Downloads

Rector config for AirLST projects.

Installation

You can install the package via Composer:

composer require --dev airlst/rector-config

Usage

Create a rector.php in the root of your project with the following contents:

<?php

declare(strict_types=1);

$factory = new Airlst\RectorConfig\Factory(['src']);

return $factory->create();

The constructor of the Factory class takes an array of paths to be scanned for PHP files and fixed. You can pass any number of paths to it.

The method returns an instance of Rector\Configuration\RectorConfigBuilder which can be further configured. For example, you can instruct Rector to use file cache:

<?php

declare(strict_types=1);

$factory = new Airlst\RectorConfig\Factory(['src']);

return $factory
    ->create()
    ->withCache('cache/rector');

Using Laravel rules

You can use predefined Laravel rules by chaining the withLaravelRules() method before calling create():

<?php

declare(strict_types=1);

$factory = new Airlst\RectorConfig\Factory(['src']);

return $factory
    ->withLaravelRules()
    ->create();

Running Rector

Run Rector with the following command:

./vendor/bin/rector

Skipping rules

You can skip certain rules by chaining the withSkip() method before calling create():

<?php

declare(strict_types=1);

$factory = new Airlst\RectorConfig\Factory(['src']);

return $factory
    ->withSkip([
        Rector\DeadCode\Rector\PropertyProperty\RemoveNullPropertyInitializationRector::class,
    ])
    ->create();

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 18.83k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 6
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-02-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固