定制 anlutro/phint 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

anlutro/phint

Composer 安装命令:

composer require anlutro/phint

包简介

README 文档

README

Build Status Latest Stable Version Latest Unstable Version License

Phint is a static code analysis tool for PHP. Very much a work in progress. Currently checks for:

  • Undefined variables
  • Properties/methods being called exist
  • Classes being used in your code exist (instantiation, type-hinting, instanceof)
  • Exception being caught actually exist and are exceptions (catch (stdClass $e) will error, for example)
  • Functions being called actually exist
  • Methods and functions are called with the correct number of arguments

More features to come. Check the Github issues.

Installation

On a per-project basis:

composer require --dev anlutro/phint:dev-master@dev
./vendor/bin/phint /path/to/src

Globally:

wget https://files.lutro.me/phint.phar
chmod +x phint.phar
sudo mv phint.phar /usr/local/bin
phint /path/to/src

Usage

Note that you must be in your project's root for Phint to run. You also need a composer autoloader to be present in vendor/autoload.php.

Example output from a simple command run:

You can pass --strict or -s as an arugment to get more errors. The errors marked as strict are more prone to be wrong, but should be more accurate as time goes on.

You can also pass --debug or -d to get some debug information. Currently this isn't much, unless you hit a fatal error, in which case you might get some more info.

By default, if you pass a directory or multiple file paths to the command, Phint will analyze all of them and spit out the errors as it goes along. If you pass --exit-early or -e, Phint will exit as soon as it finds a file with errors.

Notes

This tool makes some very heavy assumptions about how you're using it and your application.

Your project must have some sort of autoloader register script present in vendor/autoload.php. This autoloader must make every class and function in your project available.

The checker works best if all the files being checked are classes with methods, nothing more.

Contributing

See the CONTRIBUTING.md file for information on contributing.

License

The contents of this repository is released under the GPL v3 license. See the LICENSE file included for more information.

统计信息

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

GitHub 信息

  • Stars: 24
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2015-03-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固