百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
L

lines

> 编程语言
开源

用于快速测量 PHP 项目大小的 CLI 工具,支持 PHP 的各种功能等。无依赖性。可在任何地方运行

352 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

用于快速测量 PHP 项目大小的 CLI 工具,支持 PHP 的各种功能等。无依赖性。可在任何地方运行

Lines of code and PHP Features

CLI tool for quick size measure of PHP project, and real used PHP features.

Zero dependencies. Runs anywhere.

What are killer features?

  • install anywhere - PHP 7.2? PHPUnit 6? Symfony 3? Not a problem, this package has zero dependencies and works on PHP 7.2+
  • get quick overview of your project size - no details, no complexity, just lines of code
  • get easy JSON output for further processing
  • measure used PHP features in your project - how much PHP 8.0-features used? How many attributes? How many arrow function? How many union types?

Install

The package is scoped and downgraded to PHP 7.2. So you can install it anywhere with any set of dependencies:

bash
composer require tomasvotruba/lines --dev

1. Measure Lines and Size

bash
vendor/bin/lines measure

By default, we measure the root directory. To narrow it down, provide explicit path:

bash
vendor/bin/lines measure src

For short output:

bash
vendor/bin/lines measure --short

For json output, just add --json:

bash
vendor/bin/lines measure --json

Also, you can combine them (very handy for blog posts and tweets):

bash
vendor/bin/lines measure --short --json

For the text output, you'll get data like these:

…

Or in a json format:

…

Longest files

Are you looking for top 10 longest files?

bash
vendor/bin/lines measure --longest
…

Scan package in /vendor

This tool measures your code, not the 3rd party libraries. It skips /vendor directory by default to avoid false positives. If you want to measure vendor files too, use --allow-vendor option:

bash
 vendor/bin/lines measure vendor/rector/rector --allow-vendor

2. PHP Feature Counter

Two codebases using PHP 8.4 in composer.json, are not the same codebases. One has zero type param/return/property declarations, other has promoted properties. Reveal their real value by counting PHP feature they actually use.

bash
vendor/bin/lines features src

For json output, just add --json:

bash
vendor/bin/lines features src --json

This command:

  • scans your codebase,
  • count PHP feature being used from which PHP version,
  • gives you quick overview of how modern the codebase really is

For the text output, you'll get data like these:

…

Or in a json format:

…

That's it. Happy coding!

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

PHPastfeatureslines-of-codemeasure

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言