承接 kubotak-is/php-del 相关项目开发

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

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

kubotak-is/php-del

最新稳定版本:1.0.0

Composer 安装命令:

composer require kubotak-is/php-del

包简介

Tool to remove code based on specific comments.

README 文档

README

Unit Test Latest Stable Version PHP Version Require License

Tool to remove code based on specific comments.

Install

composer require --dev kubotak-is/php-del

Configuration

Create php-del.json in the root directory of the project

{
  "dirs": [
    "src"
  ],
  "extensions": [
    "php"
  ]
}

dirs

Specify the directory to be searched for files.

extensions(Optional: Default php)

Specify the extension to be searched.

Usage

Add a comment with a flag for code like the following

public function code() {
    /** php-del start flag-a */
    $something = 1;
    /** php-del end flag-a */
}

Run php-del from composer command.

/vendor/bin/php-del

Select the flag and enter to perform the deletion.

Finding flag...
Please choice me one of the following flag: (press <Enter> to select)
  ○ flag-a (1)  

Deletion result

public function code() {
}

One Line code delete

To delete only one line.

use Hoge\Fuga\Piyo; // php-del line flag-a

Codes not covered

The ignore comment can be added to remove it from the deletion list.

public function code() {
    /** php-del start flag-a */
    $something = 1;
    /** php-del ignore start */
    $ignore = 2;
    /** php-del ignore end */
    /** php-del end flag-a */
}

Deletion result

public function code() {
    $ignore = 2;
}

File delete

Deletes the file itself by adding a file deletion comment.

<?php

/**
 * php-del file flag-a
 */
class DeleteClass {}

Support file

统计信息

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

GitHub 信息

  • Stars: 16
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-12-02