degraciamathieu / php-wording-detector
通过分析您的变量来检查您的DDD方法
v1.0.0
2024-05-12 13:15 UTC
Requires
- php: ^8.1
- degraciamathieu/php-file-explorer: 0.4.*
- illuminate/view: ^10.0
- laravel-zero/framework: ^10.0
- laravel/prompts: ^0.1.21
- nikic/php-parser: ^4.13
- nunomaduro/termwind: ^1.15
Requires (Dev)
- laravel/pint: ^1.5
- mockery/mockery: ^1.5.1
- phpunit/phpunit: ^10.0
This package is auto-updated.
Last update: 2024-09-13 07:29:55 UTC
README
php-wording-detector
一个简单的工具,用于分析和拆分代码中包含的单词,以检查您的DDD方法。
安装
Requires >= PHP 8.1
Phar
此工具作为 PHP存档(PHAR) 分发
wget https://github.com/DeGraciaMathieu/php-wording-detector/raw/master/builds/php-wording-detector
php php-wording-detector --version
Composer
或者,您可以直接使用composer
composer require degraciamathieu/php-wording-detector --dev
用法
默认情况下,仅分析变量
php php-wording-detector inspect {path}
--with-method
选项允许解析方法的名称
php php-wording-detector inspect {path} --with-method
$ php php-wording-detector inspect app/Domains/Activity
❀ PHP Wording Detector ❀
+-------------+-----------------------+-------------+
| total words | total distincts words | average use |
+-------------+-----------------------+-------------+
| 2'166 | 52 | 42 |
+-------------+-----------------------+-------------+
+--------------+-------+------------+
| words | usage | percentage |
+--------------+-------+------------+
| activity | 667 | 31% |
| data | 154 | 7% |
| code | 150 | 7% |
| item | 143 | 7% |
| query | 128 | 6% |
| request | 88 | 4% |
| mode | 85 | 4% |
| translations | 78 | 4% |
| id | 77 | 4% |
| type | 63 | 3% |
| new | 46 | 2% |
| product | 41 | 2% |
| translation | 41 | 2% |
| types | 40 | 2% |
| master | 33 | 2% |
| filters | 29 | 1% |
| language | 24 | 1% |
| builder | 23 | 1% |
| items | 22 | 1% |
| section | 21 | under 1% |
+--------------+-------+------------+